Skip to content

Commit

Permalink
Merge branch 'copy:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammerIn-wonderland authored Sep 16, 2024
2 parents 7c74a9d + 58d4336 commit a24323d
Show file tree
Hide file tree
Showing 53 changed files with 1,069 additions and 1,082 deletions.
File renamed without changes.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Issue
about: Bug reports or feature requests
title: ''
labels: ''
assignees: ''

---

<!--
Welcome to v86's issue tracker!
We use this tracker for bug reports or feature requests. For user support, questions or general comments, use the chat at https://gitter.im/copy/v86 or the forum at https://github.com/copy/v86/discussions
Please don't ask for support for any version of Windows. There are many existing issues at https://github.com/copy/v86/issues?q=is%253Aissue+windows. See also docs/windows-xp.md.
Before reporting OS incompatibilities, check existing issues and the compatibility section of the readme.
When reporting issues, please provide the following information:
- Version of v86 (see the bottom of index.html or the output of `git describe --tags HEAD`)
- Browser/OS
- The browser's console output: Open debug.html and press ctrl+shift+k (firefox) or ctrl+shift+j (chromium)
- If relevant, upload the disk images to allow developers to reproduce the problem locally
-->
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

- name: Download uncached images
if: steps.cache-images.outputs.cache-hit != 'true'
run: wget -nv -P images/ https://i.copy.sh/{linux.iso,linux3.iso,linux4.iso,buildroot-bzimage.bin,TinyCore-11.0.iso,oberon.img,msdos.img,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img,mobius-fd-release5.img}
run: wget -nv -P images/ https://i.copy.sh/{linux.iso,linux3.iso,linux4.iso,buildroot-bzimage68.bin,TinyCore-11.0.iso,oberon.img,msdos.img,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img,mobius-fd-release5.img}

- name: Run api-tests
run: make api-tests
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ CARGO_FLAGS=$(CARGO_FLAGS_SAFE) -C target-feature=+bulk-memory -C target-feature
CORE_FILES=const.js config.js io.js main.js lib.js buffer.js ide.js pci.js floppy.js \
memory.js dma.js pit.js vga.js ps2.js rtc.js uart.js \
acpi.js apic.js ioapic.js \
state.js ne2k.js sb16.js virtio.js virtio_console.js bus.js log.js \
cpu.js debug.js \
state.js ne2k.js sb16.js virtio.js virtio_console.js virtio_net.js \
bus.js log.js cpu.js debug.js \
elf.js kernel.js
LIB_FILES=9p-filer.js filesystem.js jor1k.js marshall.js
BROWSER_FILES=screen.js keyboard.js mouse.js speaker.js serial.js \
Expand Down Expand Up @@ -250,9 +250,9 @@ $(CLOSURE):
# don't upgrade until https://github.com/google/closure-compiler/issues/3972 is fixed
wget -nv -O $(CLOSURE) https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/v20210601/closure-compiler-v20210601.jar

build/integration-test-fs/fs.json:
build/integration-test-fs/fs.json: images/buildroot-bzimage68.bin
mkdir -p build/integration-test-fs/flat
cp images/buildroot-bzimage.bin build/integration-test-fs/bzImage
cp images/buildroot-bzimage68.bin build/integration-test-fs/bzImage
touch build/integration-test-fs/initrd
cd build/integration-test-fs && tar cfv fs.tar bzImage initrd
./tools/fs2json.py build/integration-test-fs/fs.tar --out build/integration-test-fs/fs.json
Expand Down Expand Up @@ -307,6 +307,7 @@ devices-test: all-debug
./tests/devices/virtio_9p.js
./tests/devices/virtio_console.js
./tests/devices/fetch_network.js
USE_VIRTIO=1 ./tests/devices/fetch_network.js
./tests/devices/wisp_network.js

rust-test: $(RUST_FILES)
Expand Down
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ for a full setup on Debian or
The disk images for testing are not included in this repository. You can
download them directly from the website using:

`wget -P images/ https://i.copy.sh/{linux3.iso,linux.iso,linux4.iso,buildroot-bzimage.bin,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img}`
`wget -P images/ https://i.copy.sh/{linux3.iso,linux.iso,linux4.iso,buildroot-bzimage68.bin,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img}`

Run integration tests: `make tests`

Expand Down Expand Up @@ -207,6 +207,7 @@ repository under their own licenses:
- [Berkeley SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is included to precisely emulate 80-bit floating point numbers
- [The jor1k project](https://github.com/s-macke/jor1k) for 9p, filesystem and uart drivers
- [WinWorld](https://winworldpc.com/) sources of some old operating systems
- [OS/2 Museum](https://www.os2museum.com/) sources of some old operating systems

## More questions?

Expand Down
17 changes: 8 additions & 9 deletions debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"const.js config.js log.js lib.js buffer.js cpu.js debug.js " +
"io.js main.js ide.js pci.js floppy.js " +
"memory.js dma.js pit.js vga.js ps2.js rtc.js uart.js acpi.js apic.js ioapic.js sb16.js " +
"ne2k.js state.js virtio.js virtio_console.js bus.js elf.js kernel.js";
"ne2k.js state.js virtio.js virtio_console.js virtio_net.js bus.js elf.js kernel.js";

var BROWSER_FILES = "main.js screen.js keyboard.js mouse.js speaker.js serial.js network.js fake_network.js fetch_network.js starter.js worker_bus.js print_stats.js filestorage.js";
var BROWSER_FILES = "main.js screen.js keyboard.js mouse.js speaker.js serial.js network.js fake_network.js fetch_network.js wisp_network.js starter.js worker_bus.js print_stats.js filestorage.js";
var LIB_FILES = "";

// jor1k stuff
LIB_FILES += " jor1k.js 9p.js filesystem.js marshall.js utf8.js";
LIB_FILES += " jor1k.js 9p.js filesystem.js marshall.js";

var BUILD_FILES = "capstone-x86.min.js libwabt.js";

Expand Down Expand Up @@ -136,11 +136,6 @@ <h4>Debugger</h4>
<hr>

<table>
<tr>
<td><label for="bios">BIOS</label></td>
<td><input type="file" id="bios"><br></td>
</tr>

<tr>
<td width="350"><label for="cd_image">CD image</label></td>
<td>
Expand Down Expand Up @@ -177,6 +172,11 @@ <h4>Debugger</h4>
<td><input type="file" id="initrd"><br></td>
</tr>

<tr>
<td><label for="bios">BIOS</label></td>
<td><input type="file" id="bios"><br></td>
</tr>

<tr>
<td colspan="2"><small>Disk images are not uploaded to the server</small><hr></td>
</tr>
Expand Down Expand Up @@ -329,7 +329,6 @@ <h4>Debugger</h4>
<b>VGA</b><br>
Mode: <span id="info_vga_mode"></span><br>
Resolution: <span id="info_res">-</span><br>
BPP: <span id="info_bpp">-</span><br>
<br>
Mouse: <span id="info_mouse_enabled">No</span><br>
</div>
Expand Down
18 changes: 18 additions & 0 deletions docs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ throttling built-in by default which will degrade the networking.
`bellenottelling/websockproxy`docker image has this throttling removed via
[websockproxy/issues/4#issuecomment-317255890](https://github.com/benjamincburns/websockproxy/issues/4#issuecomment-317255890).

### fetch-based networking

v86 supports an experimental networking mode, which is enabled by specifying
`"fetch"` as the relay url. In this mode, no external relay is used and packets
are parsed internally by v86. DHCP and ARP requests are handled by an internal
router, and HTTP requests are translated into calls to `fetch` (which only
works on [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)-enabled
hosts). Additionally, NTP, ICMP pings and UDP echo packets are handled to a
certain degree. See [#1061](https://github.com/copy/v86/pull/1061) for some
technical details.

### wisp networking

v86 also supports the [wisp
protocol](https://github.com/MercuryWorkshop/wisp-protocol) as a networking
proxy. Wisp servers can be specified with the `wisp://` or `wisps://` prefix.
See #1097 for some information.

### Interaction with state images

When using state images, v86 randomises the MAC address after the state has
Expand Down
2 changes: 1 addition & 1 deletion examples/lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
url: "../bios/vgabios.bin",
},
bzimage: {
url: "../images/buildroot-bzimage.bin",
url: "../images/buildroot-bzimage68.bin",
},
autostart: true,
disable_keyboard: true,
Expand Down
3 changes: 1 addition & 2 deletions examples/serial.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
url: "../bios/vgabios.bin",
},
bzimage: {
url: "../images/buildroot-bzimage.bin",
size: 5166352,
url: "../images/buildroot-bzimage68.bin",
async: false,
},
filesystem: {},
Expand Down
16 changes: 13 additions & 3 deletions examples/two_instances.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
url: "../bios/vgabios.bin",
},
cdrom: {
url: "../images/linux.iso",
url: "../images/linux4.iso",
},
autostart: true,
});
Expand All @@ -35,7 +35,7 @@
url: "../bios/vgabios.bin",
},
cdrom: {
url: "../images/linux.iso",
url: "../images/linux4.iso",
},
autostart: true,
});
Expand Down Expand Up @@ -76,7 +76,17 @@
};
</script>

Click on a screen to control it.<hr>
To set up networking:
<pre>
# first VM
ifconfig eth0 up arp 10.5.0.2

# second VM
ifconfig eth0 up arp 10.5.0.3
ping 10.5.0.2
</pre>
Click on a screen to control it.
<hr>

<div id="screen_container1" style="float: left; margin: 10px; border: 3px solid yellow;">
<div style="white-space: pre; font: 14px monospace; line-height: 14px"></div>
Expand Down
10 changes: 4 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ <h4>Select profile</h4>
<hr>
<h4>Setup</h4>
<table>
<tr>
<td><label for="bios">BIOS</label></td>
<td> <input type="file" id="bios"><br></td>
</tr>

<tr>
<td width="350"><label for="cd_image">CD image</label></td>
<td>
Expand Down Expand Up @@ -107,6 +102,10 @@ <h4>Setup</h4>
<td><input type="file" id="initrd"><br></td>
</tr>

<tr>
<td><label for="bios">BIOS</label></td>
<td> <input type="file" id="bios"><br></td>
</tr>

<tr>
<td colspan="2"><small>Disk images are not uploaded to the server</small><hr></td>
Expand Down Expand Up @@ -247,7 +246,6 @@ <h4>Setup</h4>
<b>VGA</b><br>
Mode: <span id="info_vga_mode"></span><br>
Resolution: <span id="info_res">-</span><br>
BPP: <span id="info_bpp">-</span><br>
<br>
Mouse: <span id="info_mouse_enabled">No</span><br>

Expand Down
4 changes: 1 addition & 3 deletions lib/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ FS.prototype.HandleEvent = function(id) {
this.events = newevents;
};

FS.prototype.load_from_json = function(fs, done)
FS.prototype.load_from_json = function(fs)
{
dbg_assert(fs, "Invalid fs passed to load_from_json");

Expand All @@ -183,8 +183,6 @@ FS.prototype.load_from_json = function(fs, done)
//{
// this.Check();
//}

done && done();
};

FS.prototype.LoadRecursive = function(data, parentid)
Expand Down
3 changes: 1 addition & 2 deletions nodejs-loader.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let files = [
"src/sb16.js",
"src/virtio.js",
"src/virtio_console.js",
//"src/virtio_net.js",
"src/virtio_net.js",
//"src/virtio_balloon.js",
"src/bus.js",

Expand All @@ -50,7 +50,6 @@ let files = [
"lib/filesystem.js",
"lib/jor1k.js",
"lib/marshall.js",
"lib/utf8.js",

"src/browser/screen.js",
"src/browser/keyboard.js",
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "v86",
"version": "0",
"license": "BSD-2-Clause"
}
Loading

0 comments on commit a24323d

Please sign in to comment.