111 Commits
Author SHA1 Message Date
Fabian 697a442bf7 add network "none" type 2026-06-09 14:34:50 +07:00
Fabian 34c5a68a41 hide mtu option if ne2k is selected 2026-06-09 14:34:50 +07:00
Christian Schnell 5d6f2a0925 removed off-by-one UART indexing
Throughout the Modem-related code, UART0 now has index 0, UART1 has index 1, and so on.
2026-04-30 01:56:06 +07:00
Christian Schnell 948ce0eaa3 redefined modem uart numbering scheme
New uart number scheme:
- 0: disable Modem (no UART)
- 1: use UART0 (COM1)
- 2: use UART1 (COM2)
- 3: use UART2 (COM3)
- 4: use UART3 (COM4)

This new scheme is used in the web UI and in the modem configuration, only the Modem class maps the uart number x to UARTx-1.

In starter.js, a Modem object is instantiated only if the uart number is not 0 (or undefined).

Also:
- added query parameter for modem (uart number) in main.js
- removed UART0 from web UI (reserved for serial connection) in index.html and debug.html
2026-04-30 01:56:06 +07:00
Christian Schnell ccde2eaa2d added serial modem device
- added new files "modem.js" and its documentation "modem.md"
- added new debug log type LOG_MODEM
- integrated Modem device into V86 options and web interface
2026-04-30 01:56:06 +07:00
Fabian 17281c46e4 refactor file selection 2026-02-02 11:36:30 +07:00
Fabian 6ce8a3bea3 use <button> over <input type=button> 2026-02-02 11:36:30 +07:00
ading2210 0beafeee07 add mtu and nic type options to the interface 2025-11-26 07:56:22 -06:00
Fabian c1785b724f change text in html 2025-08-25 15:03:49 -06:00
SuperMaxusa a25e7181d5 forEach -> for, fit to viewport when the virtual keyboard is displayed 2025-08-23 10:57:57 -06:00
SuperMaxusa 519480d4cd add theatre mode 2025-08-23 10:57:57 -06:00
Christian Schnell 196001e956 integrated new floppy features into v86 web ui
Changes in index.html and debug.html:
- added fdb image selector
- added empty disk options for fda and fdb (constrained to 160..3840 KB, default: 1440 KB)
- added insert/eject button for fdb

Revised floppy controller API in starter.js (and main.js):
- V86.set_fda(file)
- V86.set_fdb(file)     // new
- V86.eject_fda()
- V86.eject_fdb()       // new
- V86.get_disk_fda()    // new, return disk buffer or null if drive is empty
- V86.get_disk_fdb()    // new
2025-08-23 10:14:32 -06:00
Fabian a4b86d85e2 create empty disks and second hard drive 2025-06-10 17:45:00 +07:00
Christian Schnell 694537f51e added "Insert/Eject CD" button to debug.html 2025-06-07 21:33:46 +07:00
Fabian 862ea200b9 move DEBUG magic into log.js, remove nodejs-loader.js (use src/main.js instead) 2025-04-16 09:26:13 -07:00
Fabian c11805a70a minor cleanup of imports 2025-04-16 09:26:13 -07:00
SuperMaxusa f97330d99e VGA BIOS input (#1307) 2025-04-15 07:42:43 +02:00
Rob Blanckaert a9219613af Switch to es6 modules. 2025-04-06 08:53:49 -07:00
Rob Blanckaert 2b162b1e85 Virtio balloon 2025-02-02 12:36:37 -07:00
Fabian bbfeeb63e0 s/Virtual x86/v86 2024-10-07 08:31:40 -06:00
Christian 1afc297f8b Add VGA graphical text mode (#1123)
* Revert "Add VGA graphical text mode"

This reverts commit f92e6b4b55.

* started 2nd iteration of graphical text mode

* fixed eslint complaints

* include changes to main.js and cpu.js from f92e6b4, fix eslint error

* added new methods in ScreenAdapter to DummyScreenAdapter

* include changes to starter.js from f92e6b4

* changed text attribute BLINKING to FLAGS, introduced flags for BLINKING and FONT_PAGE_A

* added support for cursor and blinking, made ScreenAdapter.FLAGS_* visible for VGAScreen

* Variuos improvements and fixes.

- improved implementation of the three display modes in ScreenAdapter
- improved animation frame control (replaced "ScreenAdapter.stopped" with "cancelAnimationFrame()")
- added method ScreenAdapter.grab_text_content() with documentation
- fixed double-width (16px) font
- improved detecting font plane 2 write access in VGAScreen (still work in progress)

* fixed issues detected by eslint

* fixed classical text mode

* optimization: do not copy buffer to canvas when it's unmodified

* invalidate all text rows when entering graphical text mode

* Made sure that complete_redraw() is called whenever the state that put_char() depends on is modified.

Method VGAScreen.put_char() depends on:

1. screen-wide BLINK_ENABLE bit
2. screen-wide PAGE_AB_ENABLE bit
3. VGAScreen.vga256_palette[]
4. VGAScreen.dac_mask
5. VGAScreen.dac_map

For 1, 3 and 5 this was already the case.

Added call to VGAScreen.complete_redraw() when PAGE_AB_ENABLE is changed.

Added call to VGAScreen.complete_redraw() when VGAScreen.dac_map is changed.

Added logic to mask out most significant foreground color bit if screen-wide PAGE_AB_ENABLE is true.

* removed leftover comment

* added new VGAScreen state variable font_page_ab_enabled to state[]

* render internal font less often but more aggressively

* fixed bug in ScreenAdapter.set_font_bitmap()

* refactored ScreenAdapter

- moved declarations of constants, member variables and methods into separate groups
- moved scattered initialization code into init() method
- removed redundant members and initialization code
- refactored timer() method to simplify and clarify code
- made control flow depend on three-state variable "mode" only

* fixed bug in restoring state of graphical text: font_page was missing

* restored accidentally lost cleanup code from commit f92e6b4

* narrowed scope of some variables

* removed obsolete compatibility attributes from graphic_context

* removed redundant initialization call to ScreenAdapter.set_mode()

* allow overriding private member charmap[] to support external codepage mappings

Introduce support for externally defined codepage mappings wherever charmap[] is used.

- added member charmap_default[] with former content of charmap[]
- made charmap[] initially point to charmap_default[]
- added method set_charmap() to override or fall back to charmap_default[]

* merged grab_text_content() into get_text_row()/get_text_screen()

* removed comment as suggested

* replaced boolean options.disable_autoscale with number options.scale

options.scale defines the initial value for ScreenAdapter.scale_x and ScreenAdapter.scale_y.

If undefined, options.scale defaults to 1.

If options.scale is set to 0, 2x-upscale, scale_x, scale_y and HiDPI-adaption (window.devicePixelRatio) are all disabled in all three modes, they are in the responsibilty of host applications that define options.scale to be 0.

* changed render_font_bitmap() to return void, reduced reallocation of font_bitmap[]

* added guard to ensure that set_font_bitmap() is only called in text mode

* changed text rendering method to glyph-blitting using canvas.drawImage()

- replaced pixel-drawing with glyph-blitting
- removed graphical_text_buffer
- added 3 OffscreenCanvas objects for font bitmap, screen canvas and row helper
- left state of canvas context ScreenAdapter.graphic_context untouched

* improved cursor rendering

* improved foreground color handling

* minor changes

* improved rendering of invisible glyphs

An invisible glyph could be an ASCII Space (0x20) or Null (0x0) character, or any other empty glyph loaded into the VGA's font memory.

Invisible glyphs (which are not rare) are currently drawn to the canvas exactly like regular glyphs, this patch handles that more efficiently.

- added array with per-glyph visibility attribute
- added invisible glyph detection in render_font_bitmap()
- instead of drawing invisible glyphs in render_changed_rows(), now erase whole row buffer once per row and just skip invisible glyphs
- removed one nested loop from render_font_bitmap()

Characters hidden on screem caused by their blink attribute (rare) are also treated as invisible.

* improved vga bit handling readabilty
2024-10-07 06:38:05 +02:00
chschnell f92e6b4b55 Add VGA graphical text mode 2024-09-21 19:08:38 -06:00
Fabian a7563e0d35 s/networking_proxy/relay_url 2024-09-20 23:08:03 -06:00
Fabian ca7fe7542c refactor query parameter handling
- create query parameters for memory size, mute, acpi, boot order and networking proxy
- allow overwriting memory size, boot and acpi order for profiles
2024-09-20 23:02:13 -06:00
Fabian 49865ebbc6 refactor frontpage loading of profiles 2024-09-20 17:09:15 -06:00
Fabian 8f79a11cd8 javascript should be made as simple as possible, but not simpler 2024-09-20 16:16:35 -06:00
Fabian 63883143de remove dead profile 2024-09-17 14:55:21 -06:00
Rob Blanckaert 58d4336149 virtio_net device 2024-09-15 16:52:18 -06:00
Fabian e1d55a7390 remove references to utf8.js 2024-09-15 16:52:18 -06:00
Fabian 860de55db8 refactor vga code
- stop using bus for internal calls
- replace emulator.automatically with emulator.wait_until_vga_screen_contains
- remove stats
- remove graphical_mode_is_linear (unused)
2024-09-15 16:31:48 -06:00
Fabian 56498d6ce2 add wisp_network.js to debug.html 2024-09-12 21:31:40 -06:00
Fabian 981a8bcb78 move bios selector down 2024-09-12 21:31:40 -06:00
donno2048 23d279c26d add bios input 2024-08-24 10:42:56 -06:00
Rob Blanckaert 858f24537f Split out fake networking from fetch logic
Splits out the ethernet / tcp emulation logic
from the fetch networking adapter for reuse
in wisp.
2024-08-21 05:48:27 -06:00
Rob BlanckaertandFabian 92c936d632 network: Fetch based browser networking (#1061)
Emulate a networking stack, intercept HTTP requests, serve
them with fetch().  Enable by setting networking_proxy=fetch

Somewhat fixes #198

Just enough networking for http to work for package managers and
net-boot. The networking stack just reflects the macaddress of
packets it receives, so shouldnt be bothered by mac address
changes. Services include:

- ARP replies by establishing the gateways IP
- DHCP server sending gateway, dns, and client-ip
  - Gateway: 192.168.86.1
  - Client: 192.168.86.100
  - Netmask: 255.255.255.0
- UDP DNS server, all addresses resolve to: 192.168.87.1
- NTP Server, giving out the current time from Date()
- Replies to ICMP pings to any IP address
- UDP echo server on port 8

Limitations:
- Request are limited by CORS rules, but CORS-proxies can work around
  this.
- Redirects are handled transparently by fetch. The upside is sites that
  force an http->https upgrade appear to the VM to work over http.

Future Work:
- Allow HTTP requests from browser to be served by VM.
- HTTPS support (maybe with help of a rust based TLS stack in WASM)
- Support for POSTing binary data

* Run devices tests in CI
* Allow multiple Ne2k adapters

Co-authored-by: Fabian <[email protected]>
2024-07-24 16:22:53 +02:00
Rob Blanckaert 7660cbfb64 Implement Virtio Console device. (#949)
Implements a virtio console device. This allows
reading and writing buffers in bulk as well as
a channel to communicate terminal size updates.
2024-01-09 05:12:32 +01:00
Fabian 55f1c32ab9 delete old hpet code 2023-12-14 17:22:17 -05:00
Fabian 24eb27bf61 port pic to rust (XXX: missing state) 2023-12-14 17:22:17 -05:00
Fabian feb47174d1 Words 2023-10-07 12:59:16 -05:00
Fabian 3068a8de78 clean up dead stuff 2023-08-31 13:59:51 -06:00
Fabian 8c0448909e UI for floppy insertion/ejection 2023-08-26 02:11:03 +02:00
Fabian ab0227dd72 Infer boot order if not specified 2023-08-26 02:11:03 +02:00
Fabian 53098adc5c Delete src/browser/lib.js, move remaining code to lib.js 2022-09-19 22:24:09 +08:00
Fabian e0d4e1808b Move buffer code around 2022-09-19 22:24:09 +08:00
Fabian aebf5eced8 Add Windows NT 2022-09-14 00:32:19 +09:00
Fabian 5ea85077cc Dead code 2022-09-13 14:57:18 +09:00
Fabian d92ea3f9de words 2022-08-02 21:40:57 +09:00
Fabian 00d2b35222 Allow capturing network traffic and loading it in wireshark 2022-08-02 21:40:57 +09:00
pixelsuft‮ 99736f2f68 Screenshot For Text Mode (#671) 2022-06-03 13:40:59 +02:00
Fabian 193ec30038 Add bzimage/initrd to UI 2022-03-10 21:46:57 +01:00