←back to thread

521 points OlympicMarmoto | 2 comments | | HN request time: 0s | 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 #
dist1ll ◴[] No.45070345[source]
Intel still does it. As far as I can see they're the only player in town that provide open, detailed documentation for their high-speed NICs [0]. You can actually write a driver for their 100Gb cards from scratch using their datasheet. Most other vendors would either (1) ignore you, (2) make you sign an NDA or (3) refer you to their poorly documented Linux/BSD driver.

Not sure what the situation is for other hardware like NVMe SSDs.

[0] 2750 page datasheet for the e810 Ethernet controller https://www.intel.com/content/www/us/en/content-details/6138...

replies(4): >>45070705 #>>45071380 #>>45072199 #>>45076796 #
throwaway2037 ◴[] No.45072199[source]
Wow... that PDF is 2,750 pages! There must be an army of technical writers behind it. That is an incredible technical achievement.

Real question: Why do you think Intel does this? Does it guarantee a very strong foothold into data center NICs? I am sure competitors would argue two different angles: (1) this PDF shares too much info; some should be hidden behind an NDA, (2) it's too hard to write (and maintain) this PDF.

replies(9): >>45072325 #>>45072561 #>>45072665 #>>45073187 #>>45073195 #>>45073339 #>>45075185 #>>45076049 #>>45076880 #
pjjpo ◴[] No.45072325[source]
In terms of (2), I wonder if it's even possible to write a driver without such a document. In the end, the vendor is on the foot for the driver for major platforms (let's assume Linux) - if they can write a Linux driver without a similar spec to this doc, then the doc probably doesn't need to exist since the business wins from hobbyist drivers will be low. If they can't though, then it's just a matter of formatting an internal document for public consumption - the doc itself has to be maintained anyways so the cost seems lower and maybe reasonable. I have a feeling the doc is necessary but I am not specialized in the field.

Assumptions, fair or not, about (1) seems more likely somehow.

replies(1): >>45072752 #
ch33zer ◴[] No.45072752[source]
Didn't all the asahi Linux Mac m1 drivers essentially get reverse engineered with little to no support from apple and no public docs? If I'm remembering correctly then I guess it's possible with enough effort and reverse engineering skills
replies(2): >>45073073 #>>45073987 #
stefan_ ◴[] No.45073987[source]
It was reverse engineered from a driver. With no driver and purely some PCIE device registers mapped into memory you might as well be trying to guess lottery numbers.
replies(1): >>45074953 #
ch33zer ◴[] No.45074953[source]
I guess the driver was the one that runs on Mac that they were able to refer to? Not sure you have any links to blog posts about this process it sounds so cool
replies(1): >>45075548 #
1. morganw ◴[] No.45075548[source]
From https://news.ycombinator.com/item?id=39385382 Here's Hector Martin (marcan) talking about their tooling: https://asahilinux.org/2021/08/progress-report-august-2021/

Running macOS in a hypervisor controlled from a second machine (proxy mode + verbose==on) to watch drivers talk to the hardware:

https://asahilinux.org/docs/sw/m1n1-user-guide/#running-a-ma...

replies(1): >>45082055 #
2. ch33zer ◴[] No.45082055[source]
Thanks for taking the time to round up these posts for me!