bug-hurd
[Top][All Lists]
Advanced

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

Almost working pci-arbiter with rumpdisk


From: Damien Zammit
Subject: Almost working pci-arbiter with rumpdisk
Date: Mon, 8 Feb 2021 20:33:16 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

Hi,

I'm getting very close to working pci + rump.

In pci-arbiter, what port rights do I return in device_open?
I am currently doing this:

static io_return_t
device_open (mach_port_t reply_port, mach_msg_type_name_t reply_port_type,
             dev_mode_t mode, char *name, device_t * devp,
             mach_msg_type_name_t * devicePoly)
{
  mach_print("PCI device_open (");
  mach_print(name);
  mach_print(")\n");
  io_return_t err;
  struct port_info newpi;

  if (strncmp(name, "pci", 3))
    return D_NO_SUCH_DEVICE;

  err = ports_create_port (netfs_control_class, netfs_port_bucket,
                             sizeof (struct port_info), &newpi);
  if (err)
    return D_NO_SUCH_DEVICE;

  *devp = ports_get_send_right (&newpi);
  *devicePoly = MACH_MSG_TYPE_MOVE_SEND;
  return D_SUCCESS;
}


And in rumpdisk I am doing this to device_open pci:

...
  /* Fetch a port to the bootstrap system, the host priv and
     master device ports, and the pci-arbiter  */
  if (task_get_bootstrap_port (mach_task_self (), &bootport)
    || fsys_getpriv (bootport, &host_priv, &device_master, &fstask)
    || device_open (device_master, D_READ|D_WRITE, "pci", &device))
    {
      mach_print("rumpdisk: Cannot reach the pci arbiter...continuing\n");
    }

  rump_init ();
}

Logs:

PCI netfs loop pthread spawn done
machdev_trivfs_server
PCI done, exit thread
PCI device_open (pci)
pci-arbiter: ../../libports/get-right.c:52: ports_get_right: Unexpected error: 
(ipc/send) invalid port right.
rumpdisk: Cannot reach the pci arbiter...continuing
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.99.34 (RUMP-ROAST)
total memory = unlimited (host limit)
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
cpu0 at thinair0: rump virtual cpu
root file system type: rumpfs
kern.module.path=/stand/i386/7.99.34/modules
mainbus0 (root)
pci: I/O space init error 22, I/O space not available
pci0 at mainbus0 bus 0
pci0: memory space enabled, rd/line, rd/mult, wr/inv ok

Damien



reply via email to

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