Skip to content

YAK 1.1.0

Latest

Choose a tag to compare

@FreakySneaky787 FreakySneaky787 released this 06 Nov 14:17
2531da5

1.1.0 (2026-11-06)

The course release: chapters 1–20 of the course – parts I to V and the start of part VI – each a complete project
in course/NN-slug/ with its own make test, all of them built and tested by CI. The reference kernel is the one of
1.0.0, with two test fixes. I decided on 2026-11-06 to stop the course at chapter 20 for now (docs/ROADMAP.md).

Course

  • Chapter 20 – Ring 3 and the first system call, the start of part VI: user segments, RSP0 set per thread at every
    switch, USER pages, iretq into ring 3, int 0x80 with write (addresses checked) and exit, and faults in
    ring 3 that end the program instead of the kernel.
  • Chapter 19 – A block cache, and the disk's interrupt, the end of part V: a write-through sector cache (394 disk
    commands for a 100 000-byte file become 196, then 0) and MSI from the SATA controller, so disk commands sleep in
    wait_for.
  • Chapter 18 – Writing FAT32: new files, appended data, directories and removal in a crash-tolerant order;
    check-disk.sh hands the disk image to fsck.fat and mtools after every test run.
  • Chapter 17 – Reading FAT32: boot sector, cluster chains (a chain in a circle is an error, not a hang), long names
    and the lower-case flags, ls and cat; the test disks are made by mkfs.fat and mtools.
  • Chapter 16 – PCI and a SATA disk, the start of part V: PCI enumeration, an AHCI driver that reads sectors by DMA,
    disk and read in the shell.
  • Chapter 15 – One scheduler for all CPUs, the end of part IV: a timer and an idle thread per CPU, the scheduler lock
    held through the switch, waiting that cannot lose a wake-up sent from another CPU. Bugs #29 (a timer test window
    too narrow for a busy host) and #30 (join returned while the ended thread was still on its CPU) found on the way.
  • Chapter 14 – The other CPUs: a real-mode trampoline below 1 MiB, INIT/STARTUP IPIs, a GDT, TSS and stack per
    CPU, and run_on for jobs on other CPUs; QEMU runs with 4 CPUs. Bug #28 in chapter 13 fixed on the way (the
    boot hung about once in 20 in task::init).
  • Chapter 13 – Threads and a scheduler: kernel threads with guarded stacks, a context switch in assembly,
    round-robin preemption by the local APIC timer, and blocking waits (sleep, keyboard, join) without lost wake-ups;
    the heap now locks with interrupts off, since the timer handler allocates.
  • Chapter 12 – ACPI and the APIC, the start of part IV: the MADT from the ACPI tables, the I/O APIC routing the
    timer and the keyboard, and the local APIC timer measured against the PIT; QEMU runs with a local APIC again.
    Bug #27 found and fixed on the way (the PIT's square wave ticked twice per period through the I/O APIC).
  • Chapter 11 – A first shell, part III: a line editor, a splitter for words with quotes, and a table of six
    commands; make test types four commands with QEMU's sendkey and checks the answers.
  • Chapter 10 – The heap, the end of part II: a free-list allocator behind #[global_allocator] that grows by
    mapping pages with chapter 9's map; Box, Vec and String work in the kernel, and a request over the
    limit (fault=heap) ends in a panic.
  • Chapter 9 – Paging: the live page tables read and changed (translate, map, unmap), and kernel stacks with
    a guard page – a real stack overflow ends in the double fault handler.
  • Chapter 8 – Physical memory, the start of part II: Limine's memory map, a bitmap frame allocator over the
    usable RAM, and physical addresses reached through the higher-half direct map.
  • Chapter 7 – The keyboard, the end of part I: IRQ 1, a ring buffer between handler and kernel, a scancode
    decoder with Shift and Caps Lock, and a kernel that echoes what you type. make test types on the emulated
    keyboard with QEMU's sendkey.
  • Chapter 6 – Hardware interrupts and the timer: the 8259 PIC moved to vectors 32–47, a 100 Hz PIT timer, and
    sleep_ms that waits in hlt and never ends early. From this chapter on QEMU runs with a CPU without local APIC
    (bug #25: under QEMU 8.2 no PIC interrupt arrives otherwise).
  • Chapter 5 – Interrupts and exceptions: an IDT with handlers for six CPU exceptions, a double fault that survives a
    broken stack on IST1, and faults on purpose via the kernel command line (KERNEL_CMDLINE=fault=page make run).
  • Chapters 1–4 checked as a first reader would use them: the pages now show every line a learner has to change
    (including the calls in kmain), name the diff command against the previous chapter, and QEMU's own messages in
    make test go to build/qemu.log (printed when a check fails).
  • Issue forms "I got stuck in a course chapter" and "Feedback on the course"; CONTRIBUTING.md.
  • scripts/check-course.py also checks the course table, the issue form's chapter list and the diff line of each page.

Infrastructure

  • The CI course job builds and tests every chapter (20 now, about 6½ minutes) and installs dosfstools and mtools
    for the FAT32 test disks of chapters 17–20.

Tests

  • paging::translate no longer reads the PAT bit of a 2 MiB or 1 GiB page as an address bit (bug #26; no caller
    was affected, all of them translate 4 KiB pages).
  • The userspace integration test no longer fails when a 100 ms sleep wakes up two ticks late on a busy host (bug #24).