Chapter 36.5 – A Testing Detour and a Real Smoke Harness

Chapter 36.5 – A Testing Detour and a Real Smoke Harness
This entry is part 33 of 34 in the series Writing A Linux Style Operating System From Scratch

Chapter 36 added SYS_STAT, which was the right filesystem step. But it also exposed a testing problem that has been growing for a while. Right now, Toyix testing is split across three awkward places: That worked while the system was small. It does not scale well now that Toyix has: The biggest smell is that

Chapter 35 — SYS_SEEK and Rewindable File Descriptors

Chapter 35 — SYS_SEEK and Rewindable File Descriptors
This entry is part 32 of 34 in the series Writing A Linux Style Operating System From Scratch

In Chapter 34, Toyix gained its first tiny file layer: The shell could now do: But file descriptors were strictly forward-only. Once a file was read, its offset moved forward. There was no way to rewind, skip, or query position. This chapter adds: After this chapter, userland can do: And the shell gains a small

Chapter 34 — First RAMFS and Core File APIs

Chapter 34 — First RAMFS and Core File APIs
This entry is part 31 of 34 in the series Writing A Linux Style Operating System From Scratch

By the end of Chapter 33, Toyix could launch child processes, inspect child state from the shell, and request cooperative termination: At this point, Toyix can: The next major subsystem is files. This chapter adds the first tiny filesystem path: After this chapter, the user shell can do: This is not a disk filesystem yet.

Chapter 33 — Process Termination and Kill Checks

Chapter 33 — Process Termination and Kill Checks
This entry is part 30 of 34 in the series Writing A Linux Style Operating System From Scratch

By the end of Chapter 32, Toyix could launch child processes, wait for them, and keep exited children around as zombies until the parent collected them. For this chapter, we also extend the shell and syscall ABI just enough to inspect child state from user mode: That gives the shell basic process ownership and job-state

Chapter 32 — Process Ownership, Waiting, and Job State

Chapter 32 — Process Ownership, Waiting, and Job State
This entry is part 29 of 34 in the series Writing A Linux Style Operating System From Scratch

In Chapter 32, the user shell gained: That let a user process launch another user process: The flow worked: But the process model was too loose. Any process could wait for any PID. This chapter tightens that up. We will add: After this chapter, a child process belongs to the process that launched it: Then:

Chapter 29 — First Userland Runtime

Chapter 29 — First Userland Runtime
This entry is part 26 of 34 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 34 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 34 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 23 — Building a Real User C Program and Embedding Its ELF

Chapter 23 — Building a Real User C Program and Embedding Its ELF
This entry is part 21 of 34 in the series Writing A Linux Style Operating System From Scratch

In Chapter 22, the kernel gained a first ELF32 loader. That was a big step, but our test ELF was still built by hand inside process.c: This chapter removes that artificial piece. We will add a tiny userland build pipeline: GNU objcopy is specifically designed to copy and transform object files between formats; we will

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