commit | ea5d1f54efe025902d3472a4b2bdfb501dfb6f52 | [log] [download] |
---|---|---|
author | Ernest Wong <ewon521@gmail.com> | Fri Feb 09 18:37:50 2018 +1300 |
committer | Fabian <copy@copy.sh> | Fri Feb 09 16:50:32 2018 -0600 |
tree | b07cebb8bec40e249e3287e3e071749700b7a350 | |
parent | 27af33e295b09289b1d6e3aac7122c314e06b55b [diff] |
Handle simultaneous kbd and mouse streams Continuing from PR #184, fixes #182. Two main changes: 1. Pulse the interrupt lines to ensure rising edge. Some say that the controller clears the interrupt lines themselves after a small delay to create a pulse: - http://www.os2museum.com/wp/ibm-ps2-model-50-keyboard-controller/ - https://wiki.osdev.org/8259_PIC#What_does_the_8259_PIC_do.3F (paragraph 1) although that contradicts with: - Section "Reading Keyboard Input" paragraph 3 http://www.computer-engineering.org/ps2keyboard/#General%20Description%20FN where they say the interrupts are cleared only after reading port 0x60. Could possibly be because they are referring to the older AT keyboard controller. 2. Wait until current byte has been read via port 0x60 before changing between kbd and mouse queues. In hardware terms: inhibit kbd and mouse communication, and don't overwrite the DBBOUT output buffer until OBF is cleared. Interesting reading: - Section "Reading Keyboard Input" paragraph 1 http://www.computer-engineering.org/ps2keyboard/#General%20Description%20FN - Disassembly "Main Entry" $0102 http://www.halicery.com/8042/8042_1503033.TXT Unlike PR #184, this gives kbd data priority over mouse data (as it used to), and this seems to avoid requiring timers to expire abandoned bytes.
Using v86 for your own purposes is as easy as:
var emulator = new V86Starter({ screen_container: document.getElementById("screen_container"), bios: { url: "../../bios/seabios.bin", }, vga_bios: { url: "../../bios/vgabios.bin", }, cdrom: { url: "../../images/linux.iso", }, autostart: true, });
See API.
v86 emulates an x86-compatible CPU and hardware. Here's a list of emulated hardware:
The disk images are not included in this repository. You can download them directly from the website using:
wget -P images/ https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img}
.
A testsuite is available in tests/full/
. Run it using node tests/full/run.js
.
make build/v86_all.js
.index.html
locally, make sure to serve it from a local webserver. You can use make run
to serve the files using Python's SimpleHTTPServer.wget -P images/ https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img}
.Short summary:
# grab the main repo git clone https://github.com/copy/v86.git && cd v86 # grab the disk images wget -P images/ https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img} # grab closure compiler wget -P closure-compiler https://dl.google.com/closure-compiler/compiler-latest.zip unzip -d closure-compiler closure-compiler/compiler-latest.zip *.jar # build the library make build/libv86.js # run the tests ./tests/full/run.js
Here's an overview of the operating systems supported in v86:
udev
and X
fail, but you get a terminal.You can get some infos on the disk images here: https://github.com/copy/images.
Simplified BSD License, see LICENSE, unless otherwise noted.
Shoot me an email to copy@copy.sh
. Please don't tell about bugs via mail, create a bug report on GitHub instead.
Fabian Hemmer (http://copy.sh/, copy@copy.sh
)