Hacker News new | ask | show | jobs
by DrJokepu 5560 days ago
Really cool experiment, although a bit difficult to extend as there are only 132 bytes remaining for loading anything else from the disk, which is not much (the boot sector is normally 512 bytes long on x86).
5 comments

The demoscene notwithstanding, anybody counting bytes like this will probably be putting their OS in flash/ROM, not on a hard drive.
Actually all you would have to do would be to load the next n sectors and jump to the beginning.

Thats easily done in 132 bytes.

Correct me if I am wrong. Isn't it likely that you would create a quick bootloader in the 512 byte long boot-sector, and then load this Itsy-OS from storage (e.g. flash, ROM, etc). Ofcourse it would require the bootloader to be written...
Normally you would be right but I think since we're talking about kernel code golf here, it's only fair to consider the bootloader (if there's any) as part of the kernel.
It's even worse if you use the "standard" DOS partitioning system, only 440 bytes are available. (446 if you get fancy)
You could pack this into a kernel loaded from Grub and pack a fair amount more in.