5 ms·
You're right, it started as an attempt to fit into 512 bytes but right now it's 4 sectors (2KB). Of course, on a modern hard drive with 4KB sectors, we might st
by cfallin 6y ago
You're right, it started as an attempt to fit into 512 bytes but right now it's 4 sectors (2KB). Of course, on a modern hard drive with 4KB sectors, we might stretch our definitions a bit :-) (Though the BIOS still only loads 512 bytes in such a case)
- cfallin 6y ago... and now there's a true 512-byte version as well (removing the text and shifting some of the variables to other memory did it) -- `make floppy_1sector.img`. Anyway, thanks for the prompt/challenge!
- tpmx 6y ago:-) Nice!
- tpmx 6y agoI got some serious deja vu reading that source code by the way. 24 years ago, as my senior year project I decided I would try to build a DOS-like OS that could boot from a floppy. I didn't get very far beyond a rudimentary CLI, some fun builtin commands and the beginnings of a FAT-like file system... "hey, I made something that could boot from a 1981 PC, from scratch, and I understood it all the way.". That's a pretty nice feeling - I think you probably felt the same way?
- cfallin 6y agoYup, PC hardware is actually not too bad as a bare-metal platform, and everyone should try writing an OS once! Sounds like a fun senior project.