For those who don't remember, Russinovich prior to taking over his boss' job and possible succession as the next MSFT CEO, he owned a software tools and NT kernel consulting company where Redmond sent their engineers to learn NT kernel dev. Also, he found Sony's DRM rootkit, Symantec's rootkit-like file protection, and caught Best Buy pirating ERD Commander.
I'm kind of kicking myself now that I nuked my LinkedIn in 2014 having 2 degrees from the whole Valley and Mark as 1st. Oh well, there's freedom and agility in relative obscurity. What's that reggae song by Desmond Dekker about it's pointless to talk about how much you did, made, or who you used to know? xD
> he owned a software tools and NT kernel consulting company where Redmond sent their engineers to learn NT kernel dev.
Apple apparently used to do something similar, internal Apple Docs were nothing compared to Jonathan Levin's books[1], so Apple would routinely buy those for their OS engineers.
It's pretty interesting to me that companies of that size can't really do these things themselves, despite being in a much better position by having access to the engineers actual source code. These third parties (or at least Levin) had to rely on reverse-engineering to a large degree.
How can you mention him and not mention sysinternals? I rely on that suite to do my job every day! Sysinternals have had more of an impact than perhaps even Azure itself considering how basically every company using windows in the world uses at least one sysinternals tool.
The sysinternals tools should be part of any windows installation. They are a must in mine.and are sorely missed whenever I need to fix/debug a friends computer. why else did MSFT acquihire them/Mark Russinovich?
Almost all of those refer back to FFI integer types, because that's what the Windows driver API uses. The Linux kernel has similar issues when it comes to writing Rust drivers, and so does every other project interoperating with C.
Types like NTSTATUS have a significant amount of documentation attached to it. Unlike C and C++, you can't just assign an integer value to an enum value. I suppose they could've generated a wrapper class and required you to cast every time, but then you'd get code that's 50% .into()s and that would probably add overhead to your driver as well.
As far as I can tell, you never set or alter these enum values, other than maybe the void* for buffer; you only ever read from them. A match {} block should work just fine on NTSTATUS. WDFREQUEST is a handle, so you can't really do anything with it other than maybe swap it out for another handle of the same type.
Timer and SpinLock have been converted into idiomatic Rust objects, wrapping unsafe library calls in their bodies. Other than that, I don't really see how you'd make this code idiomatic without adding a significant performance burden.
Microsoft is pushing more and more code into user space. The latest change is that they now insist printer manufacturers use UWP printer apps rather than drivers to add custom functionality to their printers; these apps are usually written in languages like C#.
I agree with Microsoft that the best method is probably to run less manufacturer code in the kernel, not to make the kernel accessible more easily. Running a garbage collector in the kernel sounds near impossible to pull off without GC bugs because C# isn't exactly suited for "I want to access some buffer but I can't because it hasn't been paged in and I'm in an interrupt handler".
Would that be better though? I have no experience of driver development by my feeling is that device drivers being low-level and fundamental building blocks of a working operating system, doesn't fit well with garbage collection interrupting execution on its own schedule.
Microsoft tried that already. It failed miserably. I don't think they gave a reason but I suspect that garbage collection caused too many freezes in early 2000s hardware.
It is very difficult to write device drivers in even C++ while still maintaining the ability to write pageable kernel drivers. Drivers must have very strict control over availability of memory because it will likely access it at times when a page fault is not possible (i.e. during an interrupt handler). The C# language and runtime would have to add features to explicitly accomodate this at a bare minimum
I'm not aware that C# has security or reliability advantages over Rust. It may be better integrated into the Microsoft ecosystem but from the point of view of a driver developer who has to support more than one OS, Rust would seem to be a good tradeoff between security, performance, and reliability vs. C/C++.
[+] [-] 1letterunixname|2 years ago|reply
I'm kind of kicking myself now that I nuked my LinkedIn in 2014 having 2 degrees from the whole Valley and Mark as 1st. Oh well, there's freedom and agility in relative obscurity. What's that reggae song by Desmond Dekker about it's pointless to talk about how much you did, made, or who you used to know? xD
[+] [-] miki123211|2 years ago|reply
Apple apparently used to do something similar, internal Apple Docs were nothing compared to Jonathan Levin's books[1], so Apple would routinely buy those for their OS engineers.
It's pretty interesting to me that companies of that size can't really do these things themselves, despite being in a much better position by having access to the engineers actual source code. These third parties (or at least Levin) had to rely on reverse-engineering to a large degree.
[1] https://newosxbook.com
[+] [-] badrabbit|2 years ago|reply
[+] [-] taskforcegemini|2 years ago|reply
[+] [-] kramerger|2 years ago|reply
My take from the first book was that he has an extremly black and white view of the world.
[+] [-] kleiba|2 years ago|reply
[+] [-] drvdevd|2 years ago|reply
[+] [-] tester756|2 years ago|reply
wat
[+] [-] pgporada|2 years ago|reply
[+] [-] ww520|2 years ago|reply
[+] [-] sn9|2 years ago|reply
I'm having trouble parsing this. What does this mean?
[+] [-] jjallen|2 years ago|reply
[+] [-] mustache_kimono|2 years ago|reply
[+] [-] 38|2 years ago|reply
http://farside.link/twitter.com/markrussinovich/status/17057...
[+] [-] zamalek|2 years ago|reply
[+] [-] jeroenhd|2 years ago|reply
Types like NTSTATUS have a significant amount of documentation attached to it. Unlike C and C++, you can't just assign an integer value to an enum value. I suppose they could've generated a wrapper class and required you to cast every time, but then you'd get code that's 50% .into()s and that would probably add overhead to your driver as well.
As far as I can tell, you never set or alter these enum values, other than maybe the void* for buffer; you only ever read from them. A match {} block should work just fine on NTSTATUS. WDFREQUEST is a handle, so you can't really do anything with it other than maybe swap it out for another handle of the same type.
Timer and SpinLock have been converted into idiomatic Rust objects, wrapping unsafe library calls in their bodies. Other than that, I don't really see how you'd make this code idiomatic without adding a significant performance burden.
[+] [-] BaculumMeumEst|2 years ago|reply
[+] [-] kramerger|2 years ago|reply
[+] [-] IshKebab|2 years ago|reply
[+] [-] unknown|2 years ago|reply
[deleted]
[+] [-] meresahkaan|2 years ago|reply
[deleted]
[+] [-] fortran77|2 years ago|reply
[+] [-] jeroenhd|2 years ago|reply
I agree with Microsoft that the best method is probably to run less manufacturer code in the kernel, not to make the kernel accessible more easily. Running a garbage collector in the kernel sounds near impossible to pull off without GC bugs because C# isn't exactly suited for "I want to access some buffer but I can't because it hasn't been paged in and I'm in an interrupt handler".
[+] [-] danparsonson|2 years ago|reply
[+] [-] ndiddy|2 years ago|reply
[+] [-] CodeCompost|2 years ago|reply
[+] [-] anaisbetts|2 years ago|reply
[+] [-] MStrehovsky|2 years ago|reply
[1] https://github.com/VollRagm/KernelSharp
[+] [-] nextaccountic|2 years ago|reply
Indeed pretty much no mainstream language prevents data races at compile time like Rust does
[+] [-] dataking|2 years ago|reply
[+] [-] __jem|2 years ago|reply
[+] [-] j16sdiz|2 years ago|reply
[+] [-] raincole|2 years ago|reply
[+] [-] anon25783|2 years ago|reply
[+] [-] ww520|2 years ago|reply
[+] [-] fortran77|2 years ago|reply
[deleted]