(sorry about double posting, I forgot to put Show HN in front in the original <a href="https://news.ycombinator.com/item?id=43863689">https://news.ycombinator.com/item?id=43863689</a> thread)<p>Hey all,
As a follow up to my relatively successful series in x86 Assembly of last year[1], I started making an OS that fits in a boot sector. I am purposefully not doing chain loading or multi-stage to see how much I can squeeze out of 510bytes.<p>It comes with a file system, a shell, and a simple process management. Enough to write non-trivial guest applications, like a text editor and even some games. It's a lot of fun!<p>It comes with an SDK and you can play around with it in the browser to see what it looks like.<p>The aim is, as always, to make Assembly less scary and this time around also OS development.<p>[1]: <a href="https://news.ycombinator.com/item?id=41571971">https://news.ycombinator.com/item?id=41571971</a>
Some related stuff:<p>In 2004, Gavin Barraclough’s mini-OS [0] won the IOCCC, packing a 32-bit multitasking operating system for x86 computers, with GUI and filesystem, support for loading and executing user applications in ELF binary format, with PS/2 mouse and keyboard drivers, VESA graphics, a command shell, and an application into 3.5 KB of highly obfuscated C code.<p>In 2021, Justine Tunney wrote SectorLISP [1], a Lisp implementation that fits into a bootsector and is able to run McCarthy’s metacircular evaluator.<p>[0]: <a href="https://www.ioccc.org/2004/gavin/index.html" rel="nofollow">https://www.ioccc.org/2004/gavin/index.html</a>
[1]: <a href="https://github.com/jart/sectorlisp">https://github.com/jart/sectorlisp</a>
Two questions:<p>1. I just saw how str_print is implemented. It's so short even though it's asm. Is this why nul-terminated strings were so popular and became the default in C? Would pascal strings be much longer/uglier/harder in asm?<p>2. Why is str_print repeated in multiple files? How would you do code sharing in asm? I assume str_print is currently not "static" and you'd have to make it so via linking or something, and then be able to get its address using an asm macro or something?
Very cool!
I have to ask: what would the total size be if the package included the bios functions?<p>Also: what could be done if the size limit were 8kbyte like the mask-rom bios days?<p>Thanks for pointing me towards the bosh emulator.
I have a more general question - what is the minimum that is needed to qualify as an operating system? Is there something agreed on generally? Searching operating system minimum requirements leads to the wrong kind of info for me....
BIOS is underrated. Basically the driver portion of a DOS- (or CP/M)-like operating system. As demonstrated, you don't need to add too much to it (program loader, simple file system, maybe a command shell and system utilities if you are ambitious) to get a functional mini-DOS.
cool stuff, like you still fit quite a bit in there too, 510 bytes can be tricky.<p>if you want an ahci controller to 'see' it, it will need partition table too, which will make it even less bytes (or maybe cleverly encoded)