www.digitalmars.com         C & C++   DMDScript  

D - OS Kit & GC

reply =?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= <robert.muench robertmuench.de> writes:
Hi, I'm playing to do a D based kernel using the OS kit and the other 
efforts. Of course the first thing to get to work is memory-management. 
Has someone a totally stripped down GC interface? Or maybe an other GC 
implementation I can use as a base?

-- 
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
Feb 13 2004
parent reply "Walter" <walter digitalmars.com> writes:
Why not use the phobos GC?

"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:opr3bfd5p4um5vd8 news.digitalmars.com...
 Hi, I'm playing to do a D based kernel using the OS kit and the other
 efforts. Of course the first thing to get to work is memory-management.
 Has someone a totally stripped down GC interface? Or maybe an other GC
 implementation I can use as a base?

 --
 Robert M. Münch
 Management & IT Freelancer
 http://www.robertmuench.de

Feb 16 2004
parent reply =?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= <robert.muench robertmuench.de> writes:
On Mon, 16 Feb 2004 10:15:17 -0800, Walter <walter digitalmars.com> wrote:

 Why not use the phobos GC?

Hi, that's what I want to do. For using D as a compiler for a kernel, I first have to get all kind of phobos stuff to work until the GC will compile. Step by step... On other question: Is there a documentation about all the compiler internal/implicit used functions? Like _d_arraycast etc. I think I first need to implement all of them to get to the next level, where some parts of phobos will be compileable. Or am I wrong? -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de
Feb 17 2004
next sibling parent reply "Ben Hinkle" <bhinkle4 juno.com> writes:
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:opr3i1e0q3um5vd8 news.digitalmars.com...
 On Mon, 16 Feb 2004 10:15:17 -0800, Walter <walter digitalmars.com> wrote:

 Why not use the phobos GC?

Hi, that's what I want to do. For using D as a compiler for a kernel, I first have to get all kind of phobos stuff to work until the GC will compile. Step by step... On other question: Is there a documentation about all the compiler internal/implicit used functions? Like _d_arraycast etc. I think I first need to implement all of them to get to the next level, where some parts of phobos will be compileable. Or am I wrong?

I would think the GC would be ok but the malloc calls (or whatever the GC uses to request memory from the OS) that the GC relies on would have to be written before the GC. Then again, I could be wrong, too. What kind of kernel are you looking to compile?
 -- 
 Robert M. Münch
 Management & IT Freelancer
 http://www.robertmuench.de

Feb 17 2004
parent =?iso-8859-1?Q?=22Robert_M._M=FCnch=22?= <robert.muench robertmuench.de> writes:
On Tue, 17 Feb 2004 14:31:58 -0500, Ben Hinkle <bhinkle4 juno.com> wrote:

 I would think the GC would be ok but the malloc calls (or whatever the GC
 uses to request memory from the OS) that the GC relies on would have to
 be written before the GC.

Hi, I have done this in a very rudimentary way. Just to get things go. It doesn't deserve the name memory-manager yes, but that can be changed later. But the GC is quite complex and uses some other standard D modules, and these use further ones etc. So you start at one point and need to iterate down to the lowest level and implement the pieces step-by-step all way up again.
 Then again, I could be wrong, too. What kind of kernel are you looking 
 to compile?

I'm doing a complete new one. What I'm most interested in is to see how a GCed kernel works and if this propertie can be exported to "apps". IMO a kernel based on D, with DBC, GC etc. really would be a cool thing. And D is the only language I know, that has those features and can go down to the bare metal. -- Robert M. Münch Management & IT Freelancer http://www.robertmuench.de
Feb 19 2004
prev sibling parent "BERO" <berobero users.sourceforge.net> writes:
all you need to run phobos GC,
- alloc/release small memory like malloc/free
- alloc/release n*pagesize aligned pagesize memory block like
mmap(MAP_ANON)/munmap or
memalign
- get stack top/end
additional if threaded
- stop/restart all thread
- get each thread stack top/end

bero
Feb 19 2004