Skip to content
 
 

Repository files navigation

MicroWeb-X DOS web browser

This is an experimental fork of MicroWeb 2.1 originally written by James Howard, and its main goal is exactly that: experimentation!

Screenshot

It started with my attempt to make GIF rendering faster. Then I found myself adding JPEG support, tuning image decoders, optimizing hot paths, and trying to make the browser behave better on real DOS hardware.

MicroWeb is an amazing project, with a clean code style and a very thoughtful structure. This fork is not meant to replace it. It is more of a fast, messy, practical playground for trying things out. Still, I hope that some of the ideas and fixes may eventually prove useful upstream.

So, let’s have fun.

Current release

The current release candidate is 0.1.0-rc1.

This version adds practical PNG and JPEG support, improves image rendering performance, reduces DOS conventional-memory pressure, expands VGA/VESA video mode support, improves networking and downloads, adds Cyrillic text support, and includes stronger diagnostics for testing on real hardware.

Because of the added features, it is best to run MicroWeb-X in a clean DOS environment with as much free conventional memory as possible.

Although the browser can use XMS and EMS, some important data still has to live in conventional memory. The page tree is currently stored there, and PNG decoding also needs a temporary conventional-memory buffer. For this reason, PNG images are currently limited to 64 KB after decompression.

See CHANGELOG.md for the full changelog.

Debug and Release builds

MicroWeb-X is provided in two builds: Release and Debug.

For normal use, the Release build is recommended. It is smaller, uses less memory, and avoids the overhead of additional diagnostics.

If you encounter crashes, rendering glitches, networking problems, or other unexpected behaviour, please try reproducing the issue with the Debug build. When reporting a problem, debug logs are extremely helpful.

A useful diagnostic command line is:

MICROWEB.EXE -debug -netstats -bootlog -memlog

mTCP MTU Setting

If page loading, image loading, or downloads are unusually slow or unreliable, try adjusting the MTU value in MTCP.CFG.

The best value depends on your packet driver, emulator, bridge, SLIRP/NAT setup, and real network hardware. A wrong or overly large MTU can cause fragmentation or packet loss, which is especially noticeable when loading images or larger pages.

For normal Ethernet-like setups, 1500 is usually a good starting point:

MTU 1500

For emulators, SLIRP/NAT, VPNs, bridges, Wi-Fi adapters, or problematic packet-driver setups, smaller values may be more reliable:

MTU 1400

or:

MTU 576

After changing MTCP.CFG, restart MicroWeb-X and test the same page again. If downloads or image loading become more stable, keep the lower MTU for that environment.

Minimum requirements

To run you will need:

  • Intel 8088 or compatible CPU
  • CGA, EGA, VGA, MCGA, SVGA or Hercules compatible graphics card
  • A network interface (it is possible to use your machine's serial port with the EtherSLIP driver)
  • A mouse is desirable but not 100% required
  • 640K RAM is desirable but can run with less
  • Extra memory via XMS or EMS can be used if available and is recommended for loading heavier web pages and images

Limitations

  • HTTP only (See HTTPS limitations below)
  • No CSS or Javascript
  • Large or complex pages may be truncated if there is not enough RAM available
  • Mouse cursor is currently not visible in Hercules mode

Keyboard shortcuts

Key Shortcut
Escape Abort JPEG decoding (can be freezy on 8086)
Ctrl+Q / F10 Exit
Space Scroll down
Shift+Space Scroll up
Ctrl+Space Show context menu (also right click )
F2 Invert screen colours in monochrome modes (useful for old LCD displays)
F3 Toggle title bar / status bar visibility
F5 Reload page
F6 / Ctrl+L Focus address bar
F7 Pump the net (debug)
F10 Exit
Tab / Shift+Tab Cycle through selectable page elements
Enter Follow link / press button
Cursor up/down Scroll page
Page up/down Scroll page in large increments
Home Jump to start of page
End Jump to end of page

Supported video modes

MicroWeb-X supports a wide range of different video modes. You will be asked on startup to select a mode, and one will be suggested based on your detected hardware.

  • 640x200 monochrome (CGA)
  • 640x200 inverse monochrome (Palmtop CGA)
  • 320x200 4 colours (CGA)
  • 320x200 16 colours (Composite CGA)
  • 640x200 16 colours (EGA)
  • 640x350 monochrome (EGA)
  • 640x350 16 colours (EGA)
  • 640x480 monochrome (VGA)
  • 640x480 16 colours (VGA)
  • 320x200 256 colours (VGA)
  • 720x348 monochrome (Hercules)
  • 640x400 monochrome (Olivetti M24)
  • 640x400 monochrome (Toshiba T3100)
  • 240x128 monochrome (HP 95LX)
  • 640x200 16 colours (Amstrad PC1512)
  • 640x400 256 colours (VESA SVGA)
  • 640x480 256 colours (VESA SVGA)
  • 800x600 256 colours (VESA SVGA)
  • 1024x768 256 colours (VESA SVGA)

Command line options

You can use a URL as an argument to load a specific page on startup. This can also be a path to a local HTML file.

Option Effect
-invert Start monochrome modes with inverted screen colours, useful for some LCD monitors
-noems Disable EMS memory usage
-noxms Disable XMS memory usage
-noimages Disable image decoders, useful for very low memory setups
-useswap Experimental disk swapping mode to increase available memory
-translit Render Cyrillic text using transliteration fallback
-linalloc=# Set linear page allocator chunk size, e.g. -linalloc=8k, -linalloc=4k, or -linalloc 8
-jpegbest Use higher quality JPEG colour dithering instead of the faster default palette path
-jpegfast Use the faster JPEG palette path; this is the default
-jpgbest Alias for -jpegbest
-jpgfast Alias for -jpegfast

| -video=# | Skip the video mode selection menu and choose a mode ahead of time, e.g. -video=a |

Debug command line options

These options are mainly intended for testing, benchmarking, memory diagnostics, and hardware troubleshooting.

Option Effect
-memlog Enable memory debug log output
-debugmem Enable memory debug diagnostics
-debug Enable general debug diagnostics
-bootlog Enable early startup / boot diagnostics
-dumppage Dump parsed page/debug page information
-netstats Enable network and image loading statistics
-downloadstats Enable download transfer statistics
-netlegacy Use legacy network pumping behaviour
-pagedrain Use page-drain network/debug mode
-bulkpump=# Enable bulk network pump mode with a specified chunk size, e.g. -bulkpump=8k
-dnssafe Use conservative DNS request mode for unstable packet driver or ARP/DNS setups
-nomouse Disable mouse initialization, useful for startup diagnostics
-nonet Disable network initialization, useful for startup diagnostics

For example MICROWEB -noems http://68k.news will load the 68k.news website on startup but disable the EMS routines

HTTPS limitations

TLS encryption is currently not supported which means that only HTTP servers can be accessed directly. There are some options for HTTPS sites:

  • Use a proxy server such as retro-proxy which converts HTTPS to HTTP. You can configure a proxy server by setting the HTTP_PROXY environment variable before running MicroWeb. e.g. SET HTTP_PROXY=192.168.0.50:8000
  • Use the FrogFind! web service to view a stripped down version of a site. If MicroWeb is redirected to an HTTPS site then it will generate a FrogFind link for your convenience.
  • Webone is working good, just set HTTP_PROXY
  • Added experimental support for Crypto Ancienne

HTTPS through Crypto Ancienne / carl

MicroWeb-X can use Crypto Ancienne through its carl helper to access https:// URLs without doing TLS on the DOS machine itself.

This is different from a rewriting proxy. MicroWeb-X still sends a normal HTTP-style request, but for HTTPS URLs it forwards the full https:// URL to the carl proxy. The proxy performs the TLS connection on a modern machine and returns a plain HTTP response back to MicroWeb-X.

This is useful for old DOS machines that do not have the CPU time or memory needed for TLS, while still keeping the browser side simple.

Building carl

On a modern machine on the same network as the DOS machine:

git clone https://github.com/classilla/cryanc.git
cd cryanc
gcc -O3 -o carl carl.c

You can test it directly with:

./carl -i https://example.com/

Running carl through socat

carl is not a long-running proxy server by itself. It is designed to handle one request through standard input and standard output, so it needs to be run behind a small TCP wrapper such as socat.

A convenient setup is to create a small wrapper script.

Create carl-wrap.sh:

#!/bin/sh

/home/dmitry/cryanc/carl -t -p -s 2>>/tmp/carl.err
rc=$?

echo "$(date) carl exited rc=$rc" >> /tmp/carl-exit.log

exit 0

Make it executable:

chmod +x /home/dmitry/cryanc/carl-wrap.sh

Then create run.sh:

socat -d -d TCP-LISTEN:8765,bind=0.0.0.0,reuseaddr,fork EXEC:/home/dmitry/cryanc/carl-wrap.sh

Run it:

./run.sh

The -p option puts carl into proxy mode. The -s option makes replies friendlier for old HTTP/1.0 clients. The -t option disables the default timeout, which is useful when testing from slow machines or emulators.

The wrapper always exits with status 0, even if one particular carl request fails. This prevents a single bad URL or failed TLS request from stopping the whole socat listener.

You can check the logs with:

tail -f /tmp/carl-exit.log /tmp/carl.err

Configuring MicroWeb-X

On the DOS machine, set CRYPTO_PROXY to the IP address and port of the machine running carl.

For example, if the proxy machine is 192.168.1.14 and socat is listening on port 8765:

SET CRYPTO_PROXY=192.168.1.14:8765
MICROWEB.EXE https://example.com/

When CRYPTO_PROXY is set, MicroWeb-X will send https:// requests to the Crypto Ancienne proxy instead of trying to connect directly to port 443.

Internally, the request sent to the proxy looks like this:

GET https://example.com/ HTTP/1.0
Host: example.com
User-Agent: MicroWeb-X
Connection: close

The DOS machine only talks plain HTTP to the proxy. The TLS connection is handled by carl on the modern machine.

Testing the proxy from another machine

You can test the proxy without MicroWeb-X by sending a raw request:

printf 'GET https://example.com/ HTTP/1.0\r\nHost: example.com\r\nConnection: close\r\n\r\n' | nc 192.168.1.14 8765

If the proxy is working, it should return a normal HTTP response and the HTML from example.com.

Security notes

Do not expose this proxy to the public internet. The example above listens on 0.0.0.0, which means all network interfaces. This is convenient on a local network, but it can become an open proxy if the port is reachable from outside.

Use it only on a trusted LAN, or restrict access with a firewall.

Crypto Ancienne / carl is intended as a practical compatibility layer for old machines. It should not be treated as a full high-security TLS solution.

Getting started

Check out the releases page which will include a pre-built binary. Also available are FreeDOS boot disk images for 360K and 720K floppies, which are configured to work with a NE2000 network adapter. These boot images can be used in an emulator such as PCem.

Network setup

MicroWeb uses Michael Brutman's mTCP networking library for the network stack. You will need a DOS packet driver relevant to your network interface. You can read more about configuring DOS networking here

Build instructions

To build you will need the OpenWatcom 1.9 C++ compiler. Use OpenWatcom's wmake to build the makefile in the project/DOS folder. Currently only builds in a Windows environment.

About

MicroWeb fork for 8086+ DOS machines with new features and cyrillic support

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages