bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the master device port and the privileged host port in subhurd


From: zhengda
Subject: Re: the master device port and the privileged host port in subhurd
Date: Thu, 08 May 2008 00:09:39 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

Hi,

olafBuddenhagen@gmx.net wrote:
and get_privileged_ports() seems to invoke a system call of mach.

Why do you think so? The way I read the implementation of
__get_privileged_ports() in glibc (hurd/privports.c), it gets the ports
from the proc server in the normal case, not from Mach.

(There is a special case for the very first process started by Mach on
system boot: In this case, __get_privileged_ports() just copies the
ports from the task itself -- the intial task got the real ports
directly from Mach on startup...)
but boot does use the system call to get these two port from Mach, right?
I find which part of code inserts the privileged host port and device master port into ext2fs.
It's in boot_script_exec(). look at the code of
         switch (arg->type)
       {
       case VAL_STR:
         p = (char *) arg->val;
         len = strlen (p);
         break;

       case VAL_TASK:
       case VAL_PORT:
         if (arg->type == VAL_TASK)
           /* Insert send right to task port.  */
           error = boot_script_insert_task_port
             (cmd, (task_t) arg->val, &name);
         else
           /* Insert send right.  */
           error = boot_script_insert_right (cmd,
                             (mach_port_t) arg->val,
                             &name);


There is one thing I want to confirm:
In the main() of boot, it calls mach_port_request_notification() twice for pseudo_master_device_port and pseudo_console respectively. mach_port_request_notification (mach_task_self (), pseudo_master_device_port,
                 MACH_NOTIFY_NO_SENDERS, 1,
                 pseudo_master_device_port,
                 MACH_MSG_TYPE_MAKE_SEND_ONCE, &foo);
 mach_port_request_notification (mach_task_self (), pseudo_console,
                 MACH_NOTIFY_NO_SENDERS, 1, pseudo_console,
                 MACH_MSG_TYPE_MAKE_SEND_ONCE, &foo);
pseudo_master_device_port and pseudo_console have only the receive right, but the servers in subhurd has their send rights. so boot gets the notification only when all servers in the subhurd exit, right?

Best,
Zheng Da




reply via email to

[Prev in Thread] Current Thread [Next in Thread]