315 points · by LeoPanthera · 6y ago · 167 comments
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.
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.
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.
(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...)
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...
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.
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.