Repository navigation
Releases
Releases · tc4dy/ironshell-x86
Download (v2.1.7) ironshell-x86
[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.
ironshell-x86 v2.1.6
Changelog
All notable changes to ironshell-x86 are documented in this file.
[2.1.6] - Current
This cycle focused on module integration, jump tables, disk layout correctness
and cleanup across all subsystems. The goal was to make the previously
disconnected modules actually talk to each other through a stable interface,
and to remove dead code that had accumulated from earlier prototypes.
Added
- API jump tables at the top of
filter.asm,theme.asmandsandbox.asm.
Each entry is a fixed-size near JMP, so stage2 can call any exported function
by a stable offset without recomputing positions every time a module grows. theme_copy_colorsAPI intheme.asm— copies all 10 color slots in one call.filter_api_matchbinding sostage2's log filter actually queries the
filter module's ownactive_filterstate instead of keeping a shadow copy.theme_api_setbinding socmd_set_themenow applies themes through the
theme module and immediately redraws the full screen with the new palette.sandbox_api_entryandsandbox_api_post_execbindings sosandbox_pre
andsandbox_postroute through the sandbox jump table.- Sender-side
push ds / pop esfix inpayload_memmapso E820 queries write
into the stage2 buffer instead of the IVT neighborhood. CHANGELOG.md(this file) so README stays focused on the current version.
Changed
- All exported module functions in
filter.asm,theme.asmandsandbox.asm
now return withretfbecause stage2 calls them viacall far [ptr].
Internal helpers remain nearret. sandbox_postnow resolvessandbox_post_execatSANDBOX_ENTRY + 3
instead of the fragile hardcoded0x902E.stage1.asmreads 4 sectors (2048 bytes) for the loader instead of 2,
giving the loader room to grow without a silent partial load.cmd_set_filterwrites into the filter module directly, so the filter
engine and the shell share one source of truth for the active filter.payload_msgboxshellcode bytes were reordered to produce a valid
mov ax, imm; retstub at 0xA000 instead of an accidental memory write.- README rewritten to match actual code behavior across every subsystem,
including corrected sector counts, load addresses and sandbox wording.
Removed
- Dead
theme_apply_colorinline color blocks (.color,.mono,.hacker,
.retro,.stealth,.done) that were orphaned after the theme engine
moved to a standalone module at 0xB000. - The hardcoded
SANDBOX_POST equ 0x902Econstant — replaced by an offset
fromSANDBOX_ENTRYthrough the sandbox jump table. - Stage2's shadow
active_filterandactive_theme_idvariables. Both
subsystems now keep their own state inside their own module segment. - The runtime shellcode disk load in
loader.asm. Payloads write their own
stub into 0xA000 at execution time, so there was nothing to load. - Redundant
clc / jcguard incmd_run_payload— replaced with a real
call sandbox_pre, which is now reachable and functional.
Fixed
theme_apply_colornow saves and restoresDSandESaround the far
calls into the theme module, so it can be called safely from any context.cmd_set_filterno longer diverges from the filter module's state.sandbox_postno longer risks jumping to the wrong offset when the
sandbox module's internal layout shifts.sandbox_entrynow returns withretf 4, matching the far call from
sandbox_preand correctly cleaning up its two stack arguments.filter_matchandfilter_get_namenow preserveBXacross calls.filter_get_nameclearsDXbeforemulfor cleanliness.- Loader LBA values in
Makefilefor theme and filter now match what
loader.asmactually reads (87 and 89, not 83 and 85). Makefile disasmtarget now uses the correct stage2 origin (0x8000)
and includes theme and filter binaries.Makefile helpmemory layout text now reflects the real module placement.
Notes
- The sandbox pre-scans and post-audits every payload, but the payload body
itself still executes outside the sandbox envelope. Tightening that
boundary is scheduled for a later cycle. - The loader/stage2 memory window is tight. If the loader grows past 2048
bytes, both the stage1 read count andLOADER_MAX_BYTESneed to change
together, and the stage2 origin may need to move.
[1.0] - Initial release
- Two-stage bootloader.
- Seven payloads.
- Basic sandbox with four policy levels.
ironshell-x86 v2.1.5
v2.1.5 — current
- Added
theme.asmmodule (0xB000): 5 color themes, live screen redraw - Added
filter.asmmodule (0xC000): 6 log filter modes, render-time filtering - Added
MEMMAPpayload (E820 memory map via INT 15h with INT 12h fallback) - Sandbox: IVT auto-restore, STI/HLT detection, CPUID guard, policy scoring
- New commands:
theme,themes,filter,filters,errors - Payload arguments:
sel <n> <arg>passes runtime args to PORTPROBE, STACKSMASH, IVTDUMP - Error tracking: typed error codes with
errorscommand - Log scroll: PgUp/PgDn navigation in the log panel
Fixes:
- Fixed: sandbox bypass in
exec_payload— all payloads now route throughsandbox_entry - Fixed:
payload_memwalkstack corruption (double BX increment) - Fixed:
sb_pre_execpolicy logic (jge→ correct allow/block ordering) - Fixed:
hist_prevscasb using wrong DI after movsb - Fixed:
format_payload_lineinvalid NASM multi-operandmov - Fixed: E820 entry stride inconsistency (20 vs 24 bytes)
- Fixed: stage2/sandbox memory overlap (stage2 padded to 32768, sandbox at 0x9000 — gap enforced by layout)
- Fixed:
strcpy_bounded_namedouble null write - Fixed:
vga_draw_bannerbox-drawing character sequence - Fixed: loader sector layout and disk addressing
- Fixed: ES segment corruption in
init_payloads,theme_init_defaults,ui_full_redraw,ui_draw_frame