v86 icon indicating copy to clipboard operation
v86 copied to clipboard

Support changing 9p mount tag at runtime

Open hello-smile6 opened this issue 3 years ago • 10 comments

It would be helpful to be able to change the name of the 9p file share. https://github.com/copy/v86/blob/4eb1e5035e91490c5aeebab45553d5043cd84b95/lib/9p.js#L82

For dynamically generating mount tags:

/**
 * @param {string} mountTagName
 */
function genMountTagArray(mountTagName) {
    /**
     * @type {Number[]}
     */
    let _mountTagArray;
    Array.from(mountTagName).forEach(function(char) {
        _mountTagArray.push(char.charCodeAt(0));
    });
    return _mountTagArray;
};

hello-smile6 avatar Jun 08 '22 04:06 hello-smile6

PR would be welcome.

copy avatar Jun 11 '22 01:06 copy

PR would be welcome.

Don't know how to implement it, how can data be passed to lib/9p.js?

hello-smile6 avatar Jun 11 '22 03:06 hello-smile6

I am going to try and implement this

Darin755 avatar Jun 13 '22 22:06 Darin755

Is there a way to compile v86 without rustup?

Darin755 avatar Jun 13 '22 22:06 Darin755

Is there a way to compile v86 without rustup?

Use https://shell.cloud.google.com/ .

hello-smile6 avatar Jun 13 '22 22:06 hello-smile6

Is there a way to compile v86 without rustup?

Shouldn't need the WebAssembly to be compiled, try downloading v86.wasm from copy.sh or a release. As long as you don't touch Rust, it'd probably be backwards-compatible.

hello-smile6 avatar Jun 13 '22 22:06 hello-smile6

Is there a way to compile v86 without rustup?

Use make build/*.js

hello-smile6 avatar Jun 13 '22 22:06 hello-smile6

Thank you

Darin755 avatar Jun 13 '22 23:06 Darin755

PR would be welcome.

Don't know how to implement it, how can data be passed to lib/9p.js?

In cpu.js code:

if(settings.fs9p)
{
     this.devices.virtio_9p = new Virtio9p(settings.fs9p, this, device_bus);
}

So, you can access to Virtio9p class with:

emulator.v86.cpu.devices.virtio_9p

Pixelsuft avatar Jun 14 '22 00:06 Pixelsuft

PR would be welcome.

Don't know how to implement it, how can data be passed to lib/9p.js?

In cpu.js code:

if(settings.fs9p)
{
     this.devices.virtio_9p = new Virtio9p(settings.fs9p, this, device_bus);
}

So, you can access to Virtio9p class with:

emulator.v86.cpu.devices.virtio_9p

https://github.com/copy/v86/blob/facbebc49dbf7c1bcae0b5e15f98a011e2df1071/src/cpu.js#L881-L884

hello-smile6 avatar Jun 14 '22 00:06 hello-smile6