my first kernel in betterC D

Norm norm.rowtree at gmail.com
Mon Jun 17 04:01:05 UTC 2019


On Sunday, 16 June 2019 at 16:14:26 UTC, Laeeth Isharc wrote:
> https://github.com/kaleidicforks/mkernel-d
>
> I spent a few minutes on just turning the C code to betterC D - 
> was curious to see if it would work.  It seems to.  I didn't 
> try loading with GRUB.  The dub.sdl isn't quite right, so best 
> run ./build.sh
>
> Cannot push to code.dlang.org - it complains about registering 
> a forked package, even after renaming.

I tried mine a while back using betterC but given I was already 
running without druntime the only noticeable difference was I no 
longer required these hacks;

//---
// So we compile without druntime
extern(C) __gshared void* _d_dso_registry;
extern(C) __gshared void* _Dmodule_ref;
extern(C) __gshared void* _d_arraybounds;
extern(C) __gshared void* _d_assert;
extern(C) __gshared void* _d_unittest;
//---
immutable auto VIDMEM_BASE = 0xFFFF8000000B8000;
static immutable ubyte egaBlack = 0;
st



GRUB worked as before for both 32 and 64 bit. But that doesn't 
mean much because my kmain was already extern(C) so the linkage 
was fairly typical.

bye,
Norm



More information about the Digitalmars-d-announce mailing list