Does linux schedule a process or a thread?

The Linux scheduler (on recent Linux kernels, e.g. 3.0 at least) is scheduling schedulable tasks or simply tasks. A task may be : a single-threaded process (e.g. created by fork without any thread library) any thread inside a multi-threaded process (including its main thread), in particular Posix threads (pthreads) kernel tasks, which are started internally … Read more

What is the difference between the kernel space and the user space?

The really simplified answer is that the kernel runs in kernel space, and normal programs run in user space. User space is basically a form of sand-boxing — it restricts user programs so they can’t mess with memory (and other resources) owned by other programs or by the OS kernel. This limits (but usually doesn’t … Read more

Keyboard IRQ within an x86 kernel

You have a number of issues with your code. The main ones are discussed individually below. The HLT instruction will halt the current CPU waiting for the next interrupt. You do have interrupts enabled by this point. After the first interrupt (keystroke) the code after HLT will be executed. It will start executing whatever random … Read more

C# driver development?

You can not make kernel-mode device drivers in C# as the runtime can’t be safely loaded into ring0 and operate as expected. Additionally, C# doesn’t create binaries suitable for loading as device drivers, particularly regarding entry points that drivers need to expose. The dependency on the runtime to jump in and analyze and JIT the … Read more

How is Linux kernel live debugging done and what tools are used?

Another option is to use an ICE or JTAG controller, and GDB. This ‘hardware’ solution is especially used with embedded systems. But for instance QEMU offers similar features: start QEMU with a GDB ‘remote’ stub which listens on ‘localhost:1234’ : qemu -s …, then with GDB, you open the kernel file vmlinux compiled with debug … Read more

tech