[minix3] adding a new server to minix kernel

961 views
Skip to first unread message

Etienne

unread,
May 11, 2010, 4:11:47 PM5/11/10
to minix3
so i am trying to follow these directions here
http://berkeleyrc.blogspot.com/2010/05/adding-new-server-to-minix-316-kernel.html.


I am on step 2 and i create my own constant for my process in /usr/src/
include/minix/com.h.

Originally the user-space processes are as follows

....
#define VM_PROC_NR 8 /* memory server */
#define PFS_PROC_NR 9 /* pipe filesystem */
#define INIT_PROC_NR 10 /* init--goes multiuser */

so i wanted to define my own as follows

#define SP_PROC_NR

and place it between VM and INIT i tried both before and after PFS.

I also updated the boot image processes that the kernel uses in /usr/
src/kernel/table.c and made sure that the ordering was that same that
was in com.h

my entry is as follows

{SP_PROC_NR, 0, BVM_F, 4, 4, 0, "sp" },

when i save this and run make in the directory /usr/src/kernel
i get the following error messages

in table.c line 78 SP_PROC_NR undefined
in table.c line 91 array size is negative
make in /usr/src/kernel: Exit code 1

i am not really sure why it was say SP_PROC_NR is undefined since i
defined it in com.h or why the array size is now negative after my
entry. Any help is greatly appreciated. I've been stuck on this for
awhile.

--
You received this message because you are subscribed to the Google Groups "minix3" group.
To post to this group, send email to min...@googlegroups.com.
To unsubscribe from this group, send email to minix3+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/minix3?hl=en.

Erik van der Kouwe

unread,
May 12, 2010, 1:10:06 PM5/12/10
to minix3
Hi,

> when i save this and run make in the directory /usr/src/kernel
> i get the following error messages

Like ordinary programs, MINIX gets its include files from /usr/include
rather than /usr/src/include. If you change the include files you need
to install them before you can compile the system. Run "make world"
in /usr/src and the problem should be solved.

With kind regards,
Erik

Björn Swift

unread,
May 11, 2010, 6:23:47 PM5/11/10
to min...@googlegroups.com
Try issuing a 'make includes' in /usr/src, does that do the trick?

Cheers,
Björn

Etienne

unread,
May 11, 2010, 6:16:35 PM5/11/10
to minix3
So i got rid of the array size is negative error by updating the
Makefile in /usr/src/tools so that your process was is in the same
order it is listed in all the other files. however i still have the
SP_PROC_NR undefined. This does not make sense because i went to the
file in which i defined the constant and commented out other constants
in /usr/src/include/minix/com.h. Then in /usr/
src/kernel/table.c these constants are used in the array of structs
and when i compile and perform a make in the /usr/src/kernel directory
i would expect errors to be thrown at all the other constants being
used without being defined however it only says that my created
constant was undefined. I am not really sure what is going on.

On May 11, 1:11 pm, Etienne <lawloretie...@gmail.com> wrote:
> so i am trying to follow these directions herehttp://berkeleyrc.blogspot.com/2010/05/adding-new-server-to-minix-316....

Etienne

unread,
May 11, 2010, 4:36:21 PM5/11/10
to minix3

Tomas Hruby

unread,
May 11, 2010, 5:05:34 PM5/11/10
to min...@googlegroups.com
On Tue, May 11, 2010 at 01:11:47PM -0700, Etienne wrote:
> so i am trying to follow these directions here
> http://berkeleyrc.blogspot.com/2010/05/adding-new-server-to-minix-316-kernel.html.
>
>
> I am on step 2 and i create my own constant for my process in /usr/src/
> include/minix/com.h.
>
> Originally the user-space processes are as follows
>
> ....
> #define VM_PROC_NR 8 /* memory server */
> #define PFS_PROC_NR 9 /* pipe filesystem */
> #define INIT_PROC_NR 10 /* init--goes multiuser */
>
> so i wanted to define my own as follows
>
> #define SP_PROC_NR

My impression is that you don't really know what that define means. It
is a preprocessor macro that defines an integer constant. Thus you
must define it as

#define SP_PROC_NR 10

and change INIT_PROC_NR to

#define INIT_PROC_NR 11

where exactly you place the definition in the file is not relevant.

>
> and place it between VM and INIT i tried both before and after PFS.
>
> I also updated the boot image processes that the kernel uses in /usr/
> src/kernel/table.c and made sure that the ordering was that same that
> was in com.h
>
> my entry is as follows
>
> {SP_PROC_NR, 0, BVM_F, 4, 4, 0, "sp" },
>
> when i save this and run make in the directory /usr/src/kernel
> i get the following error messages
>
> in table.c line 78 SP_PROC_NR undefined
> in table.c line 91 array size is negative
> make in /usr/src/kernel: Exit code 1

Reading line 91 carefully it should be obvious that you also need to
change NR_BOOT_PROCS. It is a sanity check.

HTH

T.

Etienne

unread,
Jun 1, 2010, 1:19:03 AM6/1/10
to minix3
after performing a make fresh install i think all the dependencies
were linked and it recognized the macro. thanks for all the help.



On May 11, 2:05 pm, Tomas Hruby <thr...@gmail.com> wrote:
> On Tue, May 11, 2010 at 01:11:47PM -0700, Etienne wrote:
> > so i am trying to follow these directions here
> >http://berkeleyrc.blogspot.com/2010/05/adding-new-server-to-minix-316....
Reply all
Reply to author
Forward
0 new messages