[ prog / sol / mona ]

prog


What are you working on?

174 2021-01-06 11:02

>>172
It is kind of hyperbole, but also kind of true. What is a kernel? It is a software that switches between tasks and handles interrupts, manages memory, manages access to devices and manages multiple-processor systems. A simple program is one that just works with one file descriptor at a time and performs simple syscalls. A program that is not simple will need to solve one or more of the aforementioned problems itself.

A bare Linux process is more bare than a bare machine, but it has analogues for everything that exists on a bare machine, and all that Linux gives you is a common language for different hardwares. It does not solve the actual problems for you.

An analogograph: interrupt → signal; cooperative scheduler → event loop; hardware interval timer → timer_create; preemptive scheduler → stack-switching using a timer signal; multi-processor system → kernel threads; device access → file descriptors & mmap()'d files; DMA-based networking/disk → io_uring; page table → precisely what mmap() manipulates; device control & interprocessor interrupts → syscalls.

But at least Linux gets you user isolation, a shared file system and TCP/IP. And Docker, to undo much of that...

199


VIP:

do not edit these