Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Add a new server

20 views
Skip to first unread message

valto...@gmail.com

unread,
Mar 14, 2006, 5:45:20 AM3/14/06
to
Hi!

I want to add a new server, like fs, to have new functions and access
to some structures in my Minix but I don't know what I must do to get
it.

Thanks

valto...@gmail.com

unread,
Mar 21, 2006, 11:50:03 AM3/21/06
to
Well!

I'm trying to add a new server to Minix. I've done this:

In /usr/include/minix.com:
03632 /* User-space processes, that is, device drivers, servers, and
INIT. */
03633 #define PM_PROC_NR 0 /* process manager */
03634 #define FS_PROC_NR 1 /* file system */
#define NEW_PROC_NR 2 /* My new server */
03635 #define RS_PROC_NR 3 /* reincarnation server */
03636 #define MEM_PROC_NR 4 /* memory driver (RAM disk,
null, etc.) */
03637 #define LOG_PROC_NR 5 /* log device driver */
03638 #define TTY_PROC_NR 6 /* terminal (TTY) driver */
03639 #define DRVR_PROC_NR 7 /* device driver for boot medium
*/
03640 #define INIT_PROC_NR 8 /* init -- goes multiuser */

In /usr/src/kernel/table.c:
#define NEW_C (c(SYS_KILL) | c(SYS_VIRCOPY) | c(SYS_VIRVCOPY) |
c(SYS_UMAP) \
| c(SYS_GETINFO) | c(SYS_EXIT) | c(SYS_TIMES) | c(SYS_SETALARM))
06095 PUBLIC struct boot_image image[] = {
06096 /* process nr, pc, flags, qs, queue, stack, traps, ipcto,
call, name */
06097 { IDLE, idle_task, IDL_F, 8, IDLE_Q, IDL_S, 0, 0,
0, "IDLE" },
06098 { CLOCK,clock_task, TSK_F, 64, TASK_Q, TSK_S, TSK_T, 0,
0, "CLOCK" },
06099 { SYSTEM, sys_task, TSK_F, 64, TASK_Q, TSK_S, TSK_T, 0,
0, "SYSTEM"},
06100 { HARDWARE, 0, TSK_F, 64, TASK_Q, HRD_S, 0, 0,
0, "KERNEL"},
06101 { PM_PROC_NR, 0, SRV_F, 32, 3, 0, SRV_T, SRV_M,
PM_C, "pm" },
06102 { FS_PROC_NR, 0, SRV_F, 32, 4, 0, SRV_T, SRV_M,
FS_C, "fs" },
{ NEW_PROC_NR, 0, SRV_F, 32, 4, 0, SRV_T, SRV_M, NEW_C,
"new" },
06103 { RS_PROC_NR, 0, SRV_F, 4, 3, 0, SRV_T, SYS_M,
RS_C, "rs" },
06104 { TTY_PROC_NR, 0, SRV_F, 4, 1, 0, SRV_T, SYS_M,
DRV_C, "tty" },
06105 { MEM_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, DRV_M,
MEM_C, "memory"},
06106 { LOG_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M,
DRV_C, "log" },
06107 { DRVR_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M,
DRV_C, "driver"},
06108 { INIT_PROC_NR, 0, USR_F, 8, USER_Q, 0, USR_T, USR_M,
0, "init" },
06109 };

I've edited the Makefile files tools/Makefile, servers/Makefile and
new/Makefile and finally I've added a new directory server/new/ where
I've put a simple main.c with only a loop:
while(TRUE){ receive(ANY,&m_in}

When I compile whith "make install" all seems to work properly but then
I execute "shutdown" and I obtain this mistake:
"Request to RS failed: unknow error (-104)"

And finally when I restart, I get the same mistake an the computer gets
frozen.

What happen? What I'm doing bad?

Thanks

Ben Gras

unread,
Mar 22, 2006, 8:33:35 AM3/22/06
to
All,

Firstly, you may have to recompile a lot of things (even the libraries)
as you've changed the process numbers. Secondly, the order of the
programs in PROGRAMS= in the tools/Makefile have to match the order in
kernel/table.c.

However, why torture yourself with this, while you can compile and start
and stop a server at run-time with RS and the 'service' command?

=Ben


valto...@gmail.com

unread,
Apr 14, 2006, 6:10:12 AM4/14/06
to
Hi!

I left this way to make my project but at the end I need to add a new
server, with the same privileges than others servers.

I recompile all the things (/usr/src/tools/make install), I put the new
server between FS and RS in all files (Makefile, table.c, minix.com,
...) but this doesn't works.

The system starts, I see the copyright message and then the computer
gets frozen.

Please, I need help, this is very important.

Ben Gras

unread,
Apr 14, 2006, 9:27:01 AM4/14/06
to
All,

Looks like you have left out renumbering _somewhere_.. but as I said
earlier, why torture yourself with this if you can start your server at
runtime with the 'service' command?

=Ben


valto...@gmail.com

unread,
Apr 17, 2006, 7:00:18 AM4/17/06
to
I torture myself with this because I NEED to do this, I NEED to add a
new server like FS, PM, DS or RS.

Ben Gras

unread,
Apr 17, 2006, 7:41:20 AM4/17/06
to
All,

> I torture myself with this because I NEED to do this, I NEED to add a
> new server like FS, PM, DS or RS.

Well, if you start it using the 'service' command, it IS a new server
like FS, PM, DS or RS, it won't have a fixed process number (ipc
destinations are called 'endpoints' nowadays) you can sendrec() to
though, that's the only difference.

If you really want / need that:
. renumber the process numbers in <minix/com.h> as necessary, and
give yourself a new process number
. it's probably best to add it before INIT, there are some assumptions
here and there that INIT is the last system process. it might not
matter though.
. add your process in kernel/table.c, using the new process number
. add it to the tools Makefile and at the right place in the list
of installboot processes
. the position in the image has to match the position in
kernel/table.c.
. recompile. It's safest to recompile everything, including libraries,
so first install the new includes, then do make clean install in
libraries, then make clean install in tools. a shorthand for that
is 'make fresh install' in tools.)

that should do it.

=Ben


valto...@gmail.com

unread,
Apr 17, 2006, 12:19:07 PM4/17/06
to
I was do all the things you say excepting make with the "fresh" and now
this works :)

Thanks!!

0 new messages