Hacker News new | past | comments | ask | show | jobs | submit login
Gray386Linux – Linux for 386 Machines (github.com/marmolak)
61 points by marmolak on Sept 20, 2022 | hide | past | favorite | 47 comments



For a 486 I'd use NetBSD with ctwm.

On support, it's odd no one tested Alpine Linux on a 486, necause Alpine will run perfectly on it. No, Nix, no complex setup, a huge repo of packages.

Alpine Linux with a patched X for VLB/ISA:

https://github.com/scanlime/avc-edge-linux


Yeah, but 486 is not 386.

Nix is used to preserve development environment of linux kernel. Without nix, setup would be much, much more complex.

Thank you for info about avc-edge-linux. Going to take a look :).


OpenBSD still builds releases for i386. I don't know for how much longer; they note that "Due to the increased usage of OpenBSD/amd64, as well as the age and practicality of most i386 hardware, only easy and critical security fixes are backported to i386. The project has more important things to focus on."

https://www.openbsd.org/i386.html


Not all i386 in name are real 386. Sometimes they think about i586 or i686 (which is way how to mark generations of CPU).

From provided page:

Processors All CPUs compatible with the Intel Pentium or later, with Intel-compatible hardware floating point support should work.

So no support for real 386 CPU.


Nor the hordes of embedded 486 cores (the AMD Elan series, et al) that powered many of the first-gen 802.11b hardware.


Boo! I was very excited for half a minute.

Guess my 386sx-40 will stay DOS5 + WFW 3.11 + CalmiraXP + Win32s etc lol


OpenBSD dropped support for the 80386 around 2005, and the 80486 sometime later.

The arch name i386 doesn't actually mean 386.


Right. In this context, i386 really means the 32-bit x86 architecture, as opposed to 64-bit.

I don't know of any architectural differences that would require a Pentium over a 386 or 486 (besides a FPU.) The Pentium runs the same software in the same memory and address space, just faster. Unless something requires Pentium MMX or SSE instructions.


Things like CMOV were introduced in the pentium pro (i686), which often is the cut-off for reasonably modern OS support.


OpenBSD i386 (atom n270) user here runs fine. No Firefox, but I have Lynx/Links/Netsurf/Luakit and Seamonkey.


Oh sweet! I actually just pulled my childhood 386 out of storage :D

It’s just a SX 40 with 12mb of ram tho. I need to get a 387 for it and more memory.

This is great!

edit

Crap just saw the actual cpu compat list. Dammit.

edit again

Ok wait I was confused by someone else. This /will/ work on my 386. Yessss


Great! But don't expect much for now. But personally, I'm happy with result, because I'm able to deploy dos machines with bigger HDDs (with help of XTIDE bios - still playing around) or just put dos images to HDDs via network without too much time spend with real hw. Don't get me wrong. I really like real hw but prepare basic machine setup is soooo convenient in virtual environment nowadays.

Also, booting real 386 via network... My childhood dreams come true ;P.


Yes! I can’t wait to try it out soon. I have an NE2000 ISA NIC in mine. So I’ll be able to give that a go. I’ve been wanting to do some upgrades to it for awhile so now I have an excuse xD


Btw, what are you future plans? Do you plan on an X system or?


And another plan is to review my patches for 3.7.10 kernel, because it's just bunch of hacks and I still learn much more from work on them.

Basically, main goal has been: make machine with 3COM card with lanworks proprietary boot rom boots from network on old machine... but what do I going to boot? As a side effect of this effort were gray486linux born (yep. It was first). After some issues (CET instructions emited by gcc aka multinop instructions not supported by i486) it finally booted. Then... how hard it can be to do the same on 386 machine ;P. It was harder and I learned tons of stuff during the process.

Also. I would like to have something small which still can be booted over network and I can deploy prepared base images with DOS/Windows 3.11 etc... just that easy (with help of Ontrack or XTIDE bios). Or I can deploy prepared Windows NT 4.0, because it looks like my SCSI cdrom died on one of my machines.

But if you have some ideas what to do with it, don't hesitate and let me know.


X would be great addition. Someone here point me to linux distro for 486 machines with working X. However, I don't think it will be bootable from network with full X window and window manager support. So I need to find a way how to use network storage.

BTW: only few ethernet cards are supported now (3com fan here ;)). Maybe I can enable support for NE2000 compatible clones, because it was very common.


Able to be booted via network with current (2022) busybox userland.


Serious question: if you are that in to Linux on old boxes, why not just run period distributions? https://en.wikipedia.org/wiki/Slackware#Releases is a good breakdown of history.


It's easy. There seems to be nothing directly support i386 (I mean: real 386 chip) with latest supported kernel version (as I know) and newest busybox.

i386 doesn't support cmpxchg instruction for example and I'm not able (maybe someone can help) to force gcc 12 not to emit these instructions. So I added some kind of emulation of cmpxchg (code is very straightforward and stupid. Only few combinations are supported because it just works for me now).

And linux itself it's another story. 3.7.10 should be last with real i386 support, but it's not that much true :). Because I wasn't able to compile 3.7 kernel without some hacks.

Main goals were: 1) use as newest software as possible 2) be able to boot from network with 4 MB RAM (8 MB RAM is much better) on real hardware.

Also, this distro can be used to bootstrap machines with prepared dos images or other operatin systems. Don't get me wrong. I love floppy disks however I'm too lazy to install systems from them.


OK, I see the general approach. Some sort of hack to get modern code to run on CPUs without the normally assumed instruction set present.

Perhaps consider writing "what problem does this solve" and "how does it solve it" and "why is this approach a good one" at the top of your repo. It would help to generate interest.


Good point. Thanks. Note to my TODO added.


> Currently, it's not possible to run gray386linux on i486 machines (but it's possible to run gray386linux on Cyrix 486DLC and similar CPUs)

What's the cause? Incompatible/missing peripheral or some breaking changes in instruction set?


Hi. I don't know for now. There is ton's of issues while switching to protected mode (ipxe for example: https://github.com/ipxe/ipxe/commit/bc35b24e3ebd2996b2484b7f...). It just stuck when I select it from PXE menu and I didn't debugged it further. Maybe someone can figure it out and send patches or advices.

Also it's not my goal to run gray386linux on i486 machines because I have another distribution: gray486linux, which aims specially to systems with 486 CPUs.


But what about folks who want to give their 386DX system a speed boost with RapidCAD? Will they have to re-install their OS? :) https://www.youtube.com/watch?v=UM4NPh5qg8Y

But seriously this stuff is very subtle. An issue (probably different) from a HN thread on similar matters: https://news.ycombinator.com/item?id=30801836


snort

The RapidCAD is pretty amusing since it’s literally just a castrated 486 (no L1! Eek!)

The Cyril gray top FastMath FPU is the best bet for an upgrade and still being a real 386 (I’m hunting for one for mine ) - https://www.vogons.org/viewtopic.php?t=65991



Maybe and maybe another hacks and also not compiled support for 486 cpus. This hack is invoked only on CPUs, which doesn't support cmpxchg instruction. For example, 486 DLC from Cyrix is basically 386 with i486 instruction set but I'm not able to boot linux for 486 machines. https://en.wikipedia.org/wiki/Cyrix_Cx486DLC But gray386 runs perfectly on 486 DLC without hack involved.


Hm. "Install nix. --disable-shadow". musl. Better run an old distribution. Anyone knows where can i find 386, 486 era computers besides ebay ?


Old distribution with old userspace :). I understand that it looks hard. But you can download precompiled kernel and initrd. Yeah, there is only busybox for now.


This might be a case for PCEm.

https://www.pcem-emulator.co.uk


PCem was abandoned and 86box is an actively maintained fork that's almost entirely better. Includes an actual UI, too!


PCem has a UI, not sure what you're talking about here. It even manages different configurations in its UI, whereas you have to install external apps for that with 86box.

It's also much faster than 86box in my experience.


Right click to do anything with the emulator isn't much of a UI :)


I don't know what you're talking about. Right click doesn't do anything in PCem.

The UI I'm talking about is the configuration manager where you create and configure virtual machines. When you start a machine there's not much UI except for menu bar at the top.


Since when does it have a menu bar?


Since forever? I mean even the old Windows XP screenshots from the website have it.

http://pcem-emulator.co.uk/screenshots.html


PCem recently resumed development.


I extensively tested PCem. A lot of the systems do not work. Though i found a Socket 7 Asus Pentium MMX that was able to boot a particular Slackware (10 i think)


Did you locate the full rom set?


I took the ROM set which was referenced, if i remember correctly, on the github page. There were a lot of XT, AT and other machines. My goal was to run an old Slackware on a 486 era machine but all of them hang at boot. The only luck was with the pentium and slackware 10. I would have preffered 7.


I've had no trouble installing various Linux and BSD distros on various 386 and 486 machines in PCem over the years.


> Anyone knows where can i find 386, 486 era computers besides ebay ?

Older businesses and factories. I saved tons of 386/486/pentium stuff form my workplace. Though I was lucky because my predecessor was a pack rat and never threw anything out.


There are hundreds of thousands if not more chugging away in the embedded world. And there are still many running in less developed countries.


Tons and tons. And they won’t be going away anytime soon.


Use qemu, -cpu 486, -vga cirrus, -soundhw sb16


But this emulates 486 systems and not precisely. For example, endbr32 instruction is not a problem under emulation but it's real issue on real i386/i486 hw. Simply because real 386/486 cpus doesn't support multi nop instructions.


An Iranian film buff, I see.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: