www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Developing a D Kernel

reply Ben Grabham <Evil.Nebster gmail.com> writes:
Hey,

I'm trying to develop a kernel in D2. It works fine if I don't use 
classes but as soon as I try to use classes, it complains about the lack 
of object.d.

So, I set out on a quest to develop a simple object.d that doesn't need 
to import anything to work apart from basic memory functions like 
malloc, etc (for now). I'm partially basing it off the one included in 
the D runtime. The problem is that I'm trying to find a minimal object.d 
that doesn't try to pull in too much. Has this been done before? 
Whenever I try to create one that is not the original one, I just make 
the compiler generate a segmentation fault.

I've also been trying to find a kernel project that someones started 
with classes in D2 but have yet to find one. Does anyone know one?

Thanks,
Nebster
Jun 04 2011
next sibling parent reply Daniel Gibson <metalcaedes gmail.com> writes:
Am 04.06.2011 17:13, schrieb Ben Grabham:
 Hey,
 
 I'm trying to develop a kernel in D2. It works fine if I don't use
 classes but as soon as I try to use classes, it complains about the lack
 of object.d.
 
 So, I set out on a quest to develop a simple object.d that doesn't need
 to import anything to work apart from basic memory functions like
 malloc, etc (for now). I'm partially basing it off the one included in
 the D runtime. The problem is that I'm trying to find a minimal object.d
 that doesn't try to pull in too much. Has this been done before?
 Whenever I try to create one that is not the original one, I just make
 the compiler generate a segmentation fault.
 
 I've also been trying to find a kernel project that someones started
 with classes in D2 but have yet to find one. Does anyone know one?
 
 Thanks,
 Nebster

There's a kernel written in D1: http://wiki.xomb.org/ Cheers, - Daniel
Jun 04 2011
parent Ben Grabham <Evil.Nebster gmail.com> writes:
On 04/06/11 16:15, Daniel Gibson wrote:
 Am 04.06.2011 17:13, schrieb Ben Grabham:
 Hey,

 I'm trying to develop a kernel in D2. It works fine if I don't use
 classes but as soon as I try to use classes, it complains about the lack
 of object.d.

 So, I set out on a quest to develop a simple object.d that doesn't need
 to import anything to work apart from basic memory functions like
 malloc, etc (for now). I'm partially basing it off the one included in
 the D runtime. The problem is that I'm trying to find a minimal object.d
 that doesn't try to pull in too much. Has this been done before?
 Whenever I try to create one that is not the original one, I just make
 the compiler generate a segmentation fault.

 I've also been trying to find a kernel project that someones started
 with classes in D2 but have yet to find one. Does anyone know one?

 Thanks,
 Nebster

There's a kernel written in D1: http://wiki.xomb.org/ Cheers, - Daniel

Yes, I've seen xomb, titan, osian and one posted on this newsgroup. Unfortunately they are all D1 kernels. The problem I'm having is creating a small object.d for D2 without causing the compiler to seg fault Thanks for trying to help though! Nebster
Jun 04 2011
prev sibling parent reply Mehrdad <wfunction hotmail.com> writes:
On 6/4/2011 8:13 AM, Ben Grabham wrote:
 Hey,

 I'm trying to develop a kernel in D2. It works fine if I don't use 
 classes but as soon as I try to use classes, it complains about the 
 lack of object.d.

 So, I set out on a quest to develop a simple object.d that doesn't 
 need to import anything to work apart from basic memory functions like 
 malloc, etc (for now). I'm partially basing it off the one included in 
 the D runtime. The problem is that I'm trying to find a minimal 
 object.d that doesn't try to pull in too much. Has this been done 
 before? Whenever I try to create one that is not the original one, I 
 just make the compiler generate a segmentation fault.

 I've also been trying to find a kernel project that someones started 
 with classes in D2 but have yet to find one. Does anyone know one?

 Thanks,
 Nebster

http://stackoverflow.com/questions/4506335/my-os-kernel-in-d-some-embedded-strings-dont-work
Jun 04 2011
parent reply Ben Grabham <Evil.Nebster gmail.com> writes:
On 04/06/11 18:54, Mehrdad wrote:
 On 6/4/2011 8:13 AM, Ben Grabham wrote:
 Hey,

 I'm trying to develop a kernel in D2. It works fine if I don't use
 classes but as soon as I try to use classes, it complains about the
 lack of object.d.

 So, I set out on a quest to develop a simple object.d that doesn't
 need to import anything to work apart from basic memory functions like
 malloc, etc (for now). I'm partially basing it off the one included in
 the D runtime. The problem is that I'm trying to find a minimal
 object.d that doesn't try to pull in too much. Has this been done
 before? Whenever I try to create one that is not the original one, I
 just make the compiler generate a segmentation fault.

 I've also been trying to find a kernel project that someones started
 with classes in D2 but have yet to find one. Does anyone know one?

 Thanks,
 Nebster

http://stackoverflow.com/questions/4506335/my-os-kernel-in-d-some-embedded-strings-dont-work

Well, thanks for the info! Were you calling the constructors and destructors in your code? It seems as if you just disregarded them by the sound of things! They are outputted as a symbol in the object. Do you still have a copy of your code? I would love to look over it! Thanks, Nebster
Jun 04 2011
parent reply Mehrdad <wfunction hotmail.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 6/4/2011 11:13 AM, Ben Grabham wrote:
 On 04/06/11 18:54, Mehrdad wrote:
 On 6/4/2011 8:13 AM, Ben Grabham wrote:
 Hey,

 I'm trying to develop a kernel in D2. It works fine if I don't use
 classes but as soon as I try to use classes, it complains about the
 lack of object.d.

 So, I set out on a quest to develop a simple object.d that doesn't
 need to import anything to work apart from basic memory functions like
 malloc, etc (for now). I'm partially basing it off the one included in
 the D runtime. The problem is that I'm trying to find a minimal
 object.d that doesn't try to pull in too much. Has this been done
 before? Whenever I try to create one that is not the original one, I
 just make the compiler generate a segmentation fault.

 I've also been trying to find a kernel project that someones started
 with classes in D2 but have yet to find one. Does anyone know one?

 Thanks,
 Nebster

http://stackoverflow.com/questions/4506335/my-os-kernel-in-d-some-embedd d-strings-dont-work

Well, thanks for the info! Were you calling the constructors and destructors in your code? It seems as if you just disregarded them by the sound of things! They are outputted as a symbol in the object. Do you still have a copy of your code? I would love to look over it! Thanks, Nebster

I pretty much couldn't get ANYTHING related to Object to work, which I think was ultimately because thread-local storage was ruining everything, and I was spending way too much time on it. The only thing I got working was pretty much C code written in D... structs & unions, fun stuff. :) I don't remember how I built this... I used the Geany text editor, because it also had some (minimal) project support, but I have no idea what the command-line parameters and all that stuff were. (I remember doing a LOT of work with .obj files and stuff to get everything working, though...) Feel free to try building it, good luck. I've attached the file (7-zip archive)... let me know if it didn't attach correctly.
Jun 04 2011
parent Ben Grabham <Evil.Nebster gmail.com> writes:
On 04/06/11 23:25, Mehrdad wrote:
 On 6/4/2011 11:13 AM, Ben Grabham wrote:
 On 04/06/11 18:54, Mehrdad wrote:
 On 6/4/2011 8:13 AM, Ben Grabham wrote:
 Hey,

 I'm trying to develop a kernel in D2. It works fine if I don't use
 classes but as soon as I try to use classes, it complains about the
 lack of object.d.

 So, I set out on a quest to develop a simple object.d that doesn't
 need to import anything to work apart from basic memory functions like
 malloc, etc (for now). I'm partially basing it off the one included in
 the D runtime. The problem is that I'm trying to find a minimal
 object.d that doesn't try to pull in too much. Has this been done
 before? Whenever I try to create one that is not the original one, I
 just make the compiler generate a segmentation fault.

 I've also been trying to find a kernel project that someones started
 with classes in D2 but have yet to find one. Does anyone know one?

 Thanks,
 Nebster

http://stackoverflow.com/questions/4506335/my-os-kernel-in-d-some-embedded-strings-dont-work

Well, thanks for the info! Were you calling the constructors and destructors in your code? It seems as if you just disregarded them by the sound of things! They are outputted as a symbol in the object. Do you still have a copy of your code? I would love to look over it! Thanks, Nebster

I pretty much couldn't get ANYTHING related to Object to work, which I think was ultimately because thread-local storage was ruining everything, and I was spending way too much time on it. The only thing I got working was pretty much C code written in D... structs & unions, fun stuff. :) I don't remember how I built this... I used the Geany text editor, because it also had some (minimal) project support, but I have no idea what the command-line parameters and all that stuff were. (I remember doing a LOT of work with .obj files and stuff to get everything working, though...) Feel free to try building it, good luck. I've attached the file (7-zip archive)... let me know if it didn't attach correctly.

Thanks for that, it's another kernel to add to my collection ^^ Unfortunately it doesn't have an object.d that is for D2 (latest). Your code looks interesting though! I'll have a look through it! Thanks, Nebster
Jun 05 2011