5 ms·
Just curious how hard it would be to forego POSIX entirely if you were building an OS. I know TempleOS is entirely from scratch. I'd like to implement a small L
by eggy 5y ago
Just curious how hard it would be to forego POSIX entirely if you were building an OS. I know TempleOS is entirely from scratch. I'd like to implement a small LISP like SectorLISP [1] (see yesterday's posts too on HN). I don't know much about building my own OS, so I'd like to start with something like MenuetOS (my first PL was asm), SerenityOS, TempleOS, or this one. I'd like it to be completely an 'island', i.e. POSIX not a requirement. I want to use it to hack on in isolation without any easy copy/paste shortcuts. I know Mezzano exists, and it has booted on bare metal, but I would like to start with the OS's above, implement my own LISP, and go from there.
Any other OS recommendations base on my ignorant, but wishful, reqs above? I realize there are some others in Rust too. Thanks!
[1] https://github.com/jart/sectorlisp https://github.com/jart/sectorlisp
- adrian_b 5y agoSomeone who would make a new OS, should define a completely new system call interface, as it is likely that now it is possible to conceive a better interface than 50 years ago and anyway if it would not be different there would be no reason to make a new OS, instead of modifying an existing one. Nevertheless, the first thing after defining a new OS interface must be writing a POSIX API translation layer, to be able to use without modifications the huge number of already existing programs. Writing a new OS is enough work, nobody would have time to also write file systems, compilers, a shell, a text editor, an Internet browser and so on. After having a usable environment, one can write whatever new program is desired, which would use the new native OS interface, but it would not be possible to replace everything at the same time. Besides having a POSIX translation layer, which can be written using as a starting point one of the standard C libraries, where the system calls must be replaced with the translation layer, some method must be found for reusing device drivers made for other operating systems, e.g. either for Linux or for one of the *BSD systems. Nobody would have time to also write all the needed device drivers. So there must exist some translation layer also for device drivers, maybe by running them in a virtual machine. The same as for user applications, if there is special interest in a certain device driver, it should be rewritten for the new OS, but rewriting all the device drivers that could be needed would take years, so it is important to implement a way to reuse the existing device drivers.
- md8z 5y agoAt that point, why not just contribute to Linux?
- spicybright 5y ago> Writing a new OS is enough work, nobody would have time to also write file systems, compilers, a shell, a text editor, an Internet browser and so on. > So there must exist some translation layer also for device drivers, maybe by running them in a virtual machine. > ... but rewriting all the device drivers that could be needed would take years, so it is important to implement a way to reuse the existing device drivers. I'd think most people making a hobby OS specifically want to do these things. I also think most don't care about wide hardware compatibility.
- adrian_b 5y agoEven if you do not want the new OS to run on anything else but your own laptop, that still needs a huge amount of drivers, for PCIe, USB, Ethernet, WiFi, Bluetooth, TCP/IP, NVME, keyboard / mouse / trackpad, sound, GPU, sensors, power management, ACPI and so on. The volume of work for rewriting all these is many times larger than writing from scratch all the core of a new OS. Rewriting them requires studying a huge amount of documentation and making experiments for the cases that are not clear. Most of this work is unlikely to present much interest for someone who wants to create an original OS, so avoiding most of it is the more likely way leading to a usable OS.
- spicybright 5y agoI think you're still missing the point here. Not every hobby OS needs or even wants networking, gpu support, even storage I/O, etc. See TempleOS. The goal typically isn't to make a fully featured OS.
- adrian_b 5y agoIf you do not want those features, that means that the OS is not intended to be used on a personal computer, but only on an embedded computer. For dedicated embedded computers, the purpose for an OS becomes completely different and compatibility with anything does not matter any more. Not only personal computers cannot be used without a huge amount of device drivers, but even for a very simple server, e.g. an Internet gateway/router/firewall or a NAS server, the amount of work for writing the device drivers, the file systems and the networking part would be much more work than writing the core of a new OS. Only for embedded computers the work needed for device drivers can be smaller than for the base operating system.
- a-dub 5y agoredox is one i've been following from afar. rust, not posix, microkernel, s/everything is a file/everything is a url/ it looks pretty cool, although the url thing seems yet to prove its utility. they seem to be playing around a bit with using the protocol component (net, disk, etc), but it's unclear what this adds over just using paths. although maybe if they used the protocol to describe the encoding of the data, it would add something?