OSDev.org
https://forum.osdev.org/

Digital Mars C / D compiler
https://forum.osdev.org/viewtopic.php?f=1&t=11332
Page 3 of 3

Author:  Rob [ Fri Feb 03, 2006 6:51 am ]
Post subject:  Re:Digital Mars C / D compiler

To get back to Singularity (remember, this is a micro kernel) and their GC'ed world, here is how they do it:

- the kernel has a garbage collector, but it is different one that processes have

- exchange of data goes over/through an exchange heap where an object can only have one owner. So a network packet is on that, not in kernel memory. This is definitely not garbage collected, I think it was reference counted (which in their case is easy to do since an object can only have one owner [pointer, kinda])

- since processes (including drivers) can only be written in a safe (normally interpreted, but in this case dynamic compiled) language there is no use of ring 3 or other hardware safeties. I would think that this gives them a lot of extra speed which minimizes the impact of garbage collectors (which speed tests seem to confirm)

Their idea and project setup was that running just a safe language with GC was probably not going to work. They did a lot of things different than (most) "standard/other" kernels do it.

So if anyone ever wants to do a GC'ed OS themselves it's probably a wise idea to look at the big picture....

Author:  Colonel Kernel [ Fri Feb 03, 2006 8:39 am ]
Post subject:  Re:Digital Mars C / D compiler

Pype.Clicker wrote:
that's okay enough for userspace. in kernel space, we usually have slabs and the like providing similar "constant-time" allocation out of pre-sliced chunks. I have network processing in mind: you need a new buffer for each packet you receive, and you usually release that buffer everytime the packet has been fully processed.

Letting the GC do its business here might require a too high priority when network gets more busy ... At least, if i was in charge, i'd be using my own pool of buffer here even in a language that supports garbage collection ...


These may be among the reasons that Singularity implements all its drivers in separate processes (I can't really say "user mode", because the entire system actually runs in ring 0, but the processes are isolated via type safety and separate GCs).

<edit>
Doh, didn't see Rob's reply. :-[

@Rob:
Yes, I'm really interested in Singularity. I read their technical report and watched the interviews on Channel 9. It's so different than other OSes I've studied -- that's what makes it fascinating.

I actually am working on my own OS, but not lately, as work has become extremely busy.

Page 3 of 3 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/