EmbLogic's Blog

Author Archives: gaurav

Process Switching

In order to control the execution of processes, the kernel must be able to suspend the execution of the process running on the CPU and resume the execution of some other process previously suspended. This activity is called process switching … Continue reading →

Posted in Uncategorized | Leave a comment

usb pipe

While the device sends and receives data on a series of endpoints, the client software transfers data through pipes. A pipe is a logical connection between the host and endpoint(s). Pipes will also have a set of parameters associated with … Continue reading →

Posted in Uncategorized | Leave a comment

USB handshake Packets

Handshake Packets ACK – Acknowledgment that the packet has been successfully received. NAK – Reports that the device temporary cannot send or received data. Also used during interrupt transactions to inform the host there is no data to send. STALL … Continue reading →

Posted in Uncategorized | Leave a comment

Linux-hotplug

To enable the linux-hotplug system to load the driver automatically when the device is plugged in, you need to create a MODULE_DEVICE_TABLE. The following code tells the hotplug scripts that this module supports a single device with a specific vendor … Continue reading →

Posted in Uncategorized | 1 Comment

USB Function

When we think of a USB device, we think of a USB peripheral, but a USB device could mean a USB transceiver device used at the host or peripheral, a USB Hub or Host Controller IC device, or a USB … Continue reading →

Posted in Uncategorized | Leave a comment

USB

Unlike RS-232 and similar serial interfaces where the format of data being sent is not defined, USB is made up of several layers of protocols. Once you understand what is going on, you really only have to worry about the … Continue reading →

Posted in Uncategorized | Leave a comment

Wait queue pointer

Wait queues are implemented as cyclical lists whose elements include pointers to process descriptors. Each element of a wait queue list is of type wait_queue: struct wait_queue { struct task_struct * task; struct wait_queue * next; }; Each wait queue … Continue reading →

Posted in Uncategorized | Leave a comment

Wait queue

Wait queues have several uses in the kernel, particularly for interrupt handling, process synchronization, and timing. Wait queues implement conditional waits on events: a process wishing to wait for a specific event places itself in the proper wait queue and … Continue reading →

Posted in Uncategorized | Leave a comment

Original parent of process

p_opptr (original parent):- Points to the process descriptor of the process that created P or to the descriptor of process 1 (init) if the parent process no longer exists. Thus, when a shell user starts a background process and exits … Continue reading →

Posted in Uncategorized | Leave a comment

Parenthood Relationships Among Processes

Processes created by a program have a parent/child relationship. Since a process can create several children, these have sibling relationships. Several fields must be introduced in a process descriptor to represent these relationships. Processe 0 and 1 are created by … Continue reading →

Posted in Uncategorized | Leave a comment

USB

Unlike RS-232 and similar serial interfaces where the format of data being sent is not defined, USB is made up of several layers of protocols. While this sounds complicated, don’t give up now. Once you understand what is going on, … Continue reading →

Posted in Uncategorized | Leave a comment

Runqueues

The runqueue list groups together all processes in a TASK_RUNNING state. When it comes to grouping processes in other states, the various states call for different types of treatment. Processes in a TASK_STOPPED or in a TASK_ZOMBIE state are not … Continue reading →

Posted in Uncategorized | Leave a comment

Runqueues

The add_to_runqueue( ) function inserts a process descriptor at the beginning of the list, while del_from_runqueue( ) removes a process descriptor from the list. For scheduling purposes, two functions, move_first_runqueue( ) and move_last_runqueue( ), are provided to move a process … Continue reading →

Posted in Uncategorized | Leave a comment

The list of TASK_RUNNING processes

When looking for a new process to run on the CPU, the kernel has to consider only the runnable processes (that is, the processes in the TASK_RUNNING state). Since it would be rather inefficient to scan the whole process list, … Continue reading →

Posted in Uncategorized | Leave a comment

The Current Macro

The pairing between the process descriptor and the Kernel Mode stack offers a key benefit in terms of efficiency: the kernel can easily obtain the process descriptor pointer of the process currently running on the CPU from the value of … Continue reading →

Posted in Uncategorized | Leave a comment