www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Writting SO kernel in D

reply Javi <javier.valcarce gmail.com> writes:
Hi,
I would like to know the main issues about writting OS kernels in D.

My (hobby) kernel is composed by 2 files: startup.S and kernel.d, neither
startup.S nor kernel.d make system calls, of cource.

But kernel.o references the symbol __gdc_persolnality_v0 
Where is It? It seems a kind  of runtime for garbage collector, etc. How can I
turn it off? 

Thanks, and sorry for my poor english.
Javi
Apr 19 2007
parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Javi wrote:
 Hi,
 I would like to know the main issues about writting OS kernels in D.
 
 My (hobby) kernel is composed by 2 files: startup.S and kernel.d, neither
startup.S nor kernel.d make system calls, of cource.
 
 But kernel.o references the symbol __gdc_persolnality_v0 
 Where is It? It seems a kind  of runtime for garbage collector, etc. How can I
turn it off? 

Actually, that looks like exception support. Try compiling with "-fno-exceptions" to turn it off. Though if you ever want to use exceptions in your kernel you'll have to eventually copy the code from the runtime or reimplement it yourself. (I have no idea what it requires, for all I know the default implementation could work just fine in a kernel)
Apr 19 2007
parent speal <charliemc86 gREmOVEailCAPS.com> writes:
That's helpful.  I was dealing with that same issue in my kernel project.  I've
got some other undefined symbols I'd like to take care of so I can go to OO
code,
but there seems to be a lack of documentation for D's inner workings.  Maybe I'm
just missing it?

What specifically is involved in declaring, instantiating, and calling member
functions for classes, as far as the runtime is concerned?  None of this is in
dynamic memory yet, of course.

How about static constructors?  How are the calls to static constructors stored
in
the binary?  Is it the same as for C++ (array of static constructor pointers),
are
they put in the .bss section, or is it something else entirely?
Aug 17 2007