A completely-from-scratch hobby operating system
61–70 of 79 posts
Re: A completely-from-scratch hobby operating system
#62Earlier quoted context omitted.
And why in the heck didnt he write it in Rust! ...
At least he didn't write it in node.js /s Other interesting alternatives to c or rust might be vlang or zig.
Re: A completely-from-scratch hobby operating system
#63How this compares with xv6 for first OS course purpose? Is it viable to use this to teach the same things? (Paging, inter process communication, threading...)
Re: A completely-from-scratch hobby operating system
#64Re: A completely-from-scratch hobby operating system
#65Earlier quoted context omitted.
And why in the heck didnt he write it in Rust! ...
At least he didn't write it in node.js /s Other interesting alternatives to c or rust might be vlang or zig.
Re: A completely-from-scratch hobby operating system
#66How this compares with xv6 for first OS course purpose? Is it viable to use this to teach the same things? (Paging, inter process communication, threading...)
My intended audience is hobbyists who are looking for a reference for writing their own OS - the sort of people we often find on osdev.org, or the #osdev channel on Libera, who have stumbled through an old tutorial on x86 bring-up and want some example of how "the next steps" work.
Re: A completely-from-scratch hobby operating system
#67Earlier quoted context omitted.
Someone 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 t…
> 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. I disagree. POSIX sucks. Build a hypervisor so people can run their applications in a VM and insist that native programs use the non-garbage API. It's the only way you'll ever unshackle yourself.
If you do all your normal work in a virtual machine, what will you use your new OS for?
Writing any useful application program in a complete void, without standard libraries and utilities, would take a very long time and unless it is something extremely self contained it would not be as useful as when it can exchange data with other programs.
It is much easier to first write a new foundation, i.e. the new OS, with whatever novel ideas you might have for managing memory, threads, security and time, and then start to use the foundation with the existing programs, hopefully already having some benefit from whatever you thought you can improve in an OS (e.g. your new OS might be impossible to crash, which is not the case with any of the popular OSes), and then replace one by one the programs that happen to be important for you and that can benefit the most from whatever is different in the new OS.
For the vast majority of programs that you might need from time to time it is likely that it would never be worthwhile to rewrite them to use the native interfaces of the new OS, but nonetheless you will be able to use them directly, without having to use complicated ways to share the file systems, the clipboard, the displays and whatever else is needed with the programs run in a virtual machine.
Implementing some good methods for seamless sharing of data between 2 virtual machines, to be able to use together some programs for the new OS with some programs run e.g. in a Linux VM, is significantly more difficult than implementing a POSIX translation layer enabling the C standard library and other similar libraries to work on the new OS in the same way as on a POSIX system.
Re: A completely-from-scratch hobby operating system
#68Earlier quoted context omitted.
I wouldn't say I "own" that channel in any respect, I'm just responsible for dragging it over from Freenode during the exodus... we've got the same same staff as we did before the move and I'm not even the "founder" according to ChanServ.
Just to clarify: are you active/a mod in that channel? Now I’m curious how the GP got the idea you own it.
Re: A completely-from-scratch hobby operating system
#69Earlier quoted context omitted.
> 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. I disagree. POSIX sucks. Build a hypervisor so people can run their applications in a VM and insist that native programs use the non-garbage API. It's the only way you'll ever unshackle yourself.
The point of writing a new OS is to use it, otherwise you do not get any of its supposed benefits. If you do all your normal work in a virtual machine, what will you use your new OS for? Writing any useful application program in a complete void, without standard libraries and utilities, would take a very long time and unless it is something extremely self contained it would not be as useful as when it can exchange da…
You write replacements for or properly port your every-day workflow to the new OS. You already wrote a whole new OS for some reason even though there are hundreds to choose from, presumably there is value in replacing your tools to take advantage of whatever you put all that effort into or else why bother? The VM is for things you haven't ported yet or less important workflows.
Besides, people run windows and do all their work in WSL all the time.
> Writing any useful application program in a complete void, without standard libraries and utilities, would take a very long time [...]
So does writing an OS and you've already decided that was worth the effort, yet you balk at rewriting some commandline utilities[0] and a standard library? Please.
> It is much easier to first write a new foundation [...] then start to use the foundation with the existing programs [...] and then replace one by one the programs that happen to be important for you and that can benefit the most from whatever is different in the new OS.
Any reason not to just do that with a VM? Forcing POSIX compatibility into your OS is going to constrain your choices (not to mention your thinking) to the point that you'd probably be better off just modifying an existing OS anyway.
> For the vast majority of programs that you might need from time to time it is likely that it would never be worthwhile to rewrite them to use the native interfaces of the new OS, but nonetheless you will be able to use them directly, without having to use complicated ways to share the file systems, the clipboard, the displays and whatever else is needed with the programs run in a virtual machine.
A: it isn't that complicated. B: if you can use them so directly without having to deal with the separation provided by a VM, it's likely you didn't improve their security situation anyway. Again, why not just modify an existing POSIX OS in this case?
> Implementing some good methods for seamless sharing of data between 2 virtual machines, to be able to use together some programs for the new OS with some programs run e.g. in a Linux VM, is significantly more difficult than implementing a POSIX translation layer enabling the C standard library and other similar libraries to work on the new OS in the same way as on a POSIX system.
I doubt it is as hard as, say, writing a brand new OS that's actually in some way useful. Why go through the effort of the latter only to throw away a bunch of potential by shackling yourself with a set of barely-followed standards from the 1970s?
[0] POSIX does nothing to help you with anything GUI.
Re: A completely-from-scratch hobby operating system
#70Earlier quoted context omitted.
> 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 drive…
Even 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 a…
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.