True story:
10 years ago, I was part of a team that did a very high-performance cross-platform driver stack for a number of ATA/SCSI/SAS disk HBAs. Though this was a set of drivers for HBAs, we didn’t expose the HBA/Disk abstraction to the OS, which made the task significantly easier. Our device abstraction was unknown to any OS, so there was no pre-existing data contract we had to support.
We abstracted the OS into a layer hidden behind an interface. Stuff like memory allocation, sync primitives, that sort of thing. We abstracted the hardware control logic hidden behind a different interface. Both of those layers could use the common core glue logic through another interface, and the common core did as much of the IO processing as we could hoist into it. We made it impossible to *accidentally* cross those boundaries. We actively discouraged each other from intentionally crossing them.
The request model looked very much like WDF. The Linux shim wasn’t too hard to do.
The result:
Windows/Linux/DOS (in that order) support for 8-10 (don’t remember exactly) HBAs. Still in use today, though I don’t know which platforms are still active. It was capable of keeping disk read channels saturated indefinitely.
Some of my best driver work, ever. The basic interface across UM/KM boundary was pretty good, as well. Sadly, some parts of the UM interface I put on top of all that makes me cringe to remember, even a decade later.
Phil
Not speaking for LogRhythm
Phil Barila | Senior Software Engineer
720.881.5364 (w)
A LEADER in Gartner’s SIEM Magic Quadrant (2012-2016)
Highest Score in Gartner’s 2015 SIEM Critical Capabilities Report
A CHAMPION in Info-Tech Research Group’s 2015 SIEM Vendor Landscape Report
SC Labs RECOMMENDED in 2016 SIEM and UTM Group Test | 5-Star Rating (2009-2016)
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-617673-
xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Thursday, October 13, 2016 6:55 AM
To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Pros n Cons of using Classes (CPP) at Kernel Level
>
> Anton,
>
> There was an effort 20 years ago to make a cross platform driver
> for all versions of UNIX at the time. It was a disaster, since even on
> that platform things varied so much (worst case was one platform that did
> not support multiple threads in one driver), that it was given up on.
>
> On the idea of cross platform drivers for Linux and Windows, I’ve
> worked with clients who tried it. It can work ok for a kernel library
> which has little interaction with the OS or hardware (a good example was a
> state machine for a communications protocol), but for general drivers
> anything but the simplest driver for simple slow speed hardware typically
> is a bad idea. I’ve seen clients who started with either Linux or Windows
> drivers and tried to make them cross platform, they quickly complain about
> how terrible the second OS is, when in fact it is the attempt to limit the
> capabilities of the driver to a subset of the target platforms.
>
> I’ve taken a number of Linux drivers for custom devices as
> reference, and I quickly find that the only things useable, are the
> hardware interactions for a given request, and the requests themselves
> (with the large caveat that the differences between the OS’es can make
> taking the
> request model from Linux a bad idea). Both operating systems are good
> OS’es, but they came from significantly different architectures, and if
> you do not respect the architecture, you are not going to get a good
> driver.
>
>
> Don Burn
> Windows Driver Consulting
> Website: http://www.windrvr.com
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@hotmail.com
> Sent: Wednesday, October 12, 2016 10:51 PM
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] Pros n Cons of using Classes (CPP) at Kernel Level
>
> >Often a driver will be needed on multiple platforms, and C++ might have
> >advantages on Windows, but getting the Linux kernel team to accept
> >your C++ containing driver into the mainline tree is difficult
> (impossible?).
>
> Cross-platform drivers? I’ve never heard about anything like that. Up to
> this point, I firmly believed that every OS has its own kernel API and
> driver model that are typically unique and very different from their
> counterparts under any other OS.Probably, I just missed some “new
> developments”
> If you don’t mind,could you please enlighten me a bit on this “exciting”
> subject.
>
>
> Concerning Linux kernel and C++, I suggest checking the link below.
>
> http://lwn.net/Articles/249460/
>
>
> When it comes to hating C++, I guess our host may take a course from
> Linus…
>
>
>
> > I think the best hope at this point would be universities teach good
> >computer science, including the area of computer languages, so in 30
> >years, new kernel developers would just be repulsed if they had to use
> >a language that allowed them to accidentally corrupt memory.
>
> Oh dear…
>
> We’ve been here so many times that any argument/counter-argument in this
> respect seems to be totally unnecessary - everything that may possibly be
> said here seems to have been said already at some point on NTDEV I guess
> the next topic that this thread may jump to is microkernel.
> All this is so predictable…
>
>
> > For a while, Windows was getting blamed for being much less secure,
> > but then we had really major security vulneraries in some open source
> > and
> Linux projects, which I think was a >wakeup call that Windows was not the
> problem, the C language was.
>
>
> Windows vs Linux is yet another topic that such a thread may jump to -
> this is, again, so predictable.
>
>
>
> I guess the only good thing that such a thread may evolve to is becoming
> sort of “funny”.I tried to steer it in this direction but, unfortunately,
> got shot down by “The Hanging Judge” even before having had a chance to
> take off…
>
>
> Anton Bassov
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at:
> http:
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at
> http:
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at:
> http:
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at
> http:</http:></http:></http:></http:></http:></http:>