Page 1 of 1

a question about minix

Posted: Sat Sep 13, 2008 9:35 am
by itisiuk
I’ve have been looking into the minix kernel to help me with my microkernel.

Declarations of this kind keep being made

Code: Select all

FORWARD _PROTOTYPE( void create_env, (struct proc *pp) );
FORWARD _PROTOTYPE( void k_printenv, (void) );
After a while I have found that

Code: Select all

#define FORWARD       static
And

Code: Select all

#define	_PROTOTYPE(function, params)	function params
does this mean for the above declarations

Code: Select all

static void create_env(struct proc *pp);
static void k_printenv(void);
why is this done this way, is it just a feature of the ack compiler??

Re: a question about minix

Posted: Sun Sep 14, 2008 1:31 am
by xyzzy
IIRC OSDI said that's done so that it is easier to get Minix to compile with different C compilers that have different function declaration syntax - i.e. K&R vs. ANSI C.

Re: a question about minix

Posted: Sun Sep 14, 2008 4:09 am
by itisiuk
Thanks i understand that a lot better now.

where did you find that info cos i had a good look through the minix website and couldnt find that.

Re: a question about minix

Posted: Sun Sep 14, 2008 4:23 am
by xyzzy
Operating Systems: Design and Implementation - Third Edition. Page 132 to be precise :) I would recommend buying it - although I'm not a huge Minix fan, it's still quite an interesting book.

Re: a question about minix

Posted: Sun Sep 14, 2008 7:56 am
by itisiuk
Cheers for that thanks.

im not a big fan of how minix is written however i like the general idea.
and im having massive trouble with my micro kernel.
thinking of going back to my monolithic kernel after one last try at a microkernel.
trying to get some ideas from plan 9 and minix on what i want to do with it and
how it should would.