Skip to the content ForoHackers
Log inJoin

Kernels: start here

Kernels
#3375 · · Quote · Report

A kernel is the core of an operating system: the code that runs with full privilege and shares the hardware among programs. It schedules processors, manages memory, talks to devices and enforces isolation. Everything else, from the shell to the browser, depends on the promises a kernel keeps.

Key concepts

  • Privilege levels: the processor separates kernel mode from user mode, so a program cannot touch the hardware directly.
  • Scheduling: deciding which task runs on which processor, for how long, and in what order.
  • System calls: the controlled entry point from user programs into the kernel.
  • Virtual memory: each process sees its own address space, mapped by the kernel onto physical memory.
  • Kernel designs: a monolithic kernel keeps most services in one privileged image; a microkernel keeps little there and runs the rest as ordinary processes.

Vocabulary

  • Interrupt: a hardware signal that makes the processor stop and run a kernel handler.
  • Context switch: saving one task's state and restoring another's.
  • Module: kernel code loaded after boot, such as a driver.
  • Panic: the kernel stops because it has found a state it cannot safely continue from.

What to study, in order

  1. Operating-system concepts: processes, threads, scheduling, synchronisation, virtual memory.
  2. Boot a tiny teaching kernel in an emulator and print to the screen from it.
  3. Add a timer interrupt and a simple round-robin scheduler.
  4. Add paging and a memory allocator, and test them on purpose with bad accesses.
  5. Implement a system call and call it from a user program.

Related tags

#linux #memory-management #device-drivers #assembly #c

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply