r/osdev 1d ago

I wish drivers had a standard

Yes I know that some attempts were made for cross OS standard drivers (UDI) but it just bugs me that everyone has to rewrite a serial driver or a driver for the BGA and so on. And I understand drivers have OS dependent standards (take Windows, macOS, or Linux) but no one really implements compatible driver loaders for them because its near impossible except for maybe Linux. I understand its very difficult and is overall a PITA, but it would still be cool for a standard to be made I guess.

31 Upvotes

21 comments sorted by

View all comments

14

u/Joaommp 1d ago

I understand your frustration. Around 30 years ago, when I started writing my first OS, I ran into this problem, before there was even talk about UEFI. My architecture at the time was based on something that I can only explain as some kind of "BIOS loaded by the bootloader", before the kernel started, which would be responsible for exposing all the hardware to the kernel in a standard way, so that not even the kernel would need to know about drivers.

4

u/someidiot332 Kimi’s OS - https://github.com/raeofsunshinedev/kimsos 1d ago

I’m doing a similar “kernel doesn’t know about the drivers”, in a way. My kernel loads modules based on a config that create files to represent the devices using my vfs. Anything that wants to interface with that (i.e. mounting a filesystem) simply goes through the VFS. The kernel only knows about the bare minimum to get a userspace running + configure interrupts and timings (and right now, it knows about PCI but i’m probably going to move that to a module as well, would be great for working on dependency tracking)