Linux Kernel From First Principles

What to learn the internals of the Linux kernel? Version 6.5-rc5 has about 36 million lines of code in it, so good luck! [Seiya] has a different approach. Go back to the beginning and examine the 0.01 version of the kernel. Now you are talking about 10,000 lines and, removing comments and blanks, way less.

Sure, some things have changed, but the core ideas are the same. [Seiya] reports, “Reading V0.01 was really for me. It was like visiting Computer History Museum in Mountainview…”

There were only 66 system calls in that antique kernel. Some important features like mounting did not work yet. The sys_mount call simply returns -ENOSYS, for example. Some functions like the built-in strcpy were hardcoded for i386 CPUs — obviously, that’s changed today.

The kernel supports a small number of devices, including an ATA disk controller, a PS/2 keyboard, a VGA display in text mode, and some system clocks and timers. No need to worry about running a GUI like X or Wayland on this kernel!

Some of the comments are amusing in retrospect. For example: “schedule() is … GOOD CODE! There probably won’t be any reason to change this,…” Of course, there were lots of reasons to change it, and now there are many options for different use cases.

This turned out to be a read-only endeavor because — surprise — the kernel code isn’t able to compile with modern compilers. It didn’t seem worth the effort to modify the source, but reading it is certainly an interesting exercise.

We are big believers in learning things by going back to first principles. Works for Doppler radar. Multirotor drones, too.

Next Post

Kazakhstan Proposes Power Price Hikes And Taxes Targeting Crypto Miners

The Kazakh government is considering a three-pronged proposal designed to make crypto miners pay much more for operating in the country, which could make Kazakhstan less attractive to the industry. On Feb. 4, Kazakhstan’s First Vice Minister of Finance, Marat Sultangaziyev, proposed a price increase from $0.0023 per Kwh to $0.01 (around […]
Kazakhstan Proposes Power Price Hikes And Taxes Targeting Crypto Miners

You May Like