D03 STAGE2 OK D03 PAYLOAD OK D04 E820 OK D04 A20 OK D04 PM OK - BootInfo v1 EXCEPTION vector=3 error=0 eip=0x100fa6 cs=8 flags=402 EAX=11111111 EBX=44444444 ECX=22222222 EDX=33333333 ESI=66666666 EDI=77777777 EBP=55555555 PUSHAD_ESP=11cd44 DS=10 ES=10 FS=10 GS=10 EXCEPTION RETURN OK D08 PIT divisor=11932 IRQ0 vector=32 TIMER ticks=10 TIMER ticks=20 TIMER OK - IRQ disabled for console regression KERNEL_MAIN OK WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWscroll 0 scroll 1 scroll 2 scroll 3 scroll 4 scroll 5 scroll 6 scroll 7 scroll 8 scroll 9 scroll 10 scroll 11 scroll 12 scroll 13 scroll 14 scroll 15 scroll 16 scroll 17 scroll 18 scroll 19 scroll 20 scroll 21 scroll 22 scroll 23 scroll 24 scroll 25 scroll 26 scroll 27 FMT ok Z -2147483648 4294967295 deadbeef 0x1234 % ZERO 0 0 0 0x0 NULL (null) unknown=%q trailing=% abc RB CONSOLE OK D10 physical pages 4 KiB cap=64 MiB SYNTHETIC map overlap/round/high/overflow OK E820 records=6 free=16067 kernel_end=0x11cdc0 allocator preserves IF=0 and IF=1 OK unique/write/free OK; invalid/double free rejected exhausted=16067 one-page reuse OK all-page patterns OK recovered=16067 MEMORY OK D11 paging 10/10/12 supervisor RW identity 64 MiB PG+WP enabled CR3=0x11d000 same stack=0x11cd60 remap A -> B + INVLPG OK PAGE FAULT CR2=0x40000000 error=0 EIP=0x102fa0 nonpresent read repaired; same EIP retry OK PAGE FAULT CR2=0x40000000 error=3 EIP=0x102fa6 WP readonly write repaired; same EIP retry OK PAGING OK retained tables=18 free=16049 D12 page-backed heap align=16 arenas=4 physical-page failure unchanged; recovery OK sizes/patterns first-fit split/coalesce OK overflow/invalid/double/tail/metadata reject OK IF=0/1 preserved; exhausted=512 recovered=4 pages HEAP OK retained paging tables=18 D13 TASKS A=128 B=128 switches=387 reaped=2 D13 stack used A=260 B=260 of 4096; locals/registers OK TASKS OK pages recovered; IF=0/1 preserved D14 PREEMPT A=742145 B=200000 switches=17 D14 seven-GPR/flags/DF probes=8; deferred ticks=3 D14 nested/IF0/CLI OK; stacks=324,324 reaped=2 PREEMPT OK pages recovered; returning to keyboard D15 WAIT FIXED: real PIT producer, three event orders D15 events produced=3 consumed=3 woken=0,1,1 D15 pending=1 lost=0 rescued=0 sleeps=8 idle=24 WAIT OK stacks=312,164 reaped=2 pages recovered D16 ring3 round=0 private VA=40001000 bad=1 D16 fault=14 error=7 eip=4000005e survivor+=904249 D16 ring3 round=1 private VA=40001000 bad=2 D16 fault=13 error=0 eip=40000066 survivor+=901299 D16 ring3 round=2 private VA=40001000 bad=3 D16 fault=13 error=0 eip=4000006b survivor+=836757 USER OK ring3 CR3/TSS; rollback=7 reaped=6 pages=16049 D17 int80 write/yield and user-copy checks=4 D17 WRITE % NO-NUL D17 READONLY OK D17 CROSS-PAGE D17 returns write=13 yield=0 unknown=ffffffda zero=0 long=ffffffea low=fffffff2 wrap=fffffff2 upper=fffffff2 missing=fffffff2 supervisor=fffffff2 ro=10 cross=f regs=1 D17 gate DPL #GP error=102 eip=40000077 survivor+=3844079 SYSCALL OK calls=12 writes=3 errors=7 irq_ticks=1 yield_delta=1799481 reaped=4 D18 ELF32 entry=40000080 image=4332 alloc=7 invalid=34 rollback=8 D18 ELF32 data/BSS/stack OK ELF OK data/BSS/stack; code=RO data=RW rollback=8 reaped=1 pages=16049 D19 COUNT running D19 BADPTR faulting D19 COUNT exit=7 D19 REAP pid=2 status=7 by=wait pages=16033 D19 REAP pid=3 status=1000e by=wait pages=16041 D19 DEMO round OK D19 COUNT running D19 BADPTR faulting D19 REAP pid=5 status=1000e by=wait pages=16033 D19 COUNT exit=7 D19 REAP pid=4 status=7 by=wait pages=16041 D19 DEMO round OK D19 DEMO exit=9 D19 REAP pid=1 status=9 by=pid0 pages=16049 D19 COUNT running D19 BADPTR faulting D19 ORPHAN parent exits D19 COUNT exit=7 D19 REAP pid=6 status=b by=pid0 pages=16033 D19 REAP pid=7 status=7 by=pid0 pages=16041 D19 REAP pid=8 status=1000e by=pid0 pages=16049 PROCESS OK mode=normal reaped=8 wait=4 blocks=2 faults=10 rollback=0 survivor+=3 pages=16049 D20 ATA primary master LBA28 sectors=16384 reads=3 D20 hashes mbr=98939bcd lba2047=c748f45 lba16383=d95e8545 range=3 BLOCK OK mode=0 result=0 followup=0 failed=0 ticks=0 D21 FAT mode=0 result=1479 part=2048+14336 clusters=14191 file=1479 read=1479 hash=f34dc752 steps=3 slices=3 bad=0 lba=2195 FAT OK mode=0 D22 FD begin D22 CHILD shared offset +19 D19 REAP pid=10 status=13 by=wait pages=16042 D22 CHILD fault after shared +11 D19 REAP pid=11 status=1000e by=wait pages=16042 D19 REAP pid=12 status=0 by=wait pages=16035 D19 REAP pid=13 status=0 by=wait pages=16042 D22 readonly source accepted D22 FD independent/shared offsets, EOF, errors and limits OK D19 REAP pid=9 status=16 by=pid0 pages=16049 FD OK mode=0 reaped=5 exit-closes=14 rollback=0 blocks=0 pages=16049 # # # echo hello hello D19 REAP pid=15 status=0 by=wait pages=16043 # echo hello world hello world D19 REAP pid=16 status=0 by=wait pages=16043 # cat readme.txt BUILD-AN-OS READ-ONLY FAT16 IMAGE This file belongs to the teaching operating system built across the series. The disk begins with a hand-written MBR and second-stage loader. The kernel is loaded from fixed sectors so that the boot contract stays independent from the file system introduced later. Day 20 added a polling ATA PIO driver for the primary master. It identifies the device, checks the LBA28 capacity, reads one 512-byte sector at a time, and stops reusing the channel after a command timeout or device error. Day 21 adds a read-only FAT16 layer above that block interface. The volume is inside the first MBR partition. Its type is determined from the number of data clusters, not from the FAT16 label. Directory entries use uppercase 8.3 names. README.TXT is intentionally stored in a non-contiguous chain. Its first three clusters are 2, 9, and 4. A correct reader must follow the FAT instead of adding one to the previous cluster number. The directory file size, not the final sector boundary, determines where the visible bytes end. The tutorial keeps this volume read-only. It does not implement long file names, subdirectories, allocation, truncation, crash recovery, or a buffer cache. Corrupt BPB fields and corrupt cluster chains are rejected instead of being converted into an apparently successful short read. Later chapters will open this file through a descriptor, print it from the user-mode shell, and send its bytes through a two-stage pipeline. D19 REAP pid=17 status=0 by=wait pages=16043 # nosuch shell: command not found # echo recovered recovered D19 REAP pid=18 status=0 by=wait pages=16043 # argtest one two ARGUMENT STACK OK D19 REAP pid=19 status=0 by=wait pages=16043 # badmagic shell: invalid executable # echo afterbad afterbad D19 REAP pid=20 status=0 by=wait pages=16043 # fault D19 REAP pid=21 status=1000e by=wait pages=16043 shell: child failed # echo afterfault afterfault D19 REAP pid=22 status=0 by=wait pages=16043 # echo 1 2 3 4 5 6 7 1 2 3 4 5 6 7 D19 REAP pid=23 status=0 by=wait pages=16043 # echo 1 2 3 4 5 6 7 8 shell: too many arguments # echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa D19 REAP pid=24 status=0 by=wait pages=16043 # echo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb shell: argument too long # echo x | wc shell: syntax is not supported # echo zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz shell: line too long # echo final final D19 REAP pid=25 status=0 by=wait pages=16043 # exit D19 REAP pid=14 status=0 by=pid0 pages=16049 SHELL OK prompts=20 pages=16049