133 points · by ingve · 5y ago · 63 comments
Congrats for the work and the front-page, though you seem to live in alternative universe. The last time I checked, a project with ~2250 commits, ~30 contributors, a website and dozens of releases is by no means "small".
Sorry, I never work on any another project so I might lack a point of reference to judge the size of my project.
I wish there was a nice wrapper dedicated to abstracting hardware support better so developers can focus on the interesting parts instead of arguing with wi-fi cards.
Not really; also, the freedom to do something "different" in the device driver space is extremely limited: all you can do is decide on the packaging, kernel space vs. userspace and not much more.
So beyond the low level drivers that directly interact with hardware, an OS differs in how you ... drive the drivers. What your HAL looks like, and then what the abstractions above that look like.
It's by that definition that e.g. Android is considered a different OS from GNU/Linux. Same kernel, but the hardware is exposed much differently to end-user applications.
The NetBSD kernel has the ability to be built as a library, letting various drivers be used in other ways -- it's called a "rump kernel" [0]. I've never played with it myself but my understanding is that this would be sufficient to provide drivers in one's own kernel, given enough plumbing and shims and such.
(With enough shims one could borrow drivers from any kernel -- see ndiswrapper to use Windows network-card drivers in Linux -- but the rump kernel scaffolding is supposed to make it easier.)
[0] https://www.netbsd.org/gallery/presentations/justin/2015_Asi...
The University of Utah had a research project back in the late 1990s which offered exactly that – the OSKit project [0]. A set of libraries for common (at the time) x86 hardware so OS developers and researchers could focus on what was original about their OS instead of writing yet another hard disk or Ethernet driver
Unfortunately, the research project ended circa 2000 and it is dead now. No support for contemporary devices like Wifi and USB. But, if you just want something to run in a VM (QEMU or VirtualBox or whatever) it probably still works.
How was OSkit different?
Linux gives no API stability guarantees for its internal APIs, only for the system call interface. By contrast, the OSKit developers intended the API of each component to be a stable documented interface. The Linux developers don't want Linux's internal APIs to be stable documented interfaces because that has a cost in that it slows down refactoring, which in turn reduces the various benefits that refactoring can produce (better performance, better maintainability, new features, etc)
There is NopSys, about 3500 lines of C and 600 lines of assembler for booting, accessing device registers, and responding to interrupts. So you can write the rest of the OS on top of that. CogNOS is a Smalltalk system written on top of NopSys.
https://github.com/nopsys/nopsys
You bring up wi-fi cards and that is definitely one category of hardware with little standardisation/documentation (I suspect due to FCC regulations and such.) Wired ethernet is a bit better --- Realtek and Intel NICs are both quite well-documented, with the latter being more complex. The other difficult one is GPU acceleration (but a VESA framebuffer is usually available, which gets you at least a GUI if not a fast one.)
Are Linux device drivers not nice enough? Hell, why couldn’t one think, for that matter, of a minimal Linux kernel as some kind of BIOS. Incidentally, we already use it as a hypervisor, so you could probably even include support for the devices you want in the hypervisor itself.
Thinking about it, this is what the BIOS was originally for: to provide a bare minimum abstraction to the hardware. I hoped that UEFI would extend this abstraction in a meaningful way, making OS development easier. Instead it has made it even more complex.
UEFI, sadly, added support for raw x86 option ROMs, to some extent casting us back into the "old" world.
- OO support / modularity
- microkernel
If this decision was made and adhered to early then:
- new drivers could just import and inherit, filling in only the specifics
- new drivers would be self-contained and (hopefully) not affect stability of the system
I guess the problem is that most drivers have already been implemented in C and would require redesign or at least porting.
[0]: https://www.reddit.com/r/osdev/comments/ky7igd/my_handmade_w...
[1]: https://www.youtube.com/watch?v=Za0oHBFr9zo
[2]: https://github.com/skiftOS/skift/blob/main/apps/text-editor/...
[3]: https://github.com/skiftOS/skift/blob/main/libraries/libwidg...
[4]: https://github.com/skiftOS/skift/blob/main/libraries/libwidg...
[5]: https://github.com/skiftOS/skift/tree/main/libraries/libwidg...
Anyway, I will try this OS now! UI looks beautiful.
I don't understand why Apple and Microsoft feel stuck to one OS.
Momentum.
Look at every OS that's on the market right now. It solves a problem. Right now there are very few people who can't pick an OS off the shelf that will solve their particular problem. Be it an RTOS or a fancy gui that your grandma is comfortable with, the software already exists.
I guess what I'm really trying to say is that unless you can upend the current OS landscape while maintaining compatibilty, then a new OS for the masses doesn't solve a problem. It creates one.
You have cause and effect the wrong way there: Windows 10 is in limbo precisely because MS have acknowledged that massive new OS rewrites every few years isn't cost effective. Not because Microsoft can't work out how to ship a new OS. There was a press release about how Windows would adopt a different release cycle around the launch time of Win 10.
> I don't understand why Apple and Microsoft feel stuck to one OS.
I don't understand why you think Apple or Microsoft fragmenting their install base would be a good thing for business.
Writing an OS is a fiddly task to say the least. It's one thing to be motivated to create an OS regardless of language (such as this), vs let's create one to showcase a language. It's harder to recruit people for the latter frankly, and having written OS and kernel code, it's fiddly work that more people talk about then actually enjoy doing it over the long haul.
Also in defense of Redox, I think it has far different goals, rather than getting something up and running with interactivity quickly. SkiftOS is much more "toy"/fun hacking vibe.
Most will avoid using many if any C++ features even if they ostensibly use a C++ compiler, and most OSes I've seen (Linux, Windows, Darwin) have kernels written in explicitly C.
Skift appears (at a very quick glance) to be using more "C++-ish" features than typical, though it's still more "C-ish" than your average C++ code.
Windows has supported kernel code in C++ since Vista, hence why VC++ has the /kernel option on cl.exe.
BeOS, Symbian, ARM mbed, Arduino, IncludeOS, Meadow, GenodeOS for example.
Yes the set of C++ features one uses on the kernel isn't the full language, neither is C when used on the kernel.
skift was ported from C to C++, wich explain why most of the code is still "C-ish". The port was relatively easy thanks to the -Wc++-compat flags
IBM i – probably best known under its original name of OS/400, the operating system of the IBM AS/400. Its lowest layer is called LIC (Licensed Internal Code), and is written in C++. In the beginning, AS/400 used a proprietary CISC processor called IMPI (never publicly documented, but its instruction set apparently resembled somewhat that of IBM 370 mainframes, without being compatible with them.) User applications and higher-level OS components were not written in IMPI, but in a virtual machine bytecode called MI. LIC was responsible for translating MI code into IMPI and providing low level OS services. The LIC was written in a secret PL/I dialect (IBM has a few of those) called PL/MP. As part of the CISC-to-RISC translation, the PL/MP code of the LIC was rewritten in C++. The higher levels of the OS, which run inside the MI virtual machine, are written in a variety of languages – C++, PL/MI (another secret PL/I dialect) and Modula 2.
Sure, people avoid some parts of C++, however there is a reason why they use C++.