88 comments

[ 2.6 ms ] story [ 163 ms ] thread
Kudos to the creator! Fitting a bootable Linux on a single floppy was already doable some 20 years ago, my firewall back then was in fact floppyfw (0) running on a 486 board, but in the meantime the kernel grew a lot, despite being much more modular than old ones. Userland utilities and libraries also grew in size, so the accomplishment is not trivial. Thumbs up!

0: https://www.zelow.no/floppyfw/

I saw this and said “eh, been done” - but that it’s the latest kernel and busybox is surprising.

This could be useful for other embedded systems - as 2MB of storage could be fit into ROM pretty easily.

Yeah, I just wanted to learn Linux. It worked as I learned a lot doing this project :)
(comment deleted)
That's awesome. I recently ran [ELKS](https://github.com/jbruchon/elks) (Embedded Linux Kernel Subset) on a Toshiba T1200 laptop from 1987 with an 8086 processor. Booting into a unix-like system from a floppy with recently developed software is just surreal.
I remember running QNX from a single floppy in the 90's.

http://toastytech.com/guis/qnxdemo.html

This blow my mind back then.It is still super impressive.
They released their source code for a while... is that still available anywhere?
Yep, and depends on available RAM, there was option to install some additional app from network.
little known fact, Alpine linux was originally designed to run from floppy
The very first version of Linux was bootable from a floppy and required 4 x 1.44" FDs to install.
1.44 mb, on a 3.5" floppy disk ◔_◔
Nice write-up.

Back in the day, there was also LOAF (Linux On A Floppy). [1]

I had a go at it, until I realized someone beat me to the name.

[1] https://linux-center.org/en/distributions/mini-distributions... (Only the index still remains)

There is also Floppix, and their FAQ lists a few more [1]

[1] https://www.floppix.com/faq.html

Ah yes, tomsrtbt. I completely forgot about it. It even looks it's still going. Used to have that as a grub boot target, and it has saved my cheese more than once ..
I downloaded LOAF and tried it on a 386 circa '98, not really knowing what Linux was. Sadly it didn't boot for some reason because I could have started my enlightenment about four years earlier. Instead I spent the late years of my adolescence struggling to make "terminal" apps with Microsoft compilers. GCC would have been really nice.
This one doesn't includes GNU, but it is required for building it. I like the idea that knowing GNU/Linux like this allows for some makeshift tools to salvage or recover from situations that would be lost without it.

Needs a server or router and all you have is an old computer with some NIC's? All you have is a pendrive and needs to recover some files from an unbootable machine? Do not have msword but can use gzip and grep and wants to extract text or images from a docx? Got an old computer without harddisk but working floppy drive and needs linux running on it? Need to send an SOS AM signal and all you have in an old CRT? A modern linux distro with a few dev packages and system tools is like a digital swiss army knife on these situations.

Some of these scenarios are stretching the reality, but some are not. These skills are the modern IT equivalent to MacGyverisms.

I built a linux on a floppy about 20 years ago, with a number of ethernet drivers built in (the common ones of the day, some 3com, tulip and a few others), X11 (tinyx with vesa fb, so close to universal support then, just not accelerated) with vnc and rdesktop. i.e. a thin client on a floppy.

it was a demonstration on how one dynamically compile (for smallest binaries), but then "reassemble" libc to only include the symbols needed for the actual applications. I demonstrated doing this with uclibc which didnt need the help as much as well as glibc (which if my memory serves me correct was basically close to the size of the floppy by itself). if all the binaries were statically linked, they would have been too big (because of duplication of symbols between them), but by essentially stripping libc of unneeded symbols, was able to create an embedded system that worked perfectly.

It might be a bit harder today for the same reason its hard to actually statically link glibc today. glibc at runtime can do dynamic loading itself, even if statically linked into the binary.

> if all the binaries were statically linked, they would have been too big (because of duplication of symbols between them)

Apropos of this, another solution I've seen (more of a dirty trick, but also greater space savings) is to build libc as a fixed chunk of page-aligned memory, and then de-duplicate the underlying disk sectors between different executable files. Works pretty well, assuming a read-only or cooperative filesystem.

I did the similar thing at uni, there was an arts lab with a bunch of dos only pcs that were never used, my boot disk had minimal Linux and X to start a remote session to the beefy alpha servers.
Funny how the website for this is over 4MiB.
Funny, but does give deep meaning too the saying "A picture is worth a thousand words"; Or in this case - Three Operating Systems.
And doesn't work without javascript.
Ahhh, brings back memories of the LRP back in the day.
As a sysadmin in the 90's it was considered malpractice to not have a copy of tomsrtbt[1] available at all times. The idea was, in a pinch, if you brick your internet gateway you'd have a chance of recovery by booting from tomsrtbt. It had just enough tools crammed onto the disk to fix configurations, fsck a disk, and rewrite the bootloader.

[1] http://www.toms.net/rb/

Only one of five mirrors works, but then I discovered that the last version is from 2002, so I guess it's surprising that Ibiblio still holds out.

I vaguely remember the name—however from some time recovery tools changed to mini-CD for me, which is not too large either with ~170 mb or something like that. I gotta find the name of whatever recovery-CD build I had, since it's got memtest86+, which can still come in handy…

Hiren's? It's got a pretty ancient version of Memtest86+ on it these days FWIW. Then again for some hardware I touch the newer memtests and Darik's don't boot.
I used to use tomsrtbt as a daily driver in an old 486 that I removed all the moving parts from. A totally silent machine, after reading the OS into memory from the floppy.
There was a cottage industry of interesting floppy distributions back in the day. I remember Hal91 (mostly for the ascii art and the creator's email at an online.no domain - funny for a young student who hadn't internalised the meaning of ccTLDs) and muLinux (which used superformatted floppies to cram an amazing amount of stuff into those few megabytes).
Does Linux still fit on a floppy? Last few times I tried I couldn't get the kernel below 1.7mb (without throwing out stuff like block devices.)
OpenWRT needs to compile and run on devices with only 4MB of flash storage, and they have a guide for slimming down the kernel here: https://openwrt.org/docs/guide-user/additional-software/savi...

I would be surprised if the resulting kernel is any bigger than a floppy disk.

The latest version of OpenWRT is now 8MB

"Due to new features being introduced and the general size increase of the Linux kernel, devices now need at least 8 MB of flash and 64 MB of RAM to run a default build of OpenWrt."

That's the default build though. Looks like with some adjustments it still goes smaller.
I run OpenWRT on a device with 4MB of flash storage, and I update it regularly. The guide I posted from OpenWRT goes into specifics about targeting platforms with limited storage.
I can't believe I see a link to my work on HN! :)
Nice work! I miss the sounds computers used to make back in the day! BTW what issues were you having with writing the image data to the floppy? Did dd not work for you?
I should see floppy drive as /dev/fd0. Just now as I double check everything I found out that external drives (USB) are shown as /dev/sd*. sdb in my computer.

I updated the post with that info.

Thanks!

This reminded me of DSL [0]. I used to use it as my router 15 years ago.

The box was loud while booting (because of the floppy), but once booted was completely silent as everything ran from RAM. The Pentium CPU had just a heatsink with no fan, and no fan on the power supply.

[0] http://www.damnsmalllinux.org/

Its not linux, but I remember also this OS working on a floppy. And still maintained: http://menuetos.net/
What's impressive about this is that it's entirely written in assembly, and has a full GUI and network support that fits on a single floppy.
I remember putting in a single floppy of QNX. That was awesome.
Can someone define the term "embedded" in this context? I had always assumed that "embedded" meant that the OS was written onto non-removable read-only storage. But I'm realizing that I don't actually know what the definition is.
Embedded is any low resource, cost-efficient computer system designed with a specific class of tasks in mind, as opposed to general computing devices like mobile phones (which aren't embedded) or PCs or servers. On the other hand, mobile phones actually contain one or more embedded systems as their components. See, pinephone gsm modem documentation for example.
It is read only and will run one particular application in a kind of KIOSK mode. I'm using floppy just for fun.
I'm disappointed there are no links to binaries/disk images to download. Building it all is overkill for the average reader to just try it out and see if it's at all useful.
I was thinking of publishing those. Not a problem. I will update the post in a moment.

EDiT: done :)

Following your instructions doesn't seem to work.. when I try to launch it with qemu, I get a kernel panic:

Starting init: /sbin/init exists but couldn't execute it (error -8)

it then tries to run /bin/sh as a backup, with the same error.

I followed your instructions exactly; I also verified these are all marked executable. Any idea?

I got similar problems when I missmach 32bit and 64bit code. First try to run in qemu 64 bit system.

I ended up building the whole system on a 32bit old laptop and just don't care about the problems with installing missing 32bit libs on my 64bit system.

(comment deleted)
I seem to remember a distro for turning an old PC into a router called "Coyote Linux". It fit on a 1.44mb 3.5" floppy. There was another too that I'm not remembering currently. I find it amazing what can be done with simple computers and advanced software.
I used that as a kid, in place of Microsoft's internet connection sharing software that my dad had set up. I vaguely recall it worked better for multiplayer games.

Any layer 3 router is basically just a computer and software. Some of the more mechanical tasks can be accelerated in hardware, but that's only important with really high throughout setups. It is pretty impressive how much data you can shovel through a modest CPU, though. Part of that is the fact that CPUs process many bits in parallel. You could imagine a 20 year old CPU running at 100Mhz shovelling 50 million words per second between memory locations, which at 32-bits is 1.6Gbps.

I wouldn't overstate the software routing performance too much. That 100MHz cpu would probably struggle to route even 100Mbps, especially with conntrack or/and small packet sizes.

Also, in hardware routers packets are routed on dedicated custom silicon without them hitting the relatively slow general purpose CPU.

I was describing raw data shovelling throughput. Of course there's going to be per-packet overhead. 100Mbps internet connections were quite rare 20 years ago, so the point still stands that for a layman / average home LAN, general purpose CPUs can shovel an impressive amount of network traffic.

Sure, you'll likely need purpose-made hardware above a certain amount of throughput. I suspect that practical threshold these days is between 1Gps and 10Gbps, although it's a much grayer line than it was 20 years ago. The network interfaces are likely the bottleneck rather than the CPU's ability to shovel, and latency will always be higher than dedicated hardware.

There will of course always be a need for hardware to go faster than what a CPU can do. Tbps is becoming a unit folk use regularly.

iirc one of the first distros i tried to install was Coyote Linux, which also was a "floppy-distro" (it definitely was a thing).

the reasoning was that I had an already old for the time 486dx and the floppydistro was the logical choice.

of course starting using gnu/linux using a small floppydistro with no graphical tool and little help was a dumb idea lol.