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
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
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
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
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
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
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
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
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
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
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
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
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
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
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