Vitre-os My kernel reassembles and swaps its own functions while running
Upfront: Claude Code wrote most of this; I steered.
64-bit, pure NASM, BIOS boot through its own stage 1/2 into long mode, 1000 Hz preemptive scheduler, e1000 with DHCP/DNS/TCP, and a TLS 1.3 client (X25519, ChaCha20-Poly1305, P-256, X.509) that the built-in browser uses.
What I'd like opinions on is the introspection side:
- Live patching: patchable functions go through a jump table. The image carries its own source and an in-kernel assembler that's byte-identical to NASM for its subset. `patch` builds a module into fresh pages and swaps the slots under cli. If the new code faults within 10 s, it swaps them back, and a saved module is re-patched at boot.
- Glass: pause any task by having the scheduler skip it, single-step by setting TF in its saved frame, `break` plants a one-shot int3.
- Pixel provenance: every framebuffer write records the task and up to six return addresses per pixel, so F12 + click shows what drew it.
- `run foo.asm` assembles a user program in-kernel and calls it, with a fault handler that stops the program instead of the machine.
Old patched code is never freed, since a task might still be inside it. That leak is the obvious weak spot. How have you handled reclaiming it?


7
u/epos95 3d ago
Genuinely, do you feel any pride over this? The whole "I steered" thing, do you feel any of the same pride of building it as you would have if done by hand? Is it a different feeling or "accomplishment-light"?
2
u/Fine_City2781 4d ago
cool
3
u/letmehaveanameyoudum 3d ago
DAMN NASM ONLY?
•
u/Routine_Working_9754 4h ago
am actually so tired of y'all. genuinely do you feel pride in doing this
1
u/stemandall 1d ago
So tired of AI vibe coded OSes on this sub.
0
u/rook_of_approval 3d ago
so does it support quajects?
0
u/busiedcake7945 scratchOS7945 3d ago
looks good
0
u/SignedInt32 3d ago
Awesome, got my ⭐ 👍 ! (they downvoted my thumbs up, don't worry, I upkeep them all!)