We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how do i upload files into v86? speciffically ms-dos
i tried:
document.getElementById("u").onchange = function(e) { var files = e.target.files; for (var i = 0; i < files.length; i++) { var reader = new FileReader(); reader.onload = function(file) { return function(e) { var data = (new TextEncoder('UTF-8')).encode(e.target.result); emu.create_file("/" + file.name, data); console.log("uploaded " + file.name); }; }(files[i]); reader.readAsText(files[i]); } };
full code:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="lib/libv86.js"></script> <style> html, body { background-color: #000; overflow: hidden; } canvas { display: block; width: 100%; height: 100%; } </style> </head> <body> <div id="m_s"> <div style="white-space: pre; font: 14px monospace"></div> <canvas style="display: none"></canvas> <input type="file" id="u" style="display:none"> </div> <script> onload = function() { var emu = window.emu = new V86({ wasm_path: "lib/v86.wasm", bios: { url: "bios/seabios.bin" }, vga_bios: { url: "bios/vgabios.bin" }, hda: { url: "os/msdos.img", size: 1 * 1024 * 1024 * 1024, async: true }, memory_size: 512 * 1024 * 1024, screen_container: m_s, autostart: true, }); } document.addEventListener("contextmenu", function(event) { event.preventDefault(); document.getElementById("u").click(); }); document.getElementById("u").onchange = function(e) { var files = e.target.files; for(var i = 0; i < files.length; i++) { var reader = new FileReader(); reader.onload = function(file) { return function(e) { var data = (new TextEncoder('UTF-8')).encode(e.target.result); emu.create_file("/user/" + file.name, data); console.log("uploaded " + file.name); }; }(files[i]); reader.readAsText(files[i]); } }; </script> </body> </html>
i got this code from another issue but i believe it only works with 9p. if you run it the console doesnt print any errors though
Any help is appreciated!
The text was updated successfully, but these errors were encountered:
MS-DOS doesn't have a 9p driver, so this won't work.
There isn't a general mechanism for sharing files with a MS-DOS VM. Here's an idea, but it's not implemented: #824
Sorry, something went wrong.
i see. thanks!
No branches or pull requests
how do i upload files into v86?
speciffically ms-dos
i tried:
full code:
i got this code from another issue but i believe it only works with 9p.
if you run it the console doesnt print any errors though
Any help is appreciated!
The text was updated successfully, but these errors were encountered: