Linux interview question


What happens when I dereference a NULL pointer in kernel space?

    Kernel panic 

 What's the difference between initrd and initramfs?

    Initrd is a separate image loaded by the bootloader, while intramfs is embedded within the kernel image.

 How is the scheduler called in Linux Kernel?

    In the Linux kernel, the scheduler is invoked by a periodic timer interrupt. This is called periodic scheduling which is essential for preempting tasks that have consumed more CPU cycles in order to offer other tasks on run-queue a fair chance to utilize the CPU. The scheduler is also invoked by kernel functions that block the current task, and this allows the scheduler to decide on which task on the run-queue should run and context switch to that task

What is the difference between vmlinux and vmlinuz?

  • Vmlinux stands for Linux kernel with virtual memory(VM) this is the kernel image.
  • Vmlinuz is the compressed kernel image.

What is the necessity of the probe and init? Why can't we have only a probe?

  •  Init is used for setting up the driver. The probe is used for each individual device that matches the vendor and device id of the given driver. So imagine wanting to be able to use a bunch of different USB storage devices at the same time. You only want device initialization to happen to one USB device when you plug it in, right, and that is what the probe function allows you to do. Init is important because it is the unified way of starting a kernel module, regardless of the device drivers that it registers.

What is the use of system. map file?

  •     It contains a symbol table to be used by the kernel. If anyone wants to know the address of any symbol or variable with memory mapping details then it can be easily received from the respective system. map file.

what is the reason for the unknown symbol error at insmod time?

  • all KO used symbol is not present in the Kernel symbol table.
    • or 
  • init_module return non zero values.

Why we need Userspace and Kernel space?


Comments

Popular posts from this blog

Cryptography and Encryption Basics - I

Overview of ISO/SAE 21434 Standard

UDS Protocol Interview Question