--- rumpdisk/block-rump.c | 16 +++++++++++++--- rumpdisk/main.c | 12 +++++++----- 2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c index 3ee0773d..584056f7 100644 --- a/rumpdisk/block-rump.c +++ b/rumpdisk/block-rump.c @@ -27,6 +27,7 @@ #include <mach.h> #include <hurd.h> +#include <hurd/fsys.h> /* fsys_getpriv */ #include <hurd/ports.h> #include <device/device.h> @@ -136,12 +137,12 @@ dev_mode_to_rump_mode (const dev_mode_t mode) static void rumpdisk_device_init (void) { - mach_port_t device_master; + mach_port_t bootport, device_master; + device_t device; + task_t fstask; if (! get_privileged_ports (0, &device_master)) { - device_t device; - #if 0 if (! device_open (device_master, D_READ, "hd0", &device) || ! device_open (device_master, D_READ, "hd1", &device) @@ -164,6 +165,15 @@ rumpdisk_device_init (void) return; } } + + /* FIXME: need to synchronise with arbiter to wait for fsys_startup */ + sleep(1); + + task_get_bootstrap_port (mach_task_self (), &bootport); + fsys_getpriv (bootport, &_hurd_host_priv, &_hurd_device_master, &fstask); + + sleep(1); + rump_init (); } diff --git a/rumpdisk/main.c b/rumpdisk/main.c index 150dc996..b2426e7d 100644 --- a/rumpdisk/main.c +++ b/rumpdisk/main.c @@ -31,11 +31,6 @@ #include <pthread.h> #include <mach.h> -/* TODO: Add api to pciaccess to allow selecting backend. - * For now we pretend to be the arbiter and claim x86 method. - */ -char *netfs_server_name = "pci-arbiter"; - mach_port_t bootstrap_resume_task = MACH_PORT_NULL; static const struct argp_option options[] = { @@ -124,5 +119,12 @@ main (int argc, char **argv) return err; pthread_detach (t); machdev_trivfs_server (bootstrap); + + while (TRUE) + { + sleep(2); + } + + /* Never reached */ return 0; } -- 2.30.0