kragen 3 days ago

fiwix is a crucial part of bootstrapping the modern software environment from a small enough 'seed' binary that you can hand-verify the binary; it's a kernel that you can compile without a kernel to run the compiler on. as such, its importance goes far beyond the hobby project its unassuming readme paints it as

  • yjftsjthsd-h 3 days ago

    Can it do a (cross-?)compile of Linux and enough userland to bootstrap up to a Linux system? I see that it says gcc 4.7 so I'd guess that it should be possible, but I'm curious if anyone's actually done it.

    • ryan77627 3 days ago

      I believe so! I did some messing around with the whole "bootstrappable" suite of repos a few months ago and I remember there was a repo [1] that automated the chain of bootstrapping from a project known as hex0 to Linux 4.9 (iirc) inside qemu using fiwix as an intermediary. I didn't have the time to experiment past running it and verifying it works (it did, took my poor laptop around 10 or so hours to run from start to finish), but I presume I would have been able to compile the latest versions of GCC and Linux from the final state of the VM it made. I may still have the image it made lying around somewhere.

      [1]: https://github.com/fosslinux/live-bootstrap

      • yjftsjthsd-h 3 days ago

        I agree that it's sufficient to bootstrap to an older Linux-based system, since the path from there to a full modern system is well-trodden. That's very cool then, thanks for the link:)

    • kragen 3 days ago

      yeah, i'm pretty sure that's working, though i've been out of touch with the live-bootstrap project for a few months

rurban 3 days ago

I wonder why you want POSIX compatibility when you start a new OS from scratch. All this broken and weird stuff, like signals, buffered synchronous IO, strings, locale, ... can be written in a functional, safe and modern way, enabling safety and performance, which is just not possible with POSIX.

  • alganet 3 days ago

      1. You want to run POSIX-compatible software in a context that existing kernels won't support.
      2. You want to understand how POSIX works.
      3. You want to write a kernel but not design it, and POSIX offers plenty of references.
      4. You want to optimize something about POSIX implementations and needs a bottom-up approach.
    
    There are plenty of valid reasons.
  • dlachausse 3 days ago

    I think a lot of it is availability of software. If you support enough POSIX things compile with minimal patches.

    • userbinator 3 days ago

      If you're going purely for availability of software, then the Win32 API would probably be a good target, but it's much bigger than POSIX (largely due to including GUI features.)

      • jeroenhd 2 days ago

        With how little even projects like Wine cover, I don't think full coverage of the Windows API is happening. You could target an older subset (3.1, 9x) but then you'd probably also need to implement fake DOS behaviour and weird hardware to get many applications to run.

      • shiomiru 3 days ago

        Wouldn't you need ABI compatibility too? POSIX stuff is normally available in a source form, but that's much more rare in Win32 stuff.

        The good thing about POSIX is that you can theoretically port wine too at some point, and then you get both. (Though I am aware that this is not very easy either, would be interested in the opinion of somebody with wine porting experience.)

    • rurban 3 days ago

      It's better to write everything from scratch when the foundation is broken. Look at the lisp machine or Concurrent PASCAL. These systems were insanely small

      • dmitrygr 3 days ago

        I look forward to the kernel, user space, compilers, and web browser you will author from scratch

        • kragen 2 days ago

          you're about halfway there yourself, as i recall

          it's an appealing project, and i think there's potential to do better than posix, but it's easier to do worse

      • hnlmorg 3 days ago

        They’re also insanely old. Plus the entire reason for Unix was because it was smaller and simpler than Multics.

        I do get your sentiment though. But it’s an unrealistic ask. Particularly for a hobby project.

      • kelnos 3 days ago

        Better is subjective. And if I were to take on a hobby kernel project, I might not have the time or energy to also write my own compiler, shell, basic utilities, windowing system, browser, etc. from scratch.

      • kragen 2 days ago

        genera is kind of big actually (fiwix is only 50kloc, and some of that is the fault of the hardware), but there were a lot of different lisp machines. which ones do you mean? do you have one running (presumably in emulation)?

        • amszmidt 2 days ago

          Genera is quite a bit larger than that, the rel-8-5 tree is 1.2 MLOC (though this includes other things, like Pascal, Fortran and a C compiler).

          But even if we take the MIT Lisp Machine system, which is smaller, it is still 450 KLOC. Just the microcode that implements the Lisp Machine on the CADR around 25 KLOC.

          The Lisp Machine system is also _very_ complicated under the hood when it comes to the core system, and one of the reasons why Unix succeeded.

          It is also a system that is a total PITA to modify in incompatible ways, since you are always modifying the running system. There is no such thing as an executable file in the same sense as on Unix that you can copy and keep around, e.g. if you modify the compiler on Unix you can easily keep a backup copy of 'cc' and keep running that when you screw up.

          On the Lisp Machine you can't keep two compilers around at the same time without essentially creating a fork of it with all new names (and even then it might not work).

          • kragen 2 days ago

            i greatly appreciate your very informed opinion!

        • kragen 2 days ago

          (admittedly newlib is about 350kloc)

  • screcth 2 days ago

    Because an OS is useless without applications that run on it and POSIX compatibility means that existing software can be ported to it with minimal changes.

    If it had a custom interface, then porting large projects would be an enormous undertaking.

  • benchloftbrunch a day ago

    I too am curious about the, imo, overemphasis on Unix clones in research and hobbyist OS development.

    All the shenanigans with modern Windows aside, I am genuinely a fan of NT's design, think it does several things better than POSIX and Linux in particular (notably, the things you mentioned, plus anything to do with device drivers) and wish the open source OS world took more inspiration from it.

    Yeah I know ReactOS exists, but it's held back by its lofty goal of being a complete, bug for bug compatible Windows clone with full Win32 userland, when I'd be happy with just an open source NT-like kernel.

  • kragen 2 days ago

    this is relevant to my interests! where can i read about the design you favor?

justanother 2 days ago

Not sure if this was intended, but in Belizean creole, "Fi Wi" (pronounced "fee wee", not like WiFi) means "ours" or "for us." Good name for an MIT-licensed kernel project.

userbinator 3 days ago

"Unix-like kernel for the i386 architecture" is exactly what Linux started out as. Good to see others following in Torvalds' footsteps.

  • f1shy 3 days ago

    Should we say AST steps?!

    • kragen 2 days ago

      minix didn't start out on the i386

notorandit 3 days ago

Looks somehow similar to Minix.

I like the idea of people tinkering with os stuff.

giantrobot 3 days ago

...it won't be big and professional like HURD.

dajtxx 3 days ago

Very impressive!