Chapter 30 — First User-Mode Shell

Chapter 30 — First User-Mode Shell
This entry is part 27 of 38 in the series Writing A Linux Style Operating System From Scratch

In Chapter 29, we added the first shared userland runtime. This chapter extends that runtime with formatted output and shell-oriented helpers, then uses it to build the first real long-running user-mode program: This first shell will run entirely in ring 3. It will read lines from stdin, parse commands, and execute a few built-in commands.

Chapter 29 — First Userland Runtime

Chapter 29 — First Userland Runtime
This entry is part 26 of 38 in the series Writing A Linux Style Operating System From Scratch

In Chapter 28, we cleaned up the user-program build system: now automatically builds: But our user programs still duplicate small helper functions: Both demo.c and counter.c contain nearly the same code. This chapter adds the first tiny Toyix userland support library: This is not a real libc yet, but it is the beginning of one.

Chapter 26 — Process Table, ps, runbg, and wait PID

Chapter 26 — Process Table, ps, runbg, and wait PID
This entry is part 23 of 38 in the series Writing A Linux Style Operating System From Scratch

In Chapter 25, the monitor gained an embedded program registry and a foreground run command: That gave us an exec-like path, but only in foreground mode: This chapter adds the next process-management layer: After this chapter, the monitor will support: The kernel still does not have job control, signals, or a filesystem, but it now

Chapter 24 — User argc / argv and a Real Initial Stack

Chapter 24 — User argc / argv and a Real Initial Stack
This entry is part 22 of 38 in the series Writing A Linux Style Operating System From Scratch

In Chapter 23, we crossed another major boundary: But the user program still started like this: That is not how we want user programs to look long-term. This chapter adds a real initial user stack with: Then crt0.S will pass those arguments to: This moves us closer to a normal process startup model. ELF process

Chapter 22 — First ELF32 Loader Milestone

Chapter 22 — First ELF32 Loader Milestone

In Chapter 21, we completed the process lifecycle: Now we can replace the temporary TOYEXE format with the first real executable-loader milestone: ELF32. ELF is the Executable and Linkable Format used by many Unix-like systems. The ELF specification defines the file header, program header table, and how loadable segments describe a process image; the generic

Chapter 20 — A Tiny Executable Format and User Program Loader

Chapter 20 — A Tiny Executable Format and User Program Loader
This entry is part 5 of 38 in the series Writing A Linux Style Operating System From Scratch

In Chapter 19, we gave each process its own address space: That was a major architectural milestone. But our user program is still not really “loaded.” We are still building a TOYEXE image inside process.c and handing it to the loader. This chapter adds a small executable format before jumping to ELF. We will call