How Early Programmers Imagined the Birth of Operating Systems
A nostalgic narrative explains how low‑level hardware control led to the invention of system calls, kernel/user modes, and ultimately the operating system concept, illustrating the transition from direct hardware manipulation to abstracted library functions.
In the 1950s programmers wrote code that ran directly on bare metal, managing CPU, memory, disks, and peripherals themselves. They could hard‑code physical memory addresses, specify exact disk cylinders and sectors, and read keyboard ports with assembly instructions such as:
mov ax, 0x1000 ; access physical memory
mov [ax], 0x42 ; write data
in al, 0x60 ; read keyboard port
mov [0x2000], al ; store key
mov dx, 0x1F0 ; disk controller port
mov al, 0x20 ; read sector command
out dx, al ; issue commandWhile this gave programmers god‑like control, the resulting programs were fragile, non‑portable, and prone to catastrophic crashes from incorrect hardware operations.
To improve safety and portability, the story proposes encapsulating all hardware interactions into a library. Programmers would then call high‑level functions instead of writing raw hardware code. However, novice programmers might still attempt to bypass the library with their own buggy hardware code.
The solution imagined is to restrict certain privileged instructions so they can only be executed inside the library. This is achieved by defining two CPU execution states: "expert" (kernel) and "novice" (user). When the library runs, the CPU is in expert mode and may execute any instruction, including privileged hardware operations. When control returns to user code, the CPU switches to novice mode, and any attempt to execute restricted instructions triggers an exception.
A special machine instruction (e.g., int 0x80) is used to transition from novice to expert mode, invoking the library (now called the operating system). After the library finishes, an iret returns to novice mode. This mechanism effectively creates system calls and the kernel/user mode distinction, laying the conceptual foundation for modern operating systems.
The narrative concludes that this clever mechanism, born from the need to protect hardware, is what we now call an operating system, with system calls as the interface between user programs and the kernel.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
