So, this weekend I'm playing with Fiwix. Fiwix (https://fiwix.org/) is a small hobbyist operating system for i386 that aims to be Linux 2.0 compatible while being small enough that a single human could understand it as a whole (it's ~30k SLOC, self-hosted, and can be built with tcc).
A couple of years ago Fiwix was used in a fun project of "let's bootstrap a Linux system with only tiny tools that can be understood by a single person": https://github.com/fosslinux/live-bootstrap/blob/master/parts.rst
My refreshed interest in it comes from multiple sources: first, there is now a TCP/IP stack (still WIP). Second, GNU/Linux is *gestures ambiguously* in a strange state, so it is interesting to see how far one could get with a completely non-BSD non-standard tiny, toy-like operating system.
The installation is quite straightforward. "Please keep in mind this kernel is not yet suited for production. Use at your own risk!" is, in itself, a proof of reliability.
This is a beginning of a slow-going🧵
FiwixOS comes with quite a few ports, and will require close to 1GB on a disk. I suppose this is because the packages are not particularly optimised in size. The biggest packages beyond the base and GCC are Python3, Perl, ZX Spectrum emulator and Doom/Heretic.
Also, look at this Halt message, so cute!
The system is small, but functional. At the same time, there are quite a few sharp corners, unfinished and untested things.
The list of packages/ports is small, so I want to bring a few things in. Is it going to be easy? Let's find out!
🧵 cont
The first fun challenge is exchanging files with Fiwix. You see, Fiwix only supports ext2 (3?), Minix, and ISO9600 (CD drives).
My daily driver is (still) MacOS, so I cannot just mount the ext2 partition to send files over. I can create an ISO image with the files, but this is a one-way trip. Would be nice to add the support for FAT16/32 disks to Fiwix, right?
Well! First, I simply created a new CD image with mtools-4.0.49.tar.gz. Fiwix recognised the CD, and I was able to unpack mtools archive. Then I ran `configure`, and then edited a few things here and there (mostly mis-configurations in the config file). Then I ran `make`, and few minutes later I got myself a working set of tools to access FAT-formatted disks. Now I can copy files between Fiwix and MacOS, neat.
🧵 cont
Fiwix understandably misses a few important tools here and there. Having an emulator capable of running different systems would be nice, right?
Qemu is generally quite portable, but DosBox is smaller, and is good enough for running a large chunk of software I might want to run on my system.
FiwixOS has an SDL1.2 port, so compiling DosBox for it was not difficult at all (a couple of patches are still required). I've thrashed around the video card settings a little bit, until I got it mostly working. I need to figure out why the keyboard is buggy, but I can start Windows under Fiwix, and play a game of solitaire.
So, uh, viva FOSS? Great stuff, hobbyists! It is super duper awesome that I can just get a random toy-like OS, and simply compile the stuff I use regularly for it, and it would work. Extra kudos when the toy OS can boot with as little as 8 megs of RAM. Not gigs, megs.
🧵cont?
@nina_kali_nina does that mean the TCP/IP stack isn't in a good enough state to transfer stuff over the network? (Either way, using mtools is a neat idea! My first thought would have been to cat some tar files on a block device like a savage 😂)
@jpetazzo on the TCP/IP stack: I had to use exactly the same technique to build a new kernel with the TCP/IP support. Afaik there's only PPP/SLIP available at the moment, so that would be a very authentic 1990s experience of exchanging patches between the networked computers.
@nina_kali_nina Very neat!
How do the graphics work on fwix? Is this ye olden times Linux 2.x as well? As in, give a root running process access to the VGA and cross your fingers? :)
@hp I believe so :) There's no X port just yet. And while there's no X port yet, maybe I should compile MGR for it...
@jpetazzo on tar: I should've thought about that. XD it seems Fiwix uses non-weird tar, so it should have worked. The only danger is to accidentally overwrite your root partition by using wrong block device...
@nina_kali_nina the docs say there is serial port support. Here's an opportunity to use xmodem and other protocols 😂 (last time I used that was about 30 years ago with HP calculators I think 🤔) - but it'll probably be slower than block device emulation. Keeping subscribed to your thread though, that looks fun! 🤓
@nina_kali_nina Ohhh, that sounds very fitting!
It might not be that hard to run an older xfree86 vesa server, it also expects to just poke at the VGA directly. It should work, theoretically. I think all it really needs from the os is PCI access and a VT. And I think the VT might be optional?
@hp all the necessary parts should be in place, in theory. But having it compiling might not necessarily be trivial for someone who didn't work with old UNIX-like systems day and night in the recent past
@nina_kali_nina maybe I still remember how to do that! I definitely used to install my own x servers from source in the day.
I might be misremembering whether that was or was not a cluster fuck. I'm remembering it as "not that terrible".
I'll see if I can find some time to try! It'd be a fun exercise. If that works maybe...
CDE?
😱
@hp ha ha! Maybe:)
I tried to compile tinyx/Kdrive from sources, but even after bringing a bunch of undocumented dependencies it still refuses to compile. And my emulation speed is akin to Pentium MMX 166, so it's not like I'm super interested in rebuilding a bunch of stuff from scratch until I do something about my rig
@nina_kali_nina I'd probably go with Xfree86 pre-driver, and try XVesa.
I seem to recall the only truly exotic thing it wanted was libpciaccess, which may or may not be vendoered in the older monolithic trees.
@hp good point! I'll try to install an old Linux and see if I can salvage something from it.
@hp @nina_kali_nina XFree is pretty big and bulky if trying to run a tiny system, the small X server done for the ipaq might be a better basepoint and a lot more easy to use.
Bashing the VGA registers was definitely a Linux 2.0 mistake versus using frame buffer interfaces throughout though.
@domi I've been doing it for 25 years now. I'm sure someone who's had OS autism^w special interest for 50 years is capable of much more
@nina_kali_nina holy shit, this is awesome! sad that it doesn't have tts and a tty screenreader, but O well. Now, an interesting thing would be compiling wlroots or another wayland compositor for that OS. The problem is that most of them require modesetting from linux as well as the drm components, but who knows, maybe it's not too far out of the realms of imagination :p
@esoteric_programmer I suspect it might not be that difficult to get a screenreader working for it. It also supports serial TTYs, so it should be possible to login to the system from something that supports tts out of the box
@nina_kali_nina Nina how do you keep finding so many Weird, Cool and Obscure systems :D i’m usually good at this, but you’re on another level, this rules 
@nina_kali_nina this is cool. This is what I want for ubttix. Stability is hard.
@nina_kali_nina espeakup is a kernel module. It doesn't support those, right? maybe telnet?
@esoteric_programmer well, it doesn't, yeah. But maybe a similar one can be added!
@mmu_man Good idea! I think I'll try to get links and something like that working sometime later this week. For now I'm fighting windows
@nina_kali_nina does it support the linux framebuffer?
if so you might be able to run uxn-lfb on it!
@d6 I don't think it does, but the SDL port should work. It's on my to-do list
@nina_kali_nina (that said the input devices might be sufficiently divergent that they won't work properly)
@nina_kali_nina looking at the "to do" list i think maybe it won't work, sadly:
> Improve framebuffer interface with Linux ioctl() commands.
currently uxn-lfb relies on those ioctls
Thanks to help from the Fiwix devs, I have DosBox fully working (no sound, CD or network support yet). I got a bit upset that there's no windowing interface for the OS (yet), so I ported Bellcore MGR to Fiwix. It's half-baked, but it works.
If you never heard about MGR, it's an X competitor and a terminal multiplexer with graphics.
Here's my post about it: https://www.ninakalinina.com/notes/mgr/
@nina_kali_nina Do I read your article to see that the software in the screenshot is from 1984? If so, fascinating to see it even includes the “root weave” X Window System stipple (I did some detective work on this visual design and thought it arrived somewhat later in the 1980s).
@matt well, the MGR was created in the early 80s, but this particular distribution is based on a version from Usenet from 1989. It is possible that it was back-ported from X by then
@jarkko Thanks for sharing! Well, tbh, old compilers produce predictable code :) But it is really neat to have something that isn't GCC 3.3 or OW for DOS.
@nina_kali_nina I find all of your posts fascinating, though I don't understand any of it (like a language I have no idea about) But I love seeing people who are good at fixing things and are great at it (like The Repair Shop on BBC) and you really enjoy the challenge! I feel like a boring dinosaur in a tech world 
@Aspiedan Thanks, I really appreciate the feedback! If you have any questions, feel free to leave comments with "Explaint to me Like I'm Five" (ELI5) and I'll do my best to explain :)
@nina_kali_nina I am mildly curious to know if my nvi fork will work on fiwix. https://git.sr.ht/~drj/nvi2
I might give it a go on Tuesday (if you're not tempted by then).
@drj enjoy~ I'll plan to bring more desktop stuff to Fiwix and send a few PRs to the OS as my priority for now
MGR is *beautiful*. Back in 1996 on a machine with..not very much RAM…MGR was pleasantly usable.
@rk I think here on Fiwix it should be useable on a 486 with 8 megs; gotta try it out
@nina_kali_nina maybe it would also be possible to get twin going for something with windowing: https://github.com/cosmos72/twin
MGR seems a lot fancier though :)
How is the hardware support of Fiwix? I don't know if DOSBox can do any device pass-through, DOSEMU(2) does have some support for that so you could possibly use hardware that lacks Fiwix drivers but does have DOS drivers.
@jschwart I think twin should work with minimal changes. Thanks for sharing the link, I'll try it out if I have time
@Etch9 well, it is, to a large extent, controlled by corporations that do not have our best interests in mind.
@jarkko @nina_kali_nina Hard agree on DOSBox Staging. Much improved over the "vanilla" version.
@thelastpsion @jarkko it is going to be much more difficult to port, though. It won't be a two line patch for sure...
@nina_kali_nina @jarkko Ah, yeah, that's a good point. And it'd probably be just as painful to cherry-pick patches, too.
@nina_kali_nina
i see! well thats true but i do find myself more in the middle on these kinds of matters, i dont like the linux fundation at all and i hate the oss foundation for their stance on ai weights but i do trust torvalds and the companies are a big reason the linux kernel is this perfomant and the defacto standard
@Etch9 I think even if you're moderate on such issues, you could see benefit in having fun :)
@nina_kali_nina
Hmm, I wonder if Fiwix has 9P support. It would make working in a VM easier (QEMU supports 9P for shared folders)
@kirtai I seriously doubt that :) but if it can be compiled with C in userland, it can be done
@jarkko neat :) booting up from real mode is a special, fun exercise in a certain meaning of the word
I took a moment to package the binaries for MGR - https://github.com/mikaku/FiwixOS/issues/2
The port is dirty/incomplete because there's probably two people out there who would want to try it out, and both of us are better off starting it from scratch
@nina_kali_nina I would _want_ to try it out. Intrigued by MGR ever since a friend demo'd it to me on his Atari ST (1040, more powerful than mine) around 1989. Didn't know it was MGR until at least decade later.
@drj an easier to use distribution is Debian 0.93+MGR on 86Box with Mouse Systems driver. I've uploaded ready-to-use HDD image a while ago: https://archive.org/details/bellcore-mgr-debian0.93
It is superior in a way that I've compiled most of the clients there, including the ghostscript viewer
Adding new software to Fiwix isn't all that difficult. Here's a PR I made for mtools, a userland FAT12/16/32 tooling: https://github.com/mikaku/FiwixOS/pull/4
The DOSBox 0.74 is merged already, so it should be there with the next release in November :) If you want staging or dosbox-x, you're free to take a stab at it~
yes it is still a 🧵
FiwixOS only has SDL1.2, and I wasn't sure whether new Grafx2 supports it, so I chose a release from definitely-pre-SDL2 and, well, simply compiled it. I had to tweak the makefile because some of the required libraries were not where the make expected them to be. It is great to have truly portable software. Great job, @pulkomandy and the Grafx2 team :)
@nina_kali_nina GrafX2 still supports SDL1.2 in the latest versions. You can configure that with a variable in the Makefile Let me know if there are any other problems with porting it!
@pulkomandy neat~ I'll try the latest version tomorrow, then! Thanks!
@nina_kali_nina I plan to continue supporting it until SDL2 (or 3?) gets ported to all the platforms that have SDL1.2 (probably forever, because some of these platforms are dead)
So, did I mention that the developer of FiwixOS is currently working on bringing the networking to the OS? I am really looking forward to it, so in the meantime I'm doing what I can to help out.
Years ago I touched Netsurf browser (https://www.netsurf-browser.org/) and tangentially helped with its ports to obscure platforms. It was a pleasure to discover that it is still as snippy, powerful and portable as it was back then.
Yep, you're reading it right, I compiled a web browser to FiwixOS. Funny how Netsurf got to Fiwix before links2 did.
The networking part is still not working, but it should be easy to add when a port of libcurl will be completed.
(it is a part of a 🧵 about Fiwix OS, tiny UNIX-like OS made mostly by a single developer and so can be understood by a single person, too)
Speaking of Netsurf, it really is an under-appreciated browser. To me it feels kind of like Lagrange browser for Gemini, but for decent Web 1.0+ HTML with HTML5, CSS and SVG. This is a great browser for small web.
@hp random chaotic stuff, I just compiled Netsurf for this thing. I feel maybe I should make libSDL backend targeting MGR...
@nina_kali_nina lol, that would be pretty great!
Does MGR support any kind of color besides yellow? Is it all one bit?
@hp even if it was 1bpp, it would be nice to have links -g in MGR...
@nina_kali_nina yes! I was just wondering about an SDL port.
But 8bpp is enough for a useful SDL. You can probably play quite a lot of games with that.
How does MGR manage palettes?
@nina_kali_nina oh, you had me at the Lagrange comparison, I'll have to check it out now!