16 ms·
Booting a 486 from floppy with the most up-to-date stable Linux kernel
- josteink 6y agoPosts like this showcase how malleable Linux really is without getting overly complicated to follow. Really a nice quick read.
- ianlevesque 6y agoYeah slightly tangential but I wonder if some of the alternative OSes (looking at you Haiku) could just use Linux as the kernel for portability.
- boogies 6y agoThat would be great if people could admit that the kernel isn't the operating system.
- yjftsjthsd-h 6y agoOf course the kernel isn't the OS, but it's a big chunk of it, and defines building blocks (and constraints) that the upper layers use.
- zozbot234 6y agoBut not nearly as malleable as it could be. Hopefully, true 80386 support can be reintroduced to the kernel in a way that keeps it properly self-contained and easy to support. There are also a few kernel-tinification approaches floating around that could make the kernel smaller and easy to fit in a floppy-using scenario.
- djxfade 6y agoBut why? What "real" hardware would actually have any use for it today? I understand that it might be fun, but I don't see the practical use case for it.
- nemetroid 6y agoThe 737 Max? It uses an 80286, so it’s even older. I'm also curious what use it would have. I imagine in cases where you're tied to such old hardware, you would also be tied to old software.
- skissane 6y ago> The 737 Max? It uses an 80286, so it’s even older. If we are talking about the computer that runs MCAS, my understanding is that it isn't a 286, it is a Rockwell Collins FCC-730 (aka EDFCS-730). The FCC-730 is a proprietary custom CPU architecture, there is limited public info available on it, although I did read somewhere that it uses a stack machine architecture (like Burroughs mainframes, classic HP 3000, Tandem T-16, various "Forth on a chip" processors, etc)
- nemetroid 6y agoTo be pedantic, FCC-730 is the name of the Flight Control Computer itself. Its CPU may or may not be a 286. It has however been speculated that it is, as discussed here: https://news.ycombinator.com/item?id=20380523 https://news.ycombinator.com/item?id=20380523.
- skissane 6y agoI agree, the FCC-730/EDFCS-730 is not the name of the CPU, it is the name of the computer. According to the diagrams in US patent 7,852,235 [1], the FCC-730 CPU is an FCP-2002. I would caution against the possibly mistaken inference that this patent describes the actual architecture of the 737-MAX or any other actual flight computer, as opposed to simply a design that Rockwell-Collins may have developed and not (yet) actually deployed. In particular, while the 737-MAX does have an FCC-730, I don't think it has an IPS-5000. A NASA Langley presentation [2] mentions formal verification of the FCP-2002. I think that if it is formally verified, it is probably not a 286. A 286 would be a poor choice for a formally verified microprocessor for embedded applications since it has a huge number of extraneous features that would complicate the verification process while yielding no benefit for the embedded application. The presentation also mentions a new "FCS 5000" product line, and its formal verification, and I wonder if that has any connection with the IPS-5000 CPU card mentioned in the patent diagram? Probably, the patent describes a new flight control computer design, meant as a successor to the design used in the 737-MAX (and other Boeing aircraft such as the 777). The Boeing 777 autopilot uses FCP 2002 CPUs as well [3] I swear I read somewhere that the FCP 2002 had a stack machine architecture, but now I can't find where I read that. (Did I imagine reading it?) I'm not sure where this "286" stuff comes from. I think maybe, FCP-2002 is a 16-bit CPU, and then people say a 16-bit CPU is "like a 286", and then maybe that gets corrupted in the retelling, and "like a 286" turns into "a 286"? [1] https://patents.google.com/patent/US7852235B1 https://patents.google.com/patent/US7852235B1 [2] https://shemesh.larc.nasa.gov/NFM2018/talks/Butler.pdf https://shemesh.larc.nasa.gov/NFM2018/talks/Butler.pdf [3] https://web.archive.org/web/20100822151603/http://www.rockwellcollins.com/ecat/AT/AFDS-770.html https://web.archive.org/web/20100822151603/http://www.rockwe...
- JoshTriplett 6y ago> Hopefully, true 80386 support can be reintroduced To the best of my knowledge, nobody is making new 386-only chips (that have no 486 or 586 support). As long as that remains the case, hopefully that support stays removed. > There are also a few kernel-tinification approaches floating around that could make the kernel smaller and easy to fit in a floppy-using scenario. We could always use more people looking at the size regressions, and working on making more kernel components optional. If anyone is interested in working on this, send me email and I'd be happy to get you connected with it.
- jfkebwjsbx 6y agoNo, it will not be reintroduced. There is no use for it. That belongs in a fork.
- cesarb 6y ago> Hopefully, true 80386 support can be reintroduced to the kernel in a way that keeps it properly self-contained and easy to support. The merge which removed the 80386 support (https://git.kernel.org/torvalds/c/743aa456c1834f76982af44e8b71d1a0b2a82e21 https://git.kernel.org/torvalds/c/743aa456c1834f76982af44e8b...) stated as the reason "[...] complexity has plagued us with extra work whenever we wanted to change SMP primitives, for years." That is, it was not easy to keep it self-contained. Every new SMP primitive has to be implemented and maintained for all the architectures supported by the kernel, and the original 80386 ISA was too limited. Not to mention that the 80386 didn't honor the write-protect bit in the page tables while in the kernel (https://git.kernel.org/torvalds/c/a5c2a893dbd4956a72fb261e8790d19f67b52c99 https://git.kernel.org/torvalds/c/a5c2a893dbd4956a72fb261e87...), with consequences all over the kernel (https://git.kernel.org/torvalds/c/96d4f267e40f9509e8a66e2b39e8b95655617693 https://git.kernel.org/torvalds/c/96d4f267e40f9509e8a66e2b39...).
- zozbot234 6y agoWere 80386 SMP systems really all that common to begin with? Perhaps 80386 support should just focus on the uniprocessor case, at least as a start.
- dredmorbius 6y agoThere's Alan Cox's Fuzix which runs on 68000, Z80, and 8080 CPUs, among others. http://www.fuzix.org http://www.fuzix.org
- Koshkin 6y agoThere are perfectly good older versions of Linux that will support i386 forever. (Not to mention FreeDOS.)
- dylan604 6y agowent to youtube to find a better video of the sound of the floppy drive, as the one in the posted video is very quiet. instead, came across this: https://www.youtube.com/watch?v=c52JQHVVqFM https://www.youtube.com/watch?v=c52JQHVVqFM
- Fabricio20 6y agoHave you ever heard of the floppotron? https://www.youtube.com/c/PawełZadrożniak/featured https://www.youtube.com/c/PawełZadrożniak/featured
- dsimms 6y agoor https://www.youtube.com/watch?v=LdgzsF_O7oI&t=47 https://www.youtube.com/watch?v=LdgzsF_O7oI&t=47 ?
- boogies 6y agoAt this point "music on machines" is a whole tiny world on YouTube. https://www.youtube.com/channel/UCDwMh0pu1iSXeKx7qmqjIQA/playlists https://www.youtube.com/channel/UCDwMh0pu1iSXeKx7qmqjIQA/pla...
- omnibrain 6y agoOr the floppy organ: https://m.youtube.com/watch?v=K46krINg8WA https://m.youtube.com/watch?v=K46krINg8WA
- jschwartzi 6y agoIf you want to boot Debian on there you can actually build a complete Debian system from the package archives using either Debootstrap or Multistrap. Debootstrap is useful for building a Debian system inside of another Debian system, while Multistrap is useful for building a root filesystem to copy to another computer. If you can boot an initramfs then you can boot the root filesystem using pivot-root. The Linux kernel can execute a shell script as PID1 from the initramfs, meaning that you can just execute the minimal commands needed to mount the main root filesystem and then use pivot-root to change from the linuxrc script in your initramfs to the main init process supplied in your main root filesystem. You might have to get really creative with compression and static linking as the linker/loader clocks in at a few-hundred kilobytes, plus the gcc support library and the glibc for another few megabytes. Alternatively you could find a way to make the system calls directly and bypass the libc. Busybox will also fit on that disk and it ships with a mount command too, so you could get up and running with that pretty easily.
- drt1245 6y agoRecent versions of Debian require a 686. https://www.debian.org/releases/stable/i386/ch02s01.en.html#idm272 https://www.debian.org/releases/stable/i386/ch02s01.en.html#...
- quotemstr 6y agoWould it be feasible to just build a Debian image for the i486? Few packages should depend on something newer.
- asveikau 6y agoI don't know offhand what instructions were introduced in Pentium or later. Doing some googling... 486 had cmpxchg, that's good. Seems it didn't have rdtsc. It's not out of the question, I might say even pretty common, for user mode code to use that one via inline asm to implement a timer. Obviously no SIMD instructions. If they say they're supporting 686 or better they might have some compiler flags that depend on mmx or similar? SSE came late to P6.
- MBCook 6y agoI had no idea the Linux kernel still supported the 486. I thought you had to have a Pentium class or better.
- kelnos 6y agoKernel support for 386 was dropped recently, but 486 and above are fine. I think many distros have probably dropped 486 support, though; someone upthread mentions that Debian is 686 and above only now.
- MuffinFlavored 6y agomost up to date kernel, but Aboriginal Linux was end-of-lined in 2017 http://landley.net/aboriginal/ http://landley.net/aboriginal/
- butz 6y agoWill sing-a-long contest return this year? That's a neat idea.
- pgtan 6y agoModern days Linux kernel requires a bootloader, as seen in the video. In the old days, you could dd the kernel to the floppy disk and use rdev to point to the root partition to start after loading the kernel.
- deleted 6y ago[deleted]
- colonwqbang 6y agoWhat about EFI?
- znpy 6y agothere was no EFI. it was BIOS as far as your eyes could see.
- colonwqbang 6y agoYes but in modern day Linux, EFI can load the kernel without an external bootloader. So it is not the case that modern day Linux requires a bootloader.
- cesarb 6y agoA couple of days ago, I went looking for when this code was removed. It was removed in 2003: https://lwn.net/Articles/21512/ https://lwn.net/Articles/21512/
- fierarul 6y agoNice link! The code is so tiny they could have kept it... But, oh well, progress. I like the message: - .ascii "Loading" +bugger_off_msg: + .ascii "Direct booting from floppy is no longer supported.\r\n" + .ascii "Please use a boot loader program instead.\r\n" + .ascii "\n" + .ascii "Remove disk and press any key to reboot . . .\r\n" + .byte 0
- 6y ago
- aksss 6y agoThe virtue of reusing an old system is somewhat eroded by the fact that its noise and power consumption exceed that of a more powerful Pi 3 B+, which can be had for $50-60 with case and power supply (circa 2020). I see little advantage in keeping the old hardware around anymore. I think I still have some old ISA cables downstairs in a box - high time to acknowledge to myself that I will NEVER use those again.
- cellularmitosis 6y agoI find the most useful application of old hardware is to occasionally re-ground your perspective on code performance and resource utilization. Writing software for old hardware is an effective way to force yourself to write performant code, even if only as a rare weekend exercise :)
- russdill 6y agoYou can get all that from using an AT-tiny :)
- SillaDeRuedas 6y agoBut then you wouldn't show up in HN's frontpage doing something completely meaningless.
- reaperducer 6y agoI guess it depends on if noise and power are your primary considerations. For some, they'd rather not see a useful machine take up space in a landfill, leech toxins into the environment, and simultaneously drive unneeded demand for the production of yet another computer. I guess one would have to do the math and figure out what the environmental impact of a new Pi 3 B+ is. Or they could figure out if the increased electrical cost of running an old machine over x number of years is greater than the expense of purchasing and powering a new Pi 3 B+. Where I live, I could run a 486 for a heck of a long time on $60, especially when you factor in that the Pi still needs to be powered, too.
- znpy 6y agoback when i was 13, didn't have a computer i could mess with and internet at home, i remember unsuccessfully trying to boot coyote linux on an internet café computer from a floppy disk. "floppydistro"s where a thing back in the day. the challenge was to fit a whole linux system along with some utilities in one or two floppy disks. usually the first floppy disk was for core os + base utilities and the second floppy disk was for additional software. oh the memories.
- jeffbee 6y agoQNX used to distribute a floppy containing the entire OS and a web browser, for x86. http://toastytech.com/guis/qnxdemo.html http://toastytech.com/guis/qnxdemo.html
- jeffbee 6y agoI wonder how well it works. If you take an x86_64 system and make a memory control group with only 32MB of memory (and kmem tracking is enabled, which is true by default) the container will OOM right away. I've been operating under the belief that Linux now requires 64MB at a minimum, but perhaps a 32-bit uniprocessor build can get by with less.
- znpy 6y ago> the container will OOM right away that doesn't really makes sense in linux-parlance. you should try and see which is the process that is actually triggering the OOM. if you're able to do that then you can try and swap that with another binary. you could try and build an hello world that does while(1) sleep(30); build that with static linking and boot the container with that -- it will probably work. also, i should look for that page, but i remember reading a page about trimming away anything possible from an hello world binary and ending up with something as small as like ~60 bytes.
- znpy 6y agohere it is! https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html https://www.muppetlabs.com/~breadbox/software/tiny/teensy.ht... i was off by a bit. the binary is 45 bytes and prints the number "42" (plus a newline).
- nathell 6y agoIt does not print anything. It returns with exit code 42.
- jeffbee 6y agoI see that you haven't tried it. Note: read for comprehension. A container may OOM from kernel memory alone.
- umanwizard 6y agoWhat process or processes were you running in the container? Edit: nvm, saw you answered it in another thread: `find / > /dev/null`. Interesting!
- rubenhak 6y agoNow that it boots, time to bring up a Kubernetes and deploy a Spark cluster
- locao 6y agoDoes anyone else miss having this level of motivation? And that's not an isolation effect on me, I gave up on trying fun things like this for a long long time now.
- treve 6y agoI feel ya. Every now and then I have a burst of creativity though and try to pick a project that can be completed in a day =) they're rarer now though (mid 30's)
- robohoe 6y agoWe need a list of projects to complete in 30 minutes or less ;)
- robohoe 6y agoI used to do this kind of stuff in junior high, high school, and college...back when I had the time now. Now with a day job it's time to find some time to muck around and really explore things with your curiosity and imagination. I totally see where you're coming from.
- deleted 6y ago[deleted]
- radicaldreamer 6y agoI've just become a lot lazier
- Teknoman117 6y agoI started playing too many video games :(
- golergka 6y agoIt seems that with experience, you sometimes just understood that something's theoretically possible, and lose interest at that point. At least, that's how I try to rationalize my laziness.
- mobilio 6y agoAlmost 20 years ago i have internet, but didn't buy router. And found floppyfw: https://www.zelow.no/floppyfw/ https://www.zelow.no/floppyfw/ Absolutely brilliant distribution that works perfect. And fit on one floppy - kernel and userspace.
- dredmorbius 6y agoSee also: tomsrtbt (http://www.toms.net/rb/ http://www.toms.net/rb/) and trinux (http://trinux.sourceforge.net/legacy/ http://trinux.sourceforge.net/legacy/) , among others.
- arantius 6y agoAlso in the late 90s (maybe super early 2000s?) I used "LRP" for my router, booting from only one floppy: https://en.wikipedia.org/wiki/Linux_Router_Project https://en.wikipedia.org/wiki/Linux_Router_Project
- jdofaz 6y agoA long time ago I remember installing gentoo on a 486 33Mhz (Tandy I think). I initially compiled everything on a much faster Athlon XP. I do remember compiling an updated kernel on the 486 and that it took 3 days, but it did finish :D I remember the hard drive was too big to boot from directly, there was some bootloader that could run from the floppy disk then finish booting from the hard drive. It also had this horrible sound card/cd-rom combo controller that I never was able to make work in linux
- rawoke083600 6y agoHaha I've done that also.. Except my 486 was a GEODE like a low-power-sbc of it's day and I compiled Gentoo on that !! Tooks days !!! :) Good Times.
- compsciphd 6y agoback in 2002, I built a floppy that had a linux kernel (2.4.18-rc4) with multiple ethernet drivers (back then tulip was taking over the 100mbps ethernet world, so pretty sure that was included, as well as the 3c509 driver), X (vesa driver), busybox (or proto/fork busybox), rdesktop to build a a thin client on a floppy. I even had a version that was able to squeeze in vncviewer by using the over 1.44MB modes of writing floppy disks. the project's point was to showcase stripping shared libraries of unused symbols to get the per binary density of statically linking across one's entire set of binaries. (useful for saving space on embedded systems) i wouldnt claim that it was unique (I believe Debian did something similar), but was a fun project.
- anthk 6y agoThere was a Nethack floopy for 3.4.3 (still played a lot by tons of people) which was booted up from a tiny Linux floppy. Amazing. It may work under a 486. Search for "nehabodi". http://nehabodi.sourceforge.net/ http://nehabodi.sourceforge.net/
- sideshowb 6y agoWhat's a floppy? /s
- dbolgheroni 6y agoWish I had this flexibility with other kinds of hardware, like a phone. Having to throw out a much newer and completely functional hardware 2 years after being released, because there is almost nothing you can do with it is not good. (And for those who want to instruct me about PC being a defined architecture, where there no such thing with smartphones, etc, etc, etc, I know all this, but the point is still valid.)
- MayeulC 6y agoHave you looked at postmarketos? https://postmarketos.org https://postmarketos.org Lots of fun to be had, if only to play with a battery-backed raspberrypi-like headless server in the worst, less-supported cases.
- deleted 6y ago[deleted]
- headmelted 6y agoClicked on the video to see AMERICAN MEGATRENDS INC. and wasn’t disappointed, ya freakin patriot!
- radoslawc 6y agoOh the floppy drive sound. I kind of miss it. Kind of, what I don't miss (besides capacity) is how those floppies were fragile, and this yyyy - yyyy ---- yyyy - yyyy sound when it was trying to re-read the sector, which was most of the times sound of defeat.
- datenwolf 6y agoThe author twice mentioned looking for a suitably tiny initrd / initramfs. FYI: You don't need an initrd / initramfs. Just link the drivers required for mounting the rootfs from IDE statically into the kernel image and you're done. Initrd used to be a kludge to work around bootloaders not supporting multiboot. And then we normalized that deviation in the form of initramfs.
- MayeulC 6y ago> Normally I would bypass a floppy install entirely and just boot an older computer via PXE and then install over the network. I thought I could put iPXE on a floppy and stick in an ISA NIC but iPXE just hangs without any error messages right after it's loaded from floppy. How about the plop boot manager? It has helped me a lot back in the days. Or any other pxe implementation. Or veven installing everything on that drive from another computer, which is likely the easiest way. I recently came across IDE/SD card adapters. Perfect for that kind of project, as it is much easier, cheaper and energy efficient to find, swap and use SD cards nowadays. My use-case is an Xbox console for nxdk dev work, but I haven't tried yet.