Booting a 486 from floppy with the most up-to-date stable Linux kernel
insentricity.com
insentricity.com
When I was 20, I got into a relationship with someone who was critical of it, and I ended up succumbing to their criticism, quitting my hacking, and going into IT industry instead.
I did that for about 15 years, but all along, I missed doing this kind of stuff. I kept doing it a little here and there, but my jobs would eat most of my hack juice, and I just didn't have much left for my own projects.
But I had already tasted the sweet nectar, and eventually I got tired of waiting for it, and abandoned the professional world gradually but completely.
I'm back to hacking now, and I could not be happier.
Sometimes I live outdoors, which I find comfortable with practice.
I consider NYC my project's headquarters and it is where I stay majority of the time.
I am sometimes housed by friends, family, and supporters of my software projects.
For food, I primarily dumpster-dive.
If you are genuinely able to be genuinely self sufficient without interacting with currency while still bieng able to have power to go on a computer with an internet connection, I have to say, props to you.
I just hope you do not get hit with a serious medical issue. Or have a fire and then get hit with a fire Marshall tearing you a new one over your unpaid property bieng not up to code.
I think overwork, unhappiness, and stress lead to many serious and preventable medical issues in today's world.
Not satire.
That doesn't mean I don't spend some time on these things. I've been doing some Atari 2600 programming, and have been playing around with an emulated IBM mainframe (TK4 on Hercules). I have also been working on a new demo effect on the Atari ST.
Note how the things I actually do follow through on, they're all working on emulators. It does give me the ability to take advantage of modern technology (such as Emacs) while still exploring the limits of old systems.
I'd like to think that getting older means you can appreciate both the old and the new, and I think my hobby projects reflect that.
Coding with modern tool sis fun because you can go much faster to handle the technical challenges of demos. Meaning, in my case, I can reach the algorithmic (the most interesting to me) aspect much faster.
For example, I've made a "bad apple" demo and I was able to quickly prototype a running version thanks to emulator, assembler, etc. Then I spend the remaining 80% of the project of figuring out the compression scheme.
Today, I'm working on some 3D stuff. Spent some time on basics (line drawing, assembler, etc) and again, I've reached the point where compression is the issue ! Back in the old days, this would've taken so much longer...
One of the things I found was a tube full of rom-less 8051 microcontrollers and another tube of AM85C30 Dual UARTs I probably picked up at a robotics club swap meet years ago. Ended up building a breadboard "computer" and picked up an universal programmer on eBay for like $50 (uses the open source minipro tool). (https://imgur.com/IjJ6HO6)
Also did some reverse engineering on how to do in-system programming of the BIOS chip in some 386EX based single board computer I have. I wanted to give myself an extra challenge while following the rust blog_os project.
This is an incredibly useful reference: https://en.wikipedia.org/wiki/Crystal_oscillator_frequencies
I didn't even realize the AVR supported a clock out until I bumped into it in the data sheet. Maddeningly it's not broken out on the Arduno Mega =P.
The only excuse to pull them out is to fix broken electronics/toys.
But the tinkering urge isn't gone. I highly recommend finding different hobby, that can satisfy that itch. Gardening, woodworking, cars, motorcycles, 3d printing, etc. You can spend many hours doing "useless" things there, and have tons of fun.
For me, for example, I used to get happiness from spending 20h of my time to get Linux running on some old HW, worth $5. Now I get similar rush from spending 20h trying to build something from wood, that ends up costing me way more and looking more crappy that picking it up at the store.
2 years ago, I was fed and bored with spending my evenings and weekends doing nothing useful, so I built myself an electronics lab and now I’m in there almost every night.
The last few weekends I’ve been trying to reverse engineer and hack the firmware of a 25 year old Tektronix oscilloscope.
It’s a bit of a pointless exercise, and somebody asked me on Twitter “why?”, and the simple reply is “because it’s there.”
But also: I’ve learned to use Ghidra and it’s given me tons of hours of tinkering.
Everything is like this. Sturgeon's law is everywhere.
Once I can somehow push those things out of my life, I'm good.
I discovered that, after 4 or 5 days of staycation, I've handled most of the crap that was hanging over my head. I've caught up on laundry, done whatever administrative stuff I had been procrastinating about, and I can finally start to relax. Which is to say, pursue leisure activities without feeling like there's something else I should be doing.
Being able to unplug from the day-job allows me to disconnect from a lot of that garbage tech and its frustration factors, and dedicate long periods of concentration to in-depth tasks that might not yield immediate payback. When I only have a few hours in the evening to put towards a task, I tend towards things with short-term payback, so I don't feel like I wasted the evening. That keeps me from really hacking on stuff in my spare time.
For me, personally, the hobby part became SAT solving. It's related to software verification and theorem proving and I feel like learning something useful - even for my family through better career prospects (responsibility box ticked). And I still get the bit-fiddling just as when hacking old microprocessors.
Without the depth consideration tied to something really firm (so to speak), it might as well be an article about how fun a challenge it is to casually travel to deep space, for how approachable it will be given even the highest level of layman's motivation.
Could just be me though.
For myself, opportunities to hack on fun side-projects are rare but I cherish them. Geeking out brings me satisfaction and joy. I've put a couple of fun projects on github and every fork & star is a little hit of shameless gratification: unlike karma on these blasted social sites, it feels like I've done something tangible to bring a smile to somebody's face. Because I did! That's not an intangible, it's good for my mental health!
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.
It's somewhat similar to the reason people (like me) restore and drive old cars, also despite the "noise and power consumption" (and some happen to like the former ;-) --- they're relatively simple and well-understood.
Likewise, there is also a very active retrocomputing community, although a lot of it goes back much older than 486 or even PC --- the C64, ZX, and the like continue to have plenty of new software written for them.
[1] and if you ask for a datasheet or any more details about it on their "excellent community" (to quote some), you basically get told politely to f'off: https://www.raspberrypi.org/forums/viewtopic.php?t=163420
Unless these companies manage to break away from their bad habits, I can't see ARM servers gaining any sort of market share outside of big companies.
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.
Alternative uses for a 486 case - make a planter box, bird house or a bee hive. https://www.instructables.com/id/Computer-case-beehive/
Alternative uses for 486 mobo - incorporate it into furniture design, cut it up to create a wind chime, create stuff like that to avoid the landfill. :)
Apparently it was my old team fortress computer. So like 15 years.
Fixing the computer keeps my dad busy. Seriously he has nothing better to do.
Solder went lead-free (and electronics in general went ROHS) so when it's buried in landfills it doesn't seep lead or other hazardous materials into groundwater.
There is zero chance of lead solder getting hot enough to skip the liquid phase of matter and go straight to a gas in a 486.
https://inhabitat.com/wp-content/blogs.dir/1/files/2018/12/c...
https://www.flickr.com/photos/schill/albums/7215762935517133...
An ISA/IDE cable is just copper ribbon cable using .1" spacing, which is what the GPIO header pin spacing is on a Pi. There is a pin blocked on the standard ide female connector but that pin is just one of many ground connectors on the Pi. Clip it off or dremel/drill out the hole as needed. Jeez, now I just convinced myself that I MIGHT use the cable some day. Thanks a lot! >:/ Was trying to throw it away.
There's a PCI bridge for the raspberry pi 4, if for whatever reason one would want to do such a thing. Drivers might be a problem if the card's linux support sucks but that's kind of a separate issue. https://www.tomshardware.com/news/raspberry-pi-4-pci-express...
EDIT: Oh, maybe your point was that the reason to keep the 486 around is to use old ISA/PCI cards - sorry, I mentioned ISA cables in OC so thought you were replying to that. Yeah, point taken, but I'm skeptical that there are any but the most narrow cases where the function of an old ISA/PCI card can't be replicated/emulated with better performance on a Pi. I mean, trying to think of the edge cases - an old SCSI RAID controller? Maybe some proprietary industrial controller stuff? but yeah. My comment about junking the old stuff was just a criticism of the inclination I think all of us nerds have to get that old box back into production use at home. I think there are very few - if any - cases where that makes sense anymore.
I have all sorts of ISA cards that have no alternative (other than for huge expense) or software. Quite a few IEEE-488, many other weird interfaces, DSP dev boards, one of a kind/prototype boards, other stuff. I have boxes of the stuff, and know hundreds of people who have the same needs. We have mailing lists.
No, a PI can't do that. No it can't emulate that. No it's not as generally useful as you think unless all you care about is stuff written in the last 5 years.
I don't doubt there are specialized boards out there that have no modern functional equivalent (esp. industrial apps), but you CAN connect to stuff using GPIB (IEEE 488) with a Pi, so that's not one of them.
If legacy OS/app support is your issue I'm not sure it's going to give you much value booting your 486 with a linux distro today (what the post was about, and the context in which my comment was made about the Pi).
If you're locked into the 486-generation hardware interfaces and the Windows/DOS software platform, and CAN'T leverage hardware interface bridges and software emulators on modern systems with horsepower to spare, you're talking about the edge cases of the edge cases.
My point was never directed at the edge cases of the edge cases. I said "I see little advantage in keeping the old hardware around". The rare edge cases are represented by that "little advantage" I CAN see. But it's little, man. Most situations where a 486 would offer any utility today, particularly on Linux but not only that, a $50 3-watt Pi can do the job better, cheaper and cleaner.
Those things are the embodiment of "generally useful" - A low power, small form-factor, relatively high-power compute platform with an easy to use GPIO header and libraries for many languages, able to leverage most Debian packages (including DOS emulators). I admit it doesn't meet 100% of planetary need, but it's right up there with anti-lock brakes, microwavable meals, and stretchy pants in my book. Convince me otherwise.
(There's also the T620 Pro, but those are going for a bit more these days since they make good home routers when you add a quad gig-e card...)
I think this is definitely in keeping with the hacker spirit and belongs on the front page for that reason alone.
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.
https://www.debian.org/releases/stable/i386/ch02s01.en.html#...
https://www.zdnet.com/article/good-bye-386-linux-to-drop-sup...
From that link:
x86, 386 removal: Remove CONFIG_CMPXCHG
x86, 386 removal: Remove CONFIG_XADD
x86, 386 removal: Remove CONFIG_BSWAP
x86, 386 removal: Remove CONFIG_INVLPG
x86, 386 removal: Remove CONFIG_X86_WP_WORKS_OK
x86, 386 removal: Remove CONFIG_X86_POPAD_OKThey dropped 386 support, but a 486 still works.
So even if you compiled it with strict -march i486 you'd end up with unsupported instructions. Modern GCC also doesn't like emitting strict i386 or i486 code anymore so you'd be likely to end up with unsupported instructions even without any inline assembly.
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.
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.
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.
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 0Not for long; the EFI headers later used the same space, which even required severely shortening that "no longer supported" message (the first two lines of the message were replaced by just "Use a boot loader.\r\n")
(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.)
Lots of fun to be had, if only to play with a battery-backed raspberrypi-like headless server in the worst, less-supported cases.
"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.
Really a nice quick read.
The merge which removed the 80386 support (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/a5c2a893dbd4956a72fb261e87...), with consequences all over the kernel (https://git.kernel.org/torvalds/c/96d4f267e40f9509e8a66e2b39...).
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.
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.
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)
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
[2] https://shemesh.larc.nasa.gov/NFM2018/talks/Butler.pdf
[3] https://web.archive.org/web/20100822151603/http://www.rockwe...
That's an interesting observation. The presentation specifically mentions verification of the microcode, which I think would be feasible to do for a 286?
> 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"?
Yeah, I'm not sure where the rumour came from either. But I do think it's plausible. According to "Computers take flight" [1], the 777 uses (among others) a 486 for its control system:
> Boeing finally built an airliner with fly-by-wire controls, the 777. The control system is more straightforward than that used by Airbus. It contains three “lanes” of three different computers each: an AMD 29050, a Motorola 68043, and an Intel 80486.
The source given is "Primary flight computers for the Boeing 777" [2], which doesn't seem publicly available.
Given the closeness in time for the 777 and the 737 NG, it seems somewhat unlikely (to me) that the 777 would go for the most popular options, while the 737 would use a bespoke CPU design. The A320 used 80186 and 68K processors [3], so the 737 would really be the odd one out in that case.
1: https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/200501...
2: https://www.sciencedirect.com/science/article/abs/pii/S01419...
3: https://books.google.se/books?id=KDX0BwAAQBAJ&pg=PA214&lpg=P...
Rockwell Collins didn't build the primary flight computer of the 777, but they did build the 777 autopilot (which is a separate computer system). The 777 autopilot and the 737 flight computer appear to have some shared technical heritage, including both using the FCP-2002 CPU (whatever it actually is).
(Why Boeing chooses different vendors for different aircraft models, I don't know, but I presume it is part of a corporate strategy of ensuring some diversity in vendors to avoid "putting all its eggs in one basket".)
Exactly. If you have to support some old esoteric hardware, you probably wouldn't be able to run a recent kernel anyways, since all your software would probably also be tied/constrained to whaterver it was developed and tested for.
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.
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).
Note: read for comprehension.
A container may OOM from kernel memory alone.
Edit: nvm, saw you answered it in another thread: `find / > /dev/null`. Interesting!
# cd /sys/fs/cgroup/memory/
# mkdir lol-hackernewses
# cd lol-hackernewses
# echo 32000000 > memory.limit_in_bytes
# echo $$ > tasks
# find / > /dev/null
Killed
Memory cgroup stats for /lol-hackernewses:
anon 135168
file 11567104
kernel_stack 0
slab 19771392
sock 0
shmem 0
file_mapped 0
file_dirty 0
file_writeback 0
anon_thp 0
inactive_anon 0
active_anon 94208
inactive_file 5517312
active_file 5881856
unevictable 0
slab_reclaimable 19075072
slab_unreclaimable 696320
pgfault 14817
pgmajfault 2376
workingset_refault 25773
workingset_activate 3465
workingset_nodereclaim 0
pgrefill 969886
pgscan 971861
pgsteal 50508
pgactivate 913407
pgdeactivate 969886
pglazyfree 0
pglazyfreed 0
thp_fault_alloc 0
thp_collapse_alloc 0How 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.
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
Absolutely brilliant distribution that works perfect. And fit on one floppy - kernel and userspace.