←back to thread

521 points OlympicMarmoto | 5 comments | | HN request time: 0.728s | source
Show context
jnwatson ◴[] No.45067216[source]
I've written a lot of low level software, BSPs, and most of an OS, and the main reason to not write your own OS these days is silicon vendors. Back in the day, they would provide you a spec detailed enough that you could feasibly write your own drivers.

These days, you get a medium-level description and a Linux driver of questionable quality. Part of this is just laziness, but mostly this is a function of complexity. Modern hardware is just so complicated it would take a long time to completely document, and even longer to write a driver for.

replies(13): >>45067491 #>>45069282 #>>45069287 #>>45069349 #>>45069690 #>>45070345 #>>45071036 #>>45071086 #>>45072259 #>>45072391 #>>45073789 #>>45075476 #>>45081942 #
1. Joker_vD ◴[] No.45072391[source]
> Modern hardware is just so complicated it would take a long time to completely document, and even longer to write a driver for.

You know, one'd think that having a complex hardware should make writing a driver easier because the hardware is able to take care of itself just fine, and provide a reasonable interface, as opposed to devices of the yore which you had to babysit, wasting your main CPU's time, and doing silly stuff like sending them two identical initialization commands with 30 to 50 microseconds delay between or whatever.

replies(1): >>45072424 #
2. IshKebab ◴[] No.45072424[source]
No, the complexity usually isn't hidden. It's the driver's job to do that.

I guess one exception maybe is Nvidia who have sort of hidden the complexity by moving most driver functionality onto software on the card. At least that's how I understood it. Don't quote me on that.

replies(3): >>45072457 #>>45073285 #>>45090707 #
3. Joker_vD ◴[] No.45072457[source]
> No, the complexity usually isn't hidden. It's the driver's job to do that.

Why not, though? We used to have e.g. glass teletypes with microprocessors (8080/8051) in them that exposed a serial bus with very neat command protocol that we still use nowadays, that could boot up, init and self-test all on their own.

4. saagarjha ◴[] No.45073285[source]
Yes, and then you get odd behavior you can't introspect because the card is a black box to you.
5. account42 ◴[] No.45090707[source]
In some cases it is hidden though. USB has a lot of "generic" device classes where (at least in theory) the OS only needs to deal with a standardized interface and whatever actual hardware is behind it is driven by an embedded controller.

It's just that most internal hardware initially only cares only about Windows (or only Linux) so it makes more financial sense to develop a more complex driver than a complex firmware. The equation might change later on but by then you are stuck with the hardware design.