EmbLogic's Blog

Category Archives: Uncategorized

elv_next_request of block driver

The kernel provides the function elv_next_request to obtain the first incomplete request on the queue, that function returns NULL when there are no requests to be processed. Note that elv_next_request does not remove the request from the queue. If you … Continue reading →

Posted in Uncategorized | Leave a comment

Basic block request flow

In block driver request function check whether request is valid or not as per filesystem request. void request(request_queue_t *queue); After validation ,it calls transfer function to perform the write or read operation. sbull_transfer(dev, req->sector, req->current_nr_sectors, req->buffer, rq_data_dir(req));

Posted in Uncategorized | Leave a comment

Block driver main structure

struct sbull_dev { int size; /* Device size in sectors */ u8 *data; /* The data array */ short users; /* How many users */ short media_change; /* Flag a media change? */ spinlock_t lock; /* For mutual exclusion */ … Continue reading →

Posted in Uncategorized | Leave a comment

Gendisk structure

struct gendisk (declared in <linux/genhd.h>) is the kernel’s representation of an indi- vidual disk device. In fact, the kernel also uses gendisk structures to represent parti- tions, but driver authors need not be aware of that. There are several fields … Continue reading →

Posted in Uncategorized | Leave a comment

Block Driver

After character devices and network devices, block devices are another important device type of any system ?Block Devices are used for the storage of application code and data, and user data, they are often critical to the overall performance of … Continue reading →

Posted in Uncategorized | Leave a comment

IDT Table

The IDT is stored in the idt_table table, which includes 256 entries. The 6-byte idt_descr variable specifies both the size of the IDT and its address, it is used only when the kernel initializes the idtr register with the lidt … Continue reading →

Posted in Uncategorized | Leave a comment

Interrupt gate

An Intel interrupt gate that cannot be accessed by a User Mode process (the gate’s DPL field is equal to 0). All Linux interrupt handlers are activated by means of interrupt gates, and all are restricted to Kernel Mode.

Posted in Uncategorized | Leave a comment

Modules vs Programs Modules vs Programs

A program usually begins with a main() function, executes a bunch of instructions and terminates upon completion of those instructions. Kernel modules work a bit differently. A module always begin with either the init_module or the function you specify with … Continue reading →

Posted in Uncategorized | Leave a comment

How Do Modules Get Into The Kernel

When the kernel needs a feature that is not resident in the kernel, the kernel module daemon kmod ‘execs’ modprobe to load the module in. modprobe is passed a string in one of two forms: * A module name like … Continue reading →

Posted in Uncategorized | Leave a comment

8051 programming in c

If we need to refer to single bit of controller then syntax is sbit led p1^1; then change in led variable reflect on 1 pin of p1 port

Posted in Uncategorized | Leave a comment

Interrupt Handling

All interrupt handlers perform the same four basic actions: 1. Save the IRQ value and the registers contents in the Kernel Mode stack. 2. Send an acknowledgment to the PIC that is servicing the IRQ line, thus allowing it to … Continue reading →

Posted in Uncategorized | Leave a comment

3d globe

In 3d globe ,u need to calculate time slot using rpm of the machine.with this u can calculate which leds needs to be lighted up at that particular instant

Posted in Uncategorized | Leave a comment

Interrupt Descriptor table

A system table called Interrupt Descriptor Table (IDT) associates each interrupt or exception vector with the address of the corresponding interrupt or exception handler. The IDT must be properly initialized before the kernel enables interrupts. The IDT format is similar … Continue reading →

Posted in Uncategorized | Leave a comment

DTMF decoder circiut

In DTMF we use 8770 ic which decode the dual-tone, multi-frequency send through u’r phone. After this u can program u’r IC to do specified works

Posted in Uncategorized | Leave a comment

IRQ’S

Each hardware device controller capable of issuing interrupt requests has an output line designated as an IRQ (Interrupt ReQuest). All existing IRQ lines are connected to the input pins of a hardware circuit called the Interrupt Controller, which performs the … Continue reading →

Posted in Uncategorized | Leave a comment