Thanks for the comments! ELKS will run on an 8088, but also runs on any x86 PC using the legacy "real mode" which runs in 16-bit segmented architecture without an MMU or any hardware protection. It can be fun to boot a PC and see a close resemblance to Linux, but run the way things used to be, using only 16-bits.
It'll also run in ROM, e.g. using a 8018x CPU w/onboard PIT and PIC.
The point of ELKS today is about "small is beautiful" and seeing what can be done when limited to 64k code and 64k data, and 640k RAM. It's based on a very old fork of Linux and many of the internal structures are similar to what was found in Linux 2.0, without the changes for SMP support.
We just recently got a native C compiler/assembler/linker toolchain up and running. I must say making that happen provided some vivid comparisons of what programmers had to go through in decades past in both slower speeds and small executable file sizes, versus what we all have and expect today at our fingertips.
Very awesome work indeed... I haven't looked at ELKS in a long time and seeing everything it can do now is heartwarming.
The 8018x/ROM mode sounds like it could make for a fun breadboarding project, not that I'll likely wind up doing it myself. Is there any way to run it in emulation?
Running native compilers on XT/286 hardware does indeed sound sloooow. At least it can be tested, probably automatically, in emulators where it'd run faster than the native compilers did back when this all started :)
---
It's funny... 7-10 year old hardware back in 95-96 when this started could barely keep up with current software at all, and I'm writing this on a 7 year old Dell Precision (albeit upgraded well beyond stock :) ) that still runs Linux pretty darn well.
I recently added dual screen support to the ELKS console-direct driver, so if your system has both MDA and CGA cards, you enable CONFIG_CONSOLE_DUAL in your kernel config and select runlevel 5 in /bootopts, it will allocate 4 ttys, with one of them on the MDA display. You can see this setup running on my hardware in this pic in the README:
I do wonder in today’s landscape of single board computers what the right bit width is. A 64-bit system with like 1-2GB or RAM doesn’t make a ton of sense since your program size and data structure size grows by quite a bit but you don’t need it to since you don’t get to have more than 4GB of RAM. On the other hand there you do have SBCs with 8-16GBs of RAM but that’s a far cry from needing full 64 bits. Would an optimal bit width be 48 bits? 40?
32-bit ARM-based systems supported up to 1 TB of RAM. 32-bit x86 only up to 64 GB. Unless you want to map more than 4 GB in a single process, you could very well stay 32-bit.
But AArch64 (or ARM64) and AMD64 did bring a lot more on the table than just larger address space. More registers, and a performance boost by just being better suited for the modern CPU core design.
Many "64-bit" systems only have ~48 bits of virtual address space, and while canonical pointers have all the high bits equal, you can put the otherwise-wasted bits to work by storing metadata.
If you're writing really space-optimised code, you can pack pointers closer together.
Yes, this already happens. Address bus width is usually different from register width due to cost. I found this, old CPU's address bus only getting to 44 bits wide on Itanium.
For embedded uses, 1GB is certainly big enough to not need to be 32-bit, so it makes sense IMO to use the same 64-bit binaries/toolchains/BSPs as larger platforms, especially since they're better supported by upstreams now.
I think it's either 8, 32 or 64 bit. Maybe 16 bit.
The size of memory space is not necessarily aligned with the bit width of the CPU. There are a lot of 32 bit systems that can use much more than 4 GB of RAM. And there are no 64 bit systems I know of, that are even theoretically able to use 16 exabytes (16 million TB) of RAM.
AFAIK ARM32 is still the norm for embedded systems. And there is still a place for 8-bit microcontrollers.
It's a hobby, not big and professional like GNU^H^H^HLinux.
Seriously, I haven't worked on this in a long time (I'm Chad) and I'm very impressed by the changelog! Wouldn't have ever thought it'd run DOOM. ;) (and the use of OS/2 for medium model is clever too)
There is a temporal element to your statement. 32-bit support is being removed from the kernel of today. No one uses that hardware for a modern OS anymore.
But a small band of hobbyists use old OSes with old machines.
Another operating system that deserves mention for 286 class machines is Coherent. This was an Unix like OS you could buy for $99, and it had all of the various Unix utilities and came with a HUGE manual to help you learn it.
They had a 386 version as well, but went all in on getting X-windows and graphics working, and ignored TCP/networking just as the Internet started to gain a lot of traction. Still an interesting OS to look at!
Tangentially related, DOS is a popular choice in this category of hardware.
Freedos has released 1.4rc1 recently, thus 1.4 is close.
Svardos switched to EDR-DOS kernel, which is derived from DR-DOS. That's a very nice kernel, written in assembly. Notably, Windows 3.1 works with it, including protected mode.
Some of the Tandy 1000 computers (such as the HX) had MS-DOS 2.11 in ROM. So it's not unheard of for an IBM-Compatible PC to have an operating system in ROM.
Also the "Macintosh Classic" had System 6.0.3 in ROM as well, but you had to use a keyboard shortcut to boot from there. It did not run normally.
I've never seen a fully ROM-based PC, but I have worked with ISA NE2000 NICs with boot ROMs that allowed them to diskless boot into a DOS-based Novell NetWare client. It wouldn't surprise me if there were ROM-based local boot environments on ISA cards.
The Cisco PIX firewall, in it's original incarnation, booted from non-volatile memory (I don't know if it was EEPROM or flash) an ISA card.
Lots of embedded systems like routers run read only although maybe they're not technically ROM. Usually they mount the root filesystems read only and create some small ram disk/tempfs for logs. Persistent settings go to a small NVRAM area
The root filesystem is only written to when you flash a new OS image
Another example was the Headstart Explorer from 1989. My parents had such a computer.
> But the most characteristic part was the operating environment - 384kB of ROM contained MS-DOS version 3.31 and Explorer GUI which allows to work in PIM programs, database and text editor using mouse. The GUI is shown using CGA mode and allows to launch DOS programs too.
Yes, there were many - including the original IBM PC which would could boot to BASIC loaded from ROM. Some more sophisticated machines included:
- Many Tandy PC compatibles could boot from ROM to their DeskMate GUI
- HP, GRiD, Zenith and others had laptops that had DOS and in some cases Windows in ROM.
- IBM's PS/1 line could boot from ROM
- Many GEOS devices booted from ROM into a GUI, and often could boot to DOS from ROM too.
The 8086 and 8088 etc. were relatively popular for embedded devices. For example some early 90s Apple printers used an 80186 as the controller. Such designs were often incompatible with the IBM PC; 8086 doesn't necessarily mean PC compatible.
I said in my earlier post that I hadn't seen a fully ROM-based PC but I completely forgot about stuff like the HP and Psion and Atari PC handhelds!
In that vein, I've got an old V20-based NEC laptop (the PC-17-02[0], arguably an Ultrabook in its day) that booted MS-DOS 3.3 from ROM. It had a 2MB battery-backed RAM disk that the ROM got copied into. It showed up as a hard disk drive with an INT 13H-style interface.
The memories. I had it run ("installed" would be a big word ona 2 flopppy and no hard drive system) on a super cute Carry-1 8088 computer ages ago, which I stupidly sold on Ebay shortly after as I had no use for it.
Here's one of the very rare photos online.
http://vintagescan.blogspot.com/2015/12/flytech-carry-i-1990...
Does anybody have the archive of the original ELKS site with the quote from Linus that Linux is not suitable for anything but 486 or higher or something like that?
How recent was the quote? Anywhere near 486 through Pentium, and the quote makes absolute sense. He wouldn’t have been optimizing for smaller architectures.
Since then, some (many?) contributors have supplied support for smaller systems.
The "getting started" doc briefly mentions the history: it began in 1995 as a fork of the standard Linux kernel (initially named Linux-8086), by Linux kernel developers Alan Cox and Chad Page. So it does share both code roots and some initial community with the "real" mainline Linux.
I had tried to get some version of Linux running on my 386SX / 25MHz / 8MB RAM but only succeeded in getting BasicLinux[1] running bootstrapped from a DOS boot first. Somehow I had never found ELKS! But I was just able to trivially make a floppy and boot the system[2]. Amazing. Looking forward to playing with this.
There was a version of KA9Q NOS with multitasking that could serve telnet, ftp, smtp, bbs, convers, and more plus give you multiple switchable terminals for telnet, ftp, all at the same time on an 8088 and connect to a packet driver for modem, ethernet, or AX25. It was a port of BSD networking with its own multitasking capability.
Could somebody with a good understanding of microchip production economics explain what the price difference would be if all 8-bit chips (such as the Atmega328) were replaced by otherwise equivalent 32-bit or 64-bit chops tomorrow (that is, same production capacity and unit counts sold)?
How much would it cost, in cents, to just have those extra bits?
Supply-chains are more complicated than merely the unit price. Things like existing stock, talent, software, product design, certifications (both chip and products based on chip), and hundreds of other things play just as substantial role.
a cheap 32 bit RISC-V chip like the CH32V003 goes for about $0.10, and the cheapest MCU I've heard of (PMS150C, barely useful for anything) goes for around $0.03
Even without special knowledgeon production economics, I dare say there would be a race to produce replacement compatible 8-bit microcontrollers to get people's stuff working again.
My oldest working systems are now a 386/DX40 and 486/DX2-66, but I never had a chance to run Linux on them back then. Did anybody here have a favorite distro for such early 90s hardware? When I find a 286 or earlier I'd love to give ELKS a try.
What would be really interesting: porting DOSEMU 1.4.0 to it. This would give us a maintained unix-like OS combined with a huge abandonware dos library turning those old machines into something fun and maybe useful.
Computers which use 16-bit Intel processors (80286 or earlier) are quite rare nowadays - most of them are 30-40 years old, and are more valuable to collectors than newer and more capable hardware would be. If you want something "useful", this isn't where you'd find it.
ghaerr|1 year ago
It'll also run in ROM, e.g. using a 8018x CPU w/onboard PIT and PIC.
The point of ELKS today is about "small is beautiful" and seeing what can be done when limited to 64k code and 64k data, and 640k RAM. It's based on a very old fork of Linux and many of the internal structures are similar to what was found in Linux 2.0, without the changes for SMP support.
We just recently got a native C compiler/assembler/linker toolchain up and running. I must say making that happen provided some vivid comparisons of what programmers had to go through in decades past in both slower speeds and small executable file sizes, versus what we all have and expect today at our fingertips.
happycube|1 year ago
The 8018x/ROM mode sounds like it could make for a fun breadboarding project, not that I'll likely wind up doing it myself. Is there any way to run it in emulation?
Running native compilers on XT/286 hardware does indeed sound sloooow. At least it can be tested, probably automatically, in emulators where it'd run faster than the native compilers did back when this all started :)
---
It's funny... 7-10 year old hardware back in 95-96 when this started could barely keep up with current software at all, and I'm writing this on a 7 year old Dell Precision (albeit upgraded well beyond stock :) ) that still runs Linux pretty darn well.
- Chad
ikari_pl|1 year ago
anthk|1 year ago
helf|1 year ago
[deleted]
vkoskiv|1 year ago
https://raw.githubusercontent.com/ghaerr/elks/refs/heads/mas...
I could use some help testing it on EGA and VGA hardware, as I don’t have any 8 bit cards for those in my collection.
tialaramex|1 year ago
Most recently Al was learning Rust because he needs that for his current role, it might be fun to see whether you can write an ELKS target for Rust.
ghaerr|1 year ago
IgorPartola|1 year ago
vardump|1 year ago
But AArch64 (or ARM64) and AMD64 did bring a lot more on the table than just larger address space. More registers, and a performance boost by just being better suited for the modern CPU core design.
Retr0id|1 year ago
If you're writing really space-optimised code, you can pack pointers closer together.
mixmastamyk|1 year ago
https://www.tech-faq.com/address-bus.html
My newish AMD laptop: `grep 'address sizes' /proc/cpuinfo`
Looks like 36 bits wide is already plenty for anything typical, up to 68 GB:happycube|1 year ago
Narishma|1 year ago
andix|1 year ago
The size of memory space is not necessarily aligned with the bit width of the CPU. There are a lot of 32 bit systems that can use much more than 4 GB of RAM. And there are no 64 bit systems I know of, that are even theoretically able to use 16 exabytes (16 million TB) of RAM.
AFAIK ARM32 is still the norm for embedded systems. And there is still a place for 8-bit microcontrollers.
LeFantome|1 year ago
happycube|1 year ago
Seriously, I haven't worked on this in a long time (I'm Chad) and I'm very impressed by the changelog! Wouldn't have ever thought it'd run DOOM. ;) (and the use of OS/2 for medium model is clever too)
anthk|1 year ago
And for sure the 2nd and 3rd world use 32 bit devices.
pantalaimon|1 year ago
userbinator|1 year ago
philistine|1 year ago
But a small band of hobbyists use old OSes with old machines.
knorker|1 year ago
So I used elks and lugged around a lead acid motorcycle battery.
It was great for my circumstances, but I wouldn't say I miss it compared to my many cores and gigs laptop.
cloudsec9|1 year ago
They had a 386 version as well, but went all in on getting X-windows and graphics working, and ignored TCP/networking just as the Internet started to gain a lot of traction. Still an interesting OS to look at!
lproven|1 year ago
https://github.com/gspu/Coherent
snvzz|1 year ago
Freedos has released 1.4rc1 recently, thus 1.4 is close.
Svardos switched to EDR-DOS kernel, which is derived from DR-DOS. That's a very nice kernel, written in assembly. Notably, Windows 3.1 works with it, including protected mode.
lproven|1 year ago
https://www.theregister.com/2024/12/23/svardos_drdos_reborn/
I have built a hobby project around it:
https://github.com/lproven/usb-dos
forinti|1 year ago
That's super interesting.
Dwedit|1 year ago
Also the "Macintosh Classic" had System 6.0.3 in ROM as well, but you had to use a keyboard shortcut to boot from there. It did not run normally.
fidotron|1 year ago
x86 (and licensed derivatives) were a thing in more custom handhelds like the Psion Series 3, and games systems like the Wonderswan. The variants made by NEC alone were: https://en.m.wikipedia.org/wiki/NEC_V20#Variants_and_success...
EvanAnderson|1 year ago
The Cisco PIX firewall, in it's original incarnation, booted from non-volatile memory (I don't know if it was EEPROM or flash) an ISA card.
sillywalk|1 year ago
Interestingly, somebody has made an emulator for it.
https://barotto.github.io/IBMulator/
gattilorenz|1 year ago
Here you can see it on an external board: https://www.os2museum.com/wp/diskonchip/
I have a few thinclients with a socket directly on the mainboard for a DOC
nijave|1 year ago
The root filesystem is only written to when you flash a new OS image
accrual|1 year ago
> But the most characteristic part was the operating environment - 384kB of ROM contained MS-DOS version 3.31 and Explorer GUI which allows to work in PIM programs, database and text editor using mouse. The GUI is shown using CGA mode and allows to launch DOS programs too.
https://oldcomputer.info/pc/hs_explorer/index.htm
CathodeRayDude (CRT) has an entertaining video on the subject:
https://www.youtube.com/watch?v=d1jpIiST6ec
snerbles|1 year ago
indymike|1 year ago
- Many Tandy PC compatibles could boot from ROM to their DeskMate GUI - HP, GRiD, Zenith and others had laptops that had DOS and in some cases Windows in ROM.
- IBM's PS/1 line could boot from ROM - Many GEOS devices booted from ROM into a GUI, and often could boot to DOS from ROM too.
retrac|1 year ago
lproven|1 year ago
There is an MS-DOS compatible ROM OS still sold today:
https://www.tuxera.com/products/rom-dos/
EvanAnderson|1 year ago
In that vein, I've got an old V20-based NEC laptop (the PC-17-02[0], arguably an Ultrabook in its day) that booted MS-DOS 3.3 from ROM. It had a 2MB battery-backed RAM disk that the ROM got copied into. It showed up as a hard disk drive with an INT 13H-style interface.
[0] http://old.chuma.org/ultralite/index.shtml
Narishma|1 year ago
squarefoot|1 year ago
jvanderbot|1 year ago
snvzz|1 year ago
There are success stories with it on 8088 book, pocket 8086 and similar such hardware.
tmzt|1 year ago
mepian|1 year ago
“It is NOT portable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.”
gregw2|1 year ago
https://web.archive.org/web/20010626233912/http://www.elks.e...
Not sure if you are confusing that with the original Linux/Linus announcement post:
https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/Sw...
jagged-chisel|1 year ago
Since then, some (many?) contributors have supplied support for smaller systems.
garaetjjte|1 year ago
pm215|1 year ago
lproven|1 year ago
ELKS: Embeddable Linux Kernel Subset.
It'a a subset of the Linux kernel, which is suitable for embedded systems. Meaning, "don't expect this to be a usable desktop OS."
incanus77|1 year ago
[1] https://distro.ibiblio.org/baslinux/
[2] https://mastodon.social/@incanus/113777573079528868
anthk|1 year ago
Also, check delicate linux:
http://delicate-linux.net/
Do not try X under Delicate Linux, it will run dog slow with 8MB of RAM.
If you can upgrade it to 16MB and some 486, X would be fine, with icewm set to a light plain theme, no desktop icons.
chriscappuccio|1 year ago
Also PC/MIX was pretty cool.
nh2|1 year ago
How much would it cost, in cents, to just have those extra bits?
LeFantome|1 year ago
omeid2|1 year ago
Palomides|1 year ago
there's little real point in 8 bit chips anymore
fulafel|1 year ago
accrual|1 year ago
fragmede|1 year ago
hudecekdev|1 year ago
unknown|1 year ago
[deleted]
fulafel|1 year ago
marcodiego|1 year ago
devit|1 year ago
You can just run MS-DOS or FreeDOS directly on those machines, that's what the machines were made for.
duskwuff|1 year ago
yjftsjthsd-h|1 year ago