www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - writing windows kernel mode code using D?

reply Mike Carifio <carifio takeout.usys.takeout.com> writes:
Can D be used to write Windows kernel mode code?
Has someone written a tutorial to get started on this?

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.
Feb 06 2007
parent reply Walter Bright <newshound digitalmars.com> writes:
Mike Carifio wrote:
 Can D be used to write Windows kernel mode code?
Sure.
 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.
Feb 06 2007
parent reply Mike Carifio <carifio takeout.usys.takeout.com> writes:
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"? Would garbage collection work for kernel mode memory management?
 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." Thanks.
Feb 06 2007
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Carifio schrieb am 2007-02-06:
 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"?
I've implemented a few Linux kernel modules in D.
 Would garbage collection work for kernel mode memory management?
Yes, but the GC works only if it knows where to find potential pointers. Potential problems are the same as those encountered with different GC engines and multiple DLLs. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFySFTLK5blCcjpWoRAqPWAJkBmBIteXaF01yhkJJ36XIZ8DRLIwCeJLrJ Pv5977JwgwBbR9HO82F51Gc= =PUzT -----END PGP SIGNATURE-----
Feb 06 2007
prev sibling parent reply Walter Bright <newshound digitalmars.com> writes:
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.
Feb 06 2007
parent Kyle Furlong <kylefurlong gmail.com> writes:
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.
Feb 07 2007