aboutsummaryrefslogtreecommitdiff
path: root/rumpdisk/main.c
Commit message (Collapse)AuthorAgeFilesLines
* rumpusbdisk: Add USB mass storage translatorDamien Zammit2023-07-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | This adds a second binary target to compile in the rump USB stack instead of SATA/IDE using conditional ifdefs to mostly share the code between the two translators. This can be tested by running qemu with a USB3 controller as follows: -drive if=none,id=usbstick,format=raw,file=/path/to/disk.img \ -device qemu-xhci \ -device usb-storage,drive=usbstick \ NB: /path/to/disk.img can be a block device on the host. Then call grub module rumpusbdisk.static instead of rumpdisk.static and pass ' root=part:X:device:sd0 noide' as gnumach parameters, where X is the partition number of / within the disk/image. Caveats: netdde seems to exhibit a bug when running 'ifdown /dev/eth0' simultaneously to running the rumpusbdisk translator, due to the two devices sharing the same IRQ. Message-Id: <20230703101815.925760-1-damien@zamaudio.com>
* machdev, pci-arbiter, rumpdisk: Fix race condition in bootstrapDamien Zammit2022-09-111-1/+3
| | | | | | | | This fixes a known race condition in bootstrapping by separating the fsys_startup call from the server demuxer loop into two separate functions that the caller can decide when to call. Message-Id: <20220908093229.499494-1-damien@zamaudio.com>
* rumpdisk: Override machdev_server with multithread port managementDamien Zammit2022-03-011-1/+16
| | | | | | | This makes rumpdisk multithreaded as much as the root filesystem pager will request. Message-Id: <20220227091013.33112-4-damien@zamaudio.com>
* Fix build warningsSamuel Thibault2022-01-011-0/+1
| | | | No actual behavior change.
* wire_task_self: Use in various translatorsSamuel Thibault2021-12-301-2/+1
| | | | | | wire_task_self() was duplicating mach-defpager's wire_all_memory(), we can just make mach-defpager now use the former (and not mlockall either). Also pci-arbiter and rumpdisk can use it.
* pci-arbiter,rumpdisk: Lock all memory for swappingDamien Zammit2021-12-271-0/+8
| | | | | | | This locks all memory in bootstrap processes so that disk driver dependencies don't get swapped out. Message-Id: <20211226113857.150525-5-damien@zamaudio.com>
* pci-arbiter, rumpdisk: Rename options for bootstrap chainSamuel Thibault2021-08-111-5/+5
| | | | | | | | We may end up with an arbitrary series of bootstrap translators, which can know about each other through devices, and thus do not need any particular order except dependencies. The actual bootstrap order can thus be arbitrary (provided it respects dependencies), so better not hardcode it.
* libmachdev: Restore making machdev_trivfs_server blockingSamuel Thibault2021-04-151-2/+0
| | | | | | | | | | | | | | | netdde actually needs to control which thread runs the trivfs server, for managing per-thread state etc. Only pci-arbiter needs to run machdev_trivfs_server non-blockingly, it can create a thread by itself. * libmachdev/trivfs_server.c (machdev_trivfs_loop): Move back muxer loop to... (machdev_trivfs_server): ... here. * pci-arbiter/main.c (main): Run machdev_trivfs_server in its own thread. * rumpdisk/main.c (main): Do not call pthread_exit().
* machdev: Pass argv through to _hurd_initDamien Zammit2021-04-041-1/+1
| | | | Message-Id: <20210404033750.143411-1-damien@zamaudio.com>
* machdev,rump,pci: Rework bootstrapDamien Zammit2021-03-161-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * libmachdev/trivfs_server.c (bootstrapped): Rename to bootstrapping. (trivfs_S_fsys_startup): Call fsys_startup on the bootstrap port. (essential_task): New function. (trivfs_S_fsys_init): Call fsys_init on the bootstrap port. Configure proc. Mark us as essential when bootstrapping even without a devnode. (arrange_shutdown_notification): Do not configure proc. (machdev_trivfs_init): Always get the bootstrap port from the kernel, leave it MACH_PORT_NULL if unavailable. Call fsys_getpriv on it if it is. * pci-arbiter/Makefile (SRCS): Remove startup.c. * pci-arbiter/startup.c: Delete file. * pci-arbiter/startup.h: Delete file. * pci-arbiter/main.c: Do not include "startup.h" (pci_device_shutdown): Do not try to lokup the dosync_handle. (pcifs_startup): Always create the pci_control_port right on the control port. (main): Call machdev_device_init after machdev_trivfs_init. Do not call arrange_shutdown_notification. * rumpdisk/main.c (netfs_server_name): Don't pretend to be the arbiter anymore (main): Call machdev_device_init after machdev_trivfs_init. Message-Id: <20210316054715.788725-1-damien@zamaudio.com>
* rumpdisk: Let server threads runDamien Zammit2021-03-021-0/+2
| | | | | * rumpdisk/main.c (main): Call pthread_exit(NULL) to let server threads continue.
* libmachdev: Avoid conflating translator name and pathSamuel Thibault2020-11-141-1/+1
| | | | | | | | | | | | bootstrap translators may not wish to appear in the FS, and the name of the translator does not have to match the path where it is getting installed. * libmachdev/machdev.h (machdev_trivfs_init): Add path parameter. * libmachdev/trivfs_server.c (machdev_trivfs_init): Add path parameter, set devnode only if it is not NULL. (trivfs_S_fsys_init): Only call install_as_translator when devnode is not NULL. * /rumpdisk/main.c (main): Add path parameter.
* libmachdev: Support installing translator in the FSDamien Zammit2020-11-141-1/+1
| | | | | | | | | | | | | | | | | */libmachdev/trivfs_server.c (machdev_ctl): Rename to control_port. (trivfs_S_fsys_init): Fix accordingly. (control): New variable. (bootstrapped, underlying, devnode): New variables. (install_as_translator): New function. (trivfs_S_fsys_init): When bootstrapping, call install_as_translator. (machdev_trivfs_init): Create one port of the control class. (trivfs_S_fsys_getpriv): Use ports_get_send_right on the control port instead of creating another one. (resume_bootstrap_server): Use ports_get_send_right on the control port instead of creating another one. (machdev_trivfs_init): When bootstrapping, Use our control port as fsys.
* rumpdisk: Use bootstrap resume of fs task in machdevDamien Zammit2020-07-251-3/+92
| | | | Message-Id: <20200725011847.186969-4-damien@zamaudio.com>
* rumpdisk: Add userspace disk support via librumpDamien Zammit2020-04-111-0/+39