bug-hurd
[Top][All Lists]
Advanced

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

The problems for the rootless subhurd


From: Da Zheng
Subject: The problems for the rootless subhurd
Date: Tue, 21 Apr 2009 00:28:13 +0100
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Hi,

I am developing the subhurd and try to remove its limitation that only the root can use it.

The main task is to make boot works without the master device port and the privileged host port. The original boot implementation creates a pseudo master device port for subhurd and works as a proxy for all device RPCs. Since the user doesn't have the master device port, I added an option '-m' in boot so that the user can specify the devices who ports he has the permission to get .

I use the similar way to handle the privileged host port. boot creates a pseudo privileged host port, hands it to the subhurd, and itself acts as a proxy for all RPCs on the privileged host port.
But it is much more difficult to handle these RPCs.
First, I don't know how to handle vm_wire() and thread_wire(). Since the boot doesn't have the real privileged host port, there seems to be no way to handle them. Currently, I don't implement them and just let them return EOPNOTSUPP. As far as I see, vm_wire() is only used by init and the mach default pager, and thread_wire() is only used by the mach default pager. Since the second Hurd doesn't have its own mach default pager, init is the only program that might cause the problem. The second problem is to handle vm_set_default_memory_manager(). I setup the proxy of default pager and boot returns the port to the default pager proxy to the subhurd. It seems to work OK. The third one is to handle processor_set_tasks(). In order to track all tasks in subhurd, boot works as a proxy for all RPCs on the task port, so that it can know when task_create() is called (It is a heavy solution. antrik and I discussed about other solutions. For example, to get the task of subhurd from the main Hurd's proc server. But it doesn't work because the proc server can only return the tasks that belong to the user and it doesn't think the tasks in the subhurd belong to the user of subhurd). However, it seems to be the source of the most serious bug in my modified boot.

BUG:
After I added the proxy for all RPCs to 'boot', I find that subhurd sometimes failed to boot. For example, it sometimes stops booting after the system displays "GNU 0.3 (hurd) (console)" and it sometimes boots successfully and displays "login>" but stops working after I try to login. Sometimes, it even prints the error message like
   getty[47]: /bin/login: No such file or directory
   Use `login USER' to login, or `help' for more information.
Of course, sometimes subhurd can boot and I can login successfully.

I don't know the possible reason for the bug.
First, I guess that it might be because I use the default pager proxy, so I change the code and get the default pager directly from Mach (of course, I have to run boot with root). However, it didn't solve the problem. The problem still exists. Then I thought that the reason might be that the proxy ran in a single thread, so I made it run in the multiple threads. It still didn't solve the problem though somehow I feel that subhurd is more likely to be booted successfully. I don't know where I should look. I read the code of the proxy several times but didn't find problems. The proxy is quite simple and it only needs to handle some specific RPCs and forwards or ignores the rest of them.
Could anyone give me some suggestion?
If someone wants to see the code, you can find it here:

cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/hurd co -r 
zhengda-soc2008-virt-branch hurd


Thank you very much,
Zheng Da





reply via email to

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