On Tuesday, 19 November 2013 at 22:49:07 UTC, John Carter wrote:
What would it take to "Boot to D"?

Check this out:

http://arsdnet.net/dcode/minimal.zip

I stripped out druntime, then put back only enough to get many of the language features working, but all standing alone. The makefile.bare (or whatever i called it) can make an elf image that can be loaded by GRUB onto bare x86 metal and run the little D program.

Though...

Typically things like stack setup, program load, register initialization, zero'ing .bss segments and copying .data segments into ram etc. etc.

this stuff is all done by GRUB, so I cheated a little. It shouldn't be too hard to do in D though, if nothing else, a naked inline asm function at the start location.

Sometime mmap or sbrk for heap management.

and I didn't do much heap at all, I just dropped stuff in somewhere. But that's because I'm lazy more than because it is hard.

Reply via email to