Operating Systems 2019F Lecture 18

From Soma-notes

Video

Video from the lecture given on November 13, 2019 is now available.

Notes

Lecture 18
----------

When you're in a kernel module, you're in the Linux kernel
* context is *all* of the code in the linux kernel
* you have access to all code and data structures, if you can figure
  out how to access them
* You include linux kernel headers to be able to access this functionality
* You *cannot* access standard libraries, they don't exist
  - and even if you did ad the code, key abstractions such as file descriptors,
    ttys, and such don't exist!  So you're probably in trouble

One big problem is that the Linux kernel changes fast
* so online documentation gets out of date
* authority is really the code itself
* but articles on lwn.net are helpful


Processes vs. threads
* process: one or more CPU contexts + address space
* thread: a CPU context in an address space

So a process can have one or more threads

In the kernel, "current" refers to the process/thread (task) that made the current system call.

initrd = initial ram disk
 - how do you load modules needed to access the root filesystem when
   you don't have access to the root filesystem?
   - drivers, fs, network
 - initrds will have
   - kernel modules
   - scripts & executables necessary for loading modules, other setup

Boot loader loads kernel image & initrd into memory, then starts kernel
  - telling it where in memory the initrd is