copy / v86

x86 PC emulator and x86-to-wasm JIT, running in the browser
https://copy.sh/v86/
BSD 2-Clause "Simplified" License
19.76k stars 1.39k forks source link

mounting a disk while booting from an ISO #480

Open lunu-bounir opened 3 years ago

lunu-bounir commented 3 years ago

Is it possible to mount an empty disk while booting the OS from an ISO? I want to write persistent data to the disk when Plan 9 is not supported.

Pixelsuft commented 3 years ago

When I'm mounting Hard (or Floppy) Drive with CDROM, it not boots:

463

copy commented 3 years ago

Theoretically yes, but as @Pixelsuft pointed out, there are some bugs that prevent it from working currently.

lunu-bounir commented 3 years ago

I guess the same goes for the following combination too

qemu-system-i386 -kernel bzImage -initrd disk.img
lunu-bounir commented 3 years ago

@copy

Is there any precompiled busybox based distro that works with the filesystem ({filesystem: {...}})? My idea is to use a service worker to dynamically construct the JSON fs and hence be able to provide dynamic files without relying on Plan9. To me generating the entire image from scratch is very hard when you want to just change a few executables or configuration files. Also, many available useful tiny images do no support Plan 9 but can simply get extracted to a directory, and hence in theory they should get altered just by adding or removing files in the directory.

lunu-bounir commented 3 years ago

One advantage is to load the alpine's miniroot 2.6M if there was a valid bzImage that could work with filesystem and bzimage_initrd_from_filesystem: true

copy commented 3 years ago

@lunu-bounir In order to use bzimage_initrd_from_filesystem you have two options:

Neither directly satisfy your requirements, most likely you will need to write some scripts to switch the root from the initrd to the 9pfs. Or build an initrd on Arch (or another distro) and use it to boot into your own filesystem.