Hacker News new | past | comments | ask | show | jobs | submit login
789 KB Linux Without MMU on RISC-V (popovicu.com)
166 points by yarapavan on Oct 9, 2023 | hide | past | favorite | 34 comments



Very interesting! Reminds me of uClinux for the PSP [1]

Offtopic regarding the PSP version mentioned above: while doing some quick research right now (remembering that my PSP still works, as tested a couple of weeks ago), I sh*t you not, google gave me my own post from 2010. Right in the nostalgia.

[1] https://psplinux.info/tag/uclinux/

[2] https://www.vogons.org/viewtopic.php?t=25416


I think this is something us nerds who contribute on niche topics will always find at some point. Amazing!


I remember Linux on a floppy in the 2.4 era. You generally needed to do some interesting formatting to the disks to get much of a user land, but you could have a router running from floppy/ram in 1.4->1.7 mb of disk.


In the late 90's I lived in a house with +/- 10 others (mostly students).

Internet was shared using Windows ICS (ugh!) on someone's PC, which was also used for that guys' regular work. Which included playing Diablo & such.

Obviously a lousy setup. And of course internet (for the rest o/t house) was often down as a result.

At some point people got fed up. And (having some Linux experience at the time) I knew where to look.

Put together and old Pentium PC with 2 network cards, no hdd, and in went a floppy called FreeSCO. After fiddling with the software's power management settings, I put the CPU on passive cooling.

Shoved the box in a corner & never looked back - rock solid. Uptime usually limited by power failures or ISP messing with configuration of their systems.

Indeed: Linux 2.0~2.4 days.


Old Pentium in the 90s!? What were you, a billionaire?


In 1998, an old Pentium might have been four or five years old and cast off.


You have to remember from 97 to 2001 we were doubling CPU speed about every year. from 233mhz or so to 1ghz rapidly. I remember getting Pentium 2 boxes at 200, then 333, then 400, p3 at 500 and it felt like a year later 700mhz onward to 1ghz.

add to that ram prices were dropping rapidly and PC cost too I believe so it's plausible you could easily find second hand machines from business or families upgrading - as a kid I got a bunch of $25 computers to build my first home lab with shortly after this time and ran Linux routing since before we had the gem of a wrt54g most routers were crap.


First Pentium II was released in the middle of 1997. By 1997 the first Pentiums were some 4x outclocked by later Pentiums, but probably not more than 2x slower in real world applications, by no means an obsolete machine. My ~1996 P75 lasted me till about 2002, fun times.


Exactly. So the idea of reusing an old Pentium as a cheap router in the late 90s is plausible.


The entire machine would be still worth hundreds of dollars! Hundreds!


No. Nobody wanted Pentiums from the mid nineties by the end of the decade. Clock frequencies were racing to jump over the 1 GHz barrier.

We produced a lot of electronics trash in the 90s. You bought a computer and two years later you had to replace it. Upgrade paths were also severely limited due to new sockets and chipsets all the time.

It was stressful if you wanted to stay cutting edge with your gaming PC I can tell you.


Yes, and i586 to i686 was a big generational thing. As was 386 and 486 jumps before. The old generations fell to undesirable category pretty fast. Not so much with Pii to Piii and the few following years.

Those were often easy to get and repurpose into servers and gateways for things.

Bad times.


Cutting edge gaming still is, Mom's email/browsing/spreadsheets was and still is fine on a 5 year old machine.


My first Pentium was a 75MHz one bought in 1995's Summer, and yes we bought it on credit.

It served me well until end of 1998, when I replaced it with a 166Mhz one, also bought on credit.


Freesco! I'd forgotten about it completely. It was user friendly, menu driven.


Website is still up with a 2007 copyright and a 2.0.39 kernel on offer.


Was it floppyfw? (0) I used it as firewall ages ago, and if memory serves was the one I moved to a DiskOnModule flash drive to make boot faster and more reliable.

0 - https://www.zelow.no/floppyfw/


https://pupngo.dk/xwinflpy/xwoaf_rebuild.html Check this out, it's a single-floppy linux that includes X11 (!) and a bunch of utilities


Yes, I used this "fli4l" distro from a single, bootable 1.44MB floppy as a Ethernet/DSL NAT gateway in the early 2000s. Consumergrade DSL routers where unheard of (or expensive) so using an old 486 machine with two NICs was more viable. Good memories.


I remember muLinux from circa 1997. Surprisingly, the website is still up[0].

IIRC it was a couple floppies, with an extra one for X11.

It ran w/o issue on 486.

0. http://micheleandreoli.org/public/Software/mulinux/


uClinux has been my bread and butter back in 2010-2012 when I was running it on a mmu-less micro pfga core for an embedded industrial device. I think I brought it down way below the 789kb, at least the bzimage.

I think I was using buildroot to configure and build the kernel and busybox for all the runtime things.

I had to host a dynamic web UI on it, for which I built a custom lua "framework". Lua runtime was a 100k-something static binary that worked like a charm, and very very fast.


Notions of what's "tiny" or "lightweight" have clearly shifted... :-(

Interesting & informative article though.


Definitely has. I sed to love playing with single and double floppy OSes. Im sure you have seen the old qnx4 demo floppy? Full gui, browser, etc.

http://toastytech.com/guis/qnxdemo.html


> I personally found it very difficult to find any good documentation on what this file format really looks like, and really the only useful page I have found on the Internet around it is this page from someone’s personal blog. It’s a bit interesting to think that if this blog goes offline, there really isn’t anything out there left except the actual source code in the Linux codebase, and I’m sure you agree that’s not the most elegant way to learn.

A bit of googling around was able to shore up a bit more information on the bFLT format:

1. The source of the text on the page linked: https://web.archive.org/web/20120301074213/https://retired.b...

2. Notes from someone looking to implement a bFLT loader for homebrew: https://blog.tangrs.id.au/2012/04/07/bflt-format-implementat...


> The uClinux effort, per my understanding, was running independently for some time, before the decision has been made to mainline it, meaning it is now part of the Linux source code itself. Basically, what this means for us is that uClinux is now a set of configurations in the kernel build config, and we’ll get our MMU-less build easily.

Wow! How much of a regular desktop PC userland could I run entirely with a flat shared address space?


Quite interesting. But given it run in qemu I wonder why not develop his https://popovicu.com/posts/making-a-micro-linux-distro/into a more general one and then hightlight this variation in a short article on the difference.


This is cool, but it makes me kind of sad how so much time must be devoted to the build setup and understanding the only available (and poorly documented) executable format. Love the content though.


I thought ucLinux was dead, I had no idea it was mainlined.

Does this mean we can finally have app-capable IoT devices, which for some reason are very uncommon even though it would be rather useful?


I guess you can add isolation using PMP? I can't see any reason why ELFs wouldn't work, except that they are obviously normally built with virtual memory in mind.

Great tutorial anyway, thanks!


I remember full kernel with modules for hardware compiled in was less than that in 2.2.x kernel times.

All else considered the growth isn't much


Has anyone managed to make this work on the inevitable ESP32 (+PSRAM)? This might actually be useful.


This is unreadable.

Please, either indent your paragraphs or else put more space between paragraphs than between lines which are part of the same paragraph. One or the other, or even both. If you do neither it is illegible.


Unreadable? Or perhaps just not to your liking?


I see an extra 20 pixels (specifically 1.25em) between paragraphs. You don't?




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

Search: