TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: OSle – A 510 bytes OS in x86 assembly

160 pointsby shikaan13 days ago
(sorry about double posting, I forgot to put Show HN in front in the original <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43863689">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;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&#x27;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:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41571971">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41571971</a>

9 comments

nathell13 days ago
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&#x2F;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:&#x2F;&#x2F;www.ioccc.org&#x2F;2004&#x2F;gavin&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;www.ioccc.org&#x2F;2004&#x2F;gavin&#x2F;index.html</a> [1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;jart&#x2F;sectorlisp">https:&#x2F;&#x2F;github.com&#x2F;jart&#x2F;sectorlisp</a>
90s_dev13 days ago
Two questions:<p>1. I just saw how str_print is implemented. It&#x27;s so short even though it&#x27;s asm. Is this why nul-terminated strings were so popular and became the default in C? Would pascal strings be much longer&#x2F;uglier&#x2F;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 &quot;static&quot; and you&#x27;d have to make it so via linking or something, and then be able to get its address using an asm macro or something?
评论 #43869410 未加载
评论 #43869417 未加载
mycatisblack13 days ago
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.
评论 #43867625 未加载
评论 #43868185 未加载
djaychela13 days ago
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....
评论 #43878174 未加载
musicale13 days ago
BIOS is underrated. Basically the driver portion of a DOS- (or CP&#x2F;M)-like operating system. As demonstrated, you don&#x27;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.
yjftsjthsd-h13 days ago
Well that&#x27;s cool. Does the name stand for something?
评论 #43867440 未加载
fuzzfactor13 days ago
On projects like this, where the IMG is small enough, I would think it was ideal to include osle.img with the zip.
sim7c0013 days ago
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 &#x27;see&#x27; it, it will need partition table too, which will make it even less bytes (or maybe cleverly encoded)
评论 #43867516 未加载
评论 #43867564 未加载
revskill13 days ago
All professors should be doing this decades ago right ?
评论 #43872414 未加载