writing windows kernel mode code using D?

Kyle Furlong kylefurlong at gmail.com
Wed Feb 7 02:28:01 PST 2007


Walter Bright wrote:
> Mike Carifio wrote:
>> Walter Bright wrote:
>>> Mike Carifio wrote:
>>>> Can D be used to write Windows kernel mode code?
>>>
>>> Sure.
>>>
>>
>> Is that "Sure" as in "Yes, the compiler produces object code that the 
>> kernel can link" or "Sure" as in "Sure, why not? Tell us if you run 
>> into a wall"?
> 
> Anything you can do in C, you can do in D pretty much directly, with the 
> same results.
> 
> 
>> Would garbage collection work for kernel mode memory management?
> 
> Probably not. But you can use malloc/free. You can use D just as you'd 
> use C.
> 
> 
>>>> Has someone written a tutorial to get started on this?
>>>
>>> I don't think so. Why not keep a notebook of your explorations on 
>>> doing this, and later turn it into an article? It could be a valuable 
>>> contribution.
>>>
>>>> In particular, I'm looking for a leg up on the port/miniport
>>>> remote file system approach on Windows. This is a pretty
>>>> difficult place to start learning D, but D also looks to be
>>>> uniquely suited to do it.
>>
>> Sure. As in "Sure, why not? But I'm not very qualified to write 
>> something like this."
> 
> The best way to get qualified is to just do it.

Having written part of a working kernel in D, I can say that low level 
programming in D compared to C is an order of magnitude better. Modules, 
fast and easy compilation, DbC, and all the rest makes this sort of 
programming less tiresome and more productive. All we needed other than 
D was an asm boot loader. I might even go so far to say that its a BAD 
thing, because dangerous code (i.e. kernel level code) shouldn't be easy 
to write.

That said, we never got to the step of getting the gc up and running 
(mainly for lack of a memory subsystem :D), so I cant comment on that 
portion of the question.



More information about the Digitalmars-d mailing list