What is the absolute minimum code for a D kernel, and how should it be compiled?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 6 14:41:05 PST 2015


I showed how to do it in my book using dmd. Here's the code:

http://arsdnet.net/dcode/book/chapter_11/01/

Explanation is in chapter 11 here:
https://www.packtpub.com/application-development/d-cookbook

In the appendix, I also did ARM with gdc:
http://arsdnet.net/dcode/book/appendix_a/01/


The arm one might be easier to start with than the dmd one, 
despite dmd being x86. I went a bit further there, even up to 
keyboard support in the second section with interrupt handlers.


Short version of the explanation is that the compiler outputs 
hooks for the runtime library and you need to stub those out as 
you hit them. Some are required just for the beginning.


BTW make sure your bootloader puts the processor in 32 bit more. 
D doesn't support 16 bit code.


More information about the Digitalmars-d-learn mailing list