Writing a Linux driver in the D ecosystem

Eduard Staniloiu edi33416 at gmail.com
Thu Oct 25 12:35:56 UTC 2018


On Wednesday, 24 October 2018 at 06:36:51 UTC, sarn wrote:
> On Tuesday, 23 October 2018 at 12:06:48 UTC, Eduard Staniloiu 
> wrote:
>> Hello, everyone!
>>
>> We, here at UPB, were thinking if it would be possible to 
>> write a simple Linux driver.
>
> Hi, I gave this a casual try once.  The difficulty is the same 
> difficulty you get trying to write Linux kernel modules in C++: 
> the Linux build system is a mess of make files that are only 
> designed for C, and don't represent a stable API between kernel 
> source versions.
>
> If I had to write a Linux module in D, I'd write an interface 
> layer in C that gets built using the normal Linux build system 
> and can be linked to my D code.  The interface would have to 
> provide alternatives to the various Linux preprocessor macros.  
> (I think trying to refactor the build system to work with dpp 
> would be a total waste of time.)

Thank you all for your replies!

We too, had the same feeling that it should be possible to do, 
based on the ABI and `-betterC`.

Our concern was the build system, and how everything can be glued 
together.
Thank you for the thin-layer C interface suggestion; I'll try to 
give it a go ("Hello, insmod") in the weekend.

I'll give an update as soon as I have one.

Cheers,
Edi


More information about the Digitalmars-d mailing list