EmbLogic's Blog

Author Archives: gaurav

esp register

The esp register is the CPU stack pointer, which is used to address the stack’s top location. On Intel systems, the stack starts at the end and grows toward the beginning of the memory area. Right after switching from User … Continue reading →

Posted in Uncategorized | Leave a comment

The Task array.

Processes are dynamic entities whose lifetimes in the system range from a few milliseconds to months. Thus, the kernel must be able to handle many processes at the same time.The kernel reserves a global static array of size NR_TASKS called … Continue reading →

Posted in Uncategorized | Leave a comment

POSIX threads

Lightweight processes should not be confused with user-mode threads, which are different execution flows handled by a user-level library. For instance, older Linux systems implemented POSIX threads entirely in user space by means of the pthread library; therefore,a multithreaded program … Continue reading →

Posted in Uncategorized | Leave a comment

Programmable Interval Timer

Linux programs the first PC’s PIT to issue timer interrupts on the IRQ0 at a (roughly) 100-Hz frequency, that is, once every 10 milliseconds. This time interval is called a tick, and its length in microseconds is stored in the … Continue reading →

Posted in Uncategorized | Leave a comment

Time Stamp Counter

Starting with the Pentium, many recent Intel 80×86 microprocessors include a 64-bit Time Stamp Counter (TSC ) register that can be read by means of the rdtsc assembly language instruction. This register is a counter that is incremented at each … Continue reading →

Posted in Uncategorized | Leave a comment

kobjects

t is rare (even unknown) for kernel code to create a standalone kobject; instead, kobjects are used to control access to a larger, domain-specific object. To this end, kobjects are found embedded in other structures. If you are used to … Continue reading →

Posted in Uncategorized | Leave a comment

Timing measurement by Linux kernel

Two main kinds of timing measurement that must be performed by the Linux kernel: Keeping the current time and date, so that they can be returned to user programs through the time( ), ftime( ), and gettimeofday( ) system calls. … Continue reading →

Posted in Uncategorized | Leave a comment

kernel control path

The sequence of instructions executed in Kernel Mode to handle a kernel request is denoted as kernel control path : when a User Mode process issues a system call request, for instance, the first instructions of the corresponding kernel control … Continue reading →

Posted in Uncategorized | Leave a comment

Reentrant kernel

??All Unix kernels are reentrant : this means that several processes may be executing in Kernel Mode at the same time. Of course, on uniprocessor systems only one process can progress, but many of them can be blocked in Kernel … Continue reading →

Posted in Uncategorized | Leave a comment

Block Nonentry Request

Block drivers often attempt to retry requests that fail the first time. This behavior can lead to a more reliable system and help to avoid data loss. The kernel, however, sometimes marks requests as not being retryable. Such requests should … Continue reading →

Posted in Uncategorized | Leave a comment

The Bio Structure

The bio structure contains everything that a block driver needs to carry out the request without reference to the user-space process that caused that request to be initiated. The bio structure, which is defined in <linux/bio.h>, contains a number of … Continue reading →

Posted in Uncategorized | Leave a comment

USB Devices

There are different types of USB devices as they can be used for different purposes. First a device can be self powered, bus powered or both. The USB can provide a power supply up to 500mA for its devices. If … Continue reading →

Posted in Uncategorized | Leave a comment

Sbull open

Once sbull_open has its device structure pointer, it calls del_timer_sync to remove the “media removal” timer, if any is active. Note that we do not lock the device spinlock until after the timer has been deleted; doing otherwise invites deadlock … Continue reading →

Posted in Uncategorized | Leave a comment

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

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