Repository navigation
[2.1.7] - current
this release was mostly about fixing structural issues and hardening the sandbox environment. the old code was getting too big in single files and memory blocks were overlapping. we split everything up to enforce strict boundaries between subsystems.
added
- refactored the source code into dedicated directories: boot/, config/, core/, lib/, and ui/. this replaces the old flat layout and makes isolated testing much easier.
- created config/memory.asm, config/errors.asm, and config/policies.asm to centralize memory addresses and error codes. this eliminates scattered hardcoded values across the codebase.
- implemented a serial debug module in lib/serial.asm. it allows printf-style debugging via com1 using qemu's -serial stdio flag, which is helpful for tracing execution without attaching gdb.
- added lba extended read support for disk operations inside lib/disk.asm.
- rewrote the stage1.asm boot sector to use lba (ah=42h) instead of the legacy chs method. it now includes a 3-attempt retry loop and resets the disk controller on failure.
changed
- relocated stage2.asm from 0x8000 to 0x10000 (segment 0x1000). the previous address was overlapping directly with the sandbox (0x9000), theme (0xb000), and filter (0xc000) modules, causing data corruption.
- hardened the sandbox significantly. the ivt snapshot and restore routines now wrap write operations in cli and sti. this prevents a hardware interrupt from crashing the system mid-rewrite.
- increased the opcode scan depth from 128 to 512 bytes. strict hard-blocks were also added for hlt, wrmsr, rdmsr, and lgdt regardless of the active policy.
- the register integrity check now verifies es and sp post-execution, in addition to ds and ss.
- theme.asm, filter.asm, and sandbox.asm now expose their functions through stable jmp near api tables. cross-segment calls use call far and retf, which is cleaner than hardcoding specific offsets.
- updated the makefile to validate binary sizes. for instance, stage1.bin must be exactly 512 bytes, or the build will abort. it also prints the sector counts for every generated module.
- cleaned up autosetup.sh to locate the root makefile directly, removing the recursive find scans.
removed
- removed the monolithic stage2.asm file. the tui logic now resides in ui/, and the payload logic is in core/.
- removed hardcoded offset calls such as theme_base + 42. all module communication now goes through the api jump tables.
- cleaned up dead code, orphaned color blocks, and obsolete shadow variables left over from previous iterations.
fixed
- fixed a critical race condition in the ivt auto-restore routine. previously, a hardware interrupt firing during the table rewrite could lock up the system.
- fixed stack corruption in payload_memwalk caused by an unbalanced bx increment.
- fixed the command history bug in ui/input.asm. the di pointer was miscalculated after a scasb operation, corrupting strings when scrolling up or down.
- fixed stage1.asm drive number handling by saving dl to a dedicated memory location before any bios call could clobber it.
notes
- the payload body still executes outside the sandbox envelope. the sandbox pre-scans and post-audits, but it does not provide hardware-level isolation (such as vt-x or strict segment limits). this remains out of scope for the mvp.
- stage2 is padded to 32768 bytes. any additions to core/stage2.asm must be monitored via the makefile size output to prevent overlapping into the sandbox segment at 0x9000.