summaryrefslogtreecommitdiff
path: root/rumpdisk/main.c
AgeCommit message (Collapse)Author
2023-07-03rumpusbdisk: Add USB mass storage translatorDamien Zammit
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>
2022-09-11machdev, pci-arbiter, rumpdisk: Fix race condition in bootstrapDamien Zammit
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>
2022-03-01rumpdisk: Override machdev_server with multithread port managementDamien Zammit
This makes rumpdisk multithreaded as much as the root filesystem pager will request. Message-Id: <20220227091013.33112-4-damien@zamaudio.com>
2022-01-01Fix build warningsSamuel Thibault
No actual behavior change.
2021-12-30wire_task_self: Use in various translatorsSamuel Thibault
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.
2021-12-27pci-arbiter,rumpdisk: Lock all memory for swappingDamien Zammit
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>
2021-08-11pci-arbiter, rumpdisk: Rename options for bootstrap chainSamuel Thibault
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.
2021-04-15libmachdev: Restore making machdev_trivfs_server blockingSamuel Thibault
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().
2021-04-04machdev: Pass argv through to _hurd_initDamien Zammit
Message-Id: <20210404033750.143411-1-damien@zamaudio.com>
2021-03-16machdev,rump,pci: Rework bootstrapDamien Zammit
* 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>
2021-03-02rumpdisk: Let server threads runDamien Zammit
* rumpdisk/main.c (main): Call pthread_exit(NULL) to let server threads continue.
2020-11-14libmachdev: Avoid conflating translator name and pathSamuel Thibault
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.
2020-11-14libmachdev: Support installing translator in the FSDamien Zammit
*/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.
2020-07-25rumpdisk: Use bootstrap resume of fs task in machdevDamien Zammit
Message-Id: <20200725011847.186969-4-damien@zamaudio.com>
2020-04-11rumpdisk: Add userspace disk support via librumpDamien Zammit