Repository navigation
BooleOS 0.17.0 - Phase 17: Cleanup A (audit fixes, libnos/shell tools, test/build infrastructure)
BooleOS 0.17.0 - Phase 17: Cleanup A (audit fixes, libnos/shell tools, test/build infrastructure)
All you need to run it is QEMU; the exact command is in the README.txt inside the ISO package.
booleos-0.17.0-iso-img(originally-nullos).zip: the bootable ISO built from this tag (the image itself still says NullOS, because the project was renamed after this version), the blank disk image when this version has one, and aREADME.txtwith the QEMU command and what this ISO doesbooleos-0.17.0-docs-original.zip: the docs of this version, exactly as they were
Changes
Added
ROADMAP.md: granular phase table — one row per phase and
sub-phase for completed Phases 0–16 (names taken from the README's
completed-phases table, links to CHANGELOG versions anddocs/
files) and for planned Phases 17–31 including their sub-phases.docs/TODO.md: header-only file for minimal "WIP: document X"
stubs left duringnightlydevelopment, resolved at each version's
final polish (per the new CLAUDE.md documentation rule).user/lib/nullos.c/h,user/shell.c,forktest.c,selftest.c,
edit.c: libnos gainedmemcpy/memset/memmove/memcmp/strlen/
strcmp/strncmp(standard libc names and signatures, so a call GCC
emits by itself resolves) andnos_uitoa; the four per-program copies
ofstrlen/uitoa, shell'sstrcmp/strncmp, selftest'sst_bufeq
and the inline zero/shift/copy loops in selftest and edit now call them.user/selftest.c: new test "SYS_WRITE >128 bytes accumulates in a FAT16
file" — writes 2100 bytes as twonos_write()calls (crossing the first
2048-byte cluster) and reads them all back; the regression test for the
chunked-write data loss. Suite is now 14 tests (st_big.txtis left on
disk like the other test files).pwd/SYS_GETCWD(30):fat16_get_path()rebuilds a cwd path from the
cwd's cluster by walking up through..(names in 8.3 uppercase).
nos_getcwd(), shellpwd.cat <file>:user/cat.copens the file named by its argument and prints
it; with no argument it still copies stdin (pipe sink). The shell'scat <file>launches it and waits.sys_exec_pipe()clears the global
exec_argso a piped/redirectedcatnever reads the argument left by an
earlier plainexec().cmd < fileandcmd > filein the shell (run_redirected()): file fds
through the existingSYS_EXEC_PIPE;>creates + truncates. External
programs only, launched by name without arguments, not combinable with|.kernel/power.c/h:power_reboot()(8042 reset, port 0x64 <- 0xFE) and
power_shutdown()(PIIX4 PM base from PCI config 0x40,outw(base+4, 0x2000); prints "shutdown not supported on this hardware" when the PIIX4
isn't in the PCI table).pci_find_device(). SyscallsSYS_REBOOT(31) and
SYS_SHUTDOWN(32),nos_reboot()/nos_shutdown(), shellreboot/
shutdown.user/selftest.c: four new tests (18 total): a two-process pipeline
(afork()ed writer andcatlaunched withSYS_EXEC_PIPE, parent
compares the output),waitpidwith three children (each pid collected
with the result that child reported, and gone afterwards),mkdir/cd
three levels deep (pwd at every level, a file at the bottom,cd ..back
to/), and a check for the Intel 440FX host bridge (8086:1237) next to
the generic PCI count. The 440FX test is expected to fail once Phase 24
moves QEMU to-machine q35(seedocs/TODO.md).SYS_PCI_FIND(33) /nos_pci_find(vendor, device): 1 if a device with
that ID is in the PCI table, 0 if not (pci_find_device()for userland).tools/Makefile:make inject FILE=... [NAME=...]copies a file into the
root ofbuild/disk.imgwithmcopy, without rebuilding the ISO.
Host-side only — the kernel still can'texec()from FAT16 (Phase 19).tools/Makefile:make run-reboot-testruns QEMU without-no-reboot, so
rebootreally restarts the guest.runanddebugkeep-no-rebooton
purpose (post-mortem state on a triple fault; it also turns a guest reset
into a shutdown).
Changed
kernel/version.h:NULLOS_VERSION"0.17.0",NULLOS_PHASE"17",
NULLOS_PHASE_DESC"Cleanup A".user/shell.c:runhas a single implementation,cmd_run(), shared by
the foreground path andrun_command(); it trims and validates the name.ROADMAP.md: replaced the Phases 17–22 plan with the restructured
Phases 17–31 sequence (Cleanup A, HAL + Safe Mode, SDK, COW fork,
unlink/rmdir,process_exit()memory release,e1000, AHCI,
xHCI, framebuffer/GUI, syscall deprecation, audit pass 2, polish,
DOOM prerequisites, DOOM port / v1.0.0). Old Phases 17–22 renumbered
to 20, 23, 24, 25, 26, 27, with a granular one-row-per-phase/sub-phase
table (historical lettered phases as parent + child rows). No
package-manager phase, by decision.README.md: "Completed phases" table shows only whole phases (the old
rows 2/2b and 3a/3b merged into one row each); the "planned phases" range
is 17–31.CLAUDE.md: new sections/rules for thenightly/mainbranch strategy,
-nightlyversion suffix, sub-phases, HAL, centralizedmsg()text
output, key=value system config file, and Safe Mode; serial-mirroring,
exec()/fork() threading and docs-verification rules extended; Safe Mode
rules nameprocess_spawn_user.PROGRESS.md: consolidated from 411 to ~150 lines (closed phases one
line each, decisions tightened with links todocs/).docs/:memory.md,filesystem.md,scheduler.md,pci.md,
kernel.md,shell.md,pipes.md,testing.md,syscalls.mdupdated
for everything above;docs/scheduler.mdno longer describes the removed
process_spawn().
Fixed
-
kernel/memory/pmm.c:pmm_init()computed the page count as
(1024 + mem_upper) * 1024 / PAGE_SIZE, which overflowsuint32_t
for a hugemem_upperand wraps to a tinytotal_pages, underflowing
total_pages - 256. Now256 + mem_upper / 4(same value, no
overflow), and freeing high memory is skipped with a warning when
total_pages <= 256. -
kernel/fs/fat16.c:fat16_init()now rejects a BPB with
sectors_per_cluster == 0(printing the reason) before it is used as
a divisor, instead of dividing by zero. -
kernel/process.c:next_pid++(three places) now goes through
alloc_pid(), which saves/restores EFLAGS around the increment
instead of a bare cli/sti, sinceprocess_fork()calls it from
inside its own cli section. -
kernel/drivers/pci.c/pci.h: only the BARs a header type really
has are read and printed (type 0: 6, type 1 PCI-PCI bridge: 2,
type 2 CardBus: 1), with the multi-function bit (0x80) masked off
first; the rest ofbar[]stays 0. -
kernel/memory/vmm.c/vmm.h:vmm_map_page()and
vmm_map_user_page()now returnint(0 = success,VMM_ERR_RANGE
/VMM_ERR_NOMEMon failure) instead of failing silently asvoid;
map_page_early()reports an exhausted page-table pool.
vmm_map_user_page()also rejectsvirt < 0x800000(the kernel's
shared identity map) and frees a page-table page it can't use.
Every call site checks the result:heap_expand()frees the page and
returns 0;exec()'s user-stack loop prints an error and returns 0;
elf_load()returns -1;process_fork()unwinds via its existing
failedpath. The threevmm_map_user_pagesites also free the
just-allocated physical page instead of leaking it. -
kernel/keyboard.c,user/edit.c: Shift in the editor.
The raw scancode path (SYS_READ_RAW) now carries a Shift bit
(bit 9, next to Ctrl's bit 8), because the kernel consumes the Shift
make/break scancodes itself andedit.ccould never see them; the
editor selects a newsc_map_shift[]table from it, so Shift+5 gives
%, Shift+\ gives|and Shift+letter gives the capital. -
kernel/fs/fat16.c:fat16_write_file()again refuses
a directory entry (ATTR_DIRECTORY) — the Phase 15 switch to the
shareddir_lookup()had dropped the old loop's directory skip — and
no longer re-reads the dirent sectordir_lookup()just left in
dir_buf. (The "duplicated dirent lookup" tech-debt item was already
resolved by Phase 15; only these two leftovers remained.) -
kernel/process.c,kernel/scheduler.c/h,kernel/process.h
:process_spawn_user()now reserves its slot atomically
(interrupts off via saved EFLAGS, slot markedPROCESS_BLOCKED, pid
andwaiting_for_pidreset in the same section), fills in every
field, and only then publishesPROCESS_READY(or leaves it
PROCESS_BLOCKEDforstart_blocked). This closes two races: two
spawns picking the same free slot, and the scheduler running a slot
whoseesp/cr3weren't built yet. Newirq_save()/irq_restore()
helpers, also used byalloc_pid(). -
kernel/fs/fat16.c,fat16.h,vfs.c,vfs.h,kernel/syscall.c:
SYS_WRITEon a FAT16 fd lost data.sys_write()staged writes in
128-byte chunks and eachvfs_write()replaced the WHOLE file, so only
the last chunk survived a write over 128 bytes. Newfat16_write_at()
(positional write: grows the chain, updates the dirent, data -> FAT ->
dirent order) backs a streamvfs_write()that writes atfd->posand
advances it; the whole-file replaceSYS_WRITE_FILEneeds moved to
vfs_write_all(), so the editor's save is unchanged. -
user/shell.c: a bareeditorcat(no argument) printedcommand not found.nos_read()returns the line with its trailing newline, and the
branches only match "name followed by a space or end of string". The
shell now strips the trailing\n/\rright after reading the line. -
Line editing echo (pre-existing): erasing a typed character did not
erase it on the serial console.vga_putchar('\b')blanks the cell on
screen, but its serial mirror sent a raw\b, which only moves a
terminal's cursor left — retypingshutdownasrebootshowed
rebootdows.kernel/drivers/vga.cnow mirrors an erasing backspace as
\b \b(nothing if VGA erased nothing). Alsosys_read()no longer
echoes a backspace on an empty line, which used to blank the shell's own
>prompt. The typed buffer itself was always right (a backspace just
decrements the count).
Removed
tools/run_qemu.sh: it booted the ISO without attachingdisk.imgand had
no users besides one hint intools/setup_env.sh(now points atmake run); its mentions indocs/setup.mdanddocs/filesystem.mdare gone.process_spawn(),scheduler_spawn()and the now-unused
scheduler_task_bootstrap(): dead code (no callers anywhere, no
future roadmap phase depends on them).
Full history: CHANGELOG.md