# MS-DOS console: corresponding source

The MS-DOS console serves GPL and LGPL binaries to every player's browser
(`bios/seabios.bin`, `bios/vgabios.bin`, and the FreeDOS kernel, shell and
boot sector inside `freedos-base.img`). Their complete corresponding source is
served from this folder, at the same place as the binaries, so anyone who
receives a binary can fetch its source the same way. The written offer on
[/legal/licenses](/legal/licenses) stands as well.

| Archive (served at `/retro-engines/dos/source/`) | Bytes | sha256 | Source of | Upstream |
| --- | --- | --- | --- | --- |
| `seabios-1.16.2.tar.gz` | 635,918 | `efa8d529442ad168056f94ac6666b1b3543c62ff7af6d9e020561f4d0e32f959` | `bios/seabios.bin` and `bios/vgabios.bin` (SeaBIOS and SeaVGABIOS) | <https://www.seabios.org/downloads/seabios-1.16.2.tar.gz>, the SeaBIOS 1.16.2 release (git tag `rel-1.16.2`) |
| `v86-679ecd2e-seabios.config` | 2,148 | `0edc4229d66686e6262009db2dde7a612521f0c68c137c38baf2a1d8c539f96c` | the build configuration both BIOS files were built with | <https://github.com/copy/v86/blob/679ecd2e72e526aece064dfdb5efba0e56fe401b/bios/seabios.config> |
| `v86-679ecd2e-fetch-and-build-seabios.sh` | 371 | `057856a817ae3dc85b18dc00f19274f6e877e6f28a36dce1afc5be751739e24a` | the script that built them (BSD-2-Clause, part of v86) | <https://github.com/copy/v86/blob/679ecd2e72e526aece064dfdb5efba0e56fe401b/bios/fetch-and-build-seabios.sh> |
| `fdos-kernel-ke2045.tar.gz` | 626,913 | `b3df13fae8422214c2ea47eb1a9a68d3283b3130a3f4fe8f4b8e037f1266b5f6` | `kernel.sys` (FreeDOS kernel ke2045) | <https://github.com/FDOS/kernel/archive/refs/tags/ke2045.tar.gz> |
| `fdos-kernel-ke2038-boot.asm` | 17,782 | `1a1c1194fae602fff61fd3de8a9bace158cc940d49bbe375a902ed40dc9bc2c4` | the FreeDOS FAT12 boot sector in `freedos-base.img` (the first 512 bytes of v86's `freedos722.img`; see below) | <https://sourceforge.net/p/freedos/svn/1384/tree/kernel/tags/ke2038/boot/boot.asm?format=raw>, `boot/boot.asm` of the FreeDOS kernel at tag `ke2038` |
| `fdos-kernel-ke2038-boot-makefile` | 539 | `5bad89ea14014eaae99b4748ab826f4ad1384ebce5006f45d876c3b9256baccb` | the build rule for that sector (`nasm -dISFAT12 boot.asm -ofat12com.bin`) | <https://sourceforge.net/p/freedos/svn/1384/tree/kernel/tags/ke2038/boot/makefile?format=raw> |
| `fdos-freecom-com086.tar.gz` | 798,383 | `315ce8d1e7f225b977077d00f94a1904ed8787c00e7885caeb842c178b1f97be` | `command.com` (FreeCOM 0.86) | <https://github.com/FDOS/freecom/archive/refs/tags/com086.tar.gz> |

The files were downloaded from the upstream addresses above on
15 November 2026 and are served unchanged (the two ke2038 files keep their
upstream CRLF line endings).

## Which source the boot sector was built from

The boot sector is not recorded with a version where it was taken from, so it
was matched by what it does. Read from its bytes, the shipped sector (sha256
`ef68bcdb99760f83b636cbf0f07f395ae7dff5b96767fee86a939339975c2d6c`) copies
itself to `1FE0:7C00`, prints `FreeDOS`, reads the root directory, follows the
FAT12 cluster chain of `KERNEL.SYS`, reads through INT 13h extensions when the
BIOS has them and by cylinder, head and sector otherwise, and after a failed
read resets the drive and reads the same sector again; on an error it prints
` err` and waits for a key.

- `boot/boot.asm` at the GitHub tags `ke2042` to `ke2046`, and at the 2012
  import of the 2041 kernel, prints `Error!` and stops on a failed read
  (`jc boot_error`). Those versions are not the shipped sector.
- `boot/boot.asm` at the Subversion tags `ke2039`, `ke2040` and `ke2041`
  prints `Error!` and stops on a failed read as well.
- `boot/boot.asm` at the Subversion tag `ke2038`, assembled with `ISFAT12`,
  holds the shipped sector's instructions in the same order: the copy loop,
  `call print` / `db "FreeDOS",0`, the root directory scan, the FAT12 chain,
  `db " err",0` with `int 0x16` and `int 0x19`, the `readDisk` routine with
  `ah = 41h` and `ah = 42h`, and `jnc read_ok` / `xor ah, ah` / `int 0x13` /
  `jmp short read_next`. Its `KERNEL  SYS` name sits at offset `0x1F1`, as in
  the sector.

The match was made by reading the instructions, not by reassembling the file
and comparing bytes. Bytes 3 to 61 of the sector (the OEM name, the disk
parameters, the serial number and the volume label) are the floppy's own
values: the file leaves them as zeros for the formatting tool to fill in.

## How the BIOS files were built

`bios/seabios.bin` and `bios/vgabios.bin` are v86's own builds, vendored from
`copy/v86` at commit `679ecd2e72e526aece064dfdb5efba0e56fe401b`. v86's script
checks out SeaBIOS at `rel-1.16.2`, copies `seabios.config` to `.config`, runs
`make`, and copies `out/bios.bin` to `seabios.bin` and `out/vgabios.bin` to
`vgabios.bin`. `vgabios.bin` is therefore SeaVGABIOS, the VGA BIOS in
SeaBIOS's `vgasrc/` folder, whose files say "This file may be distributed under
the terms of the GNU LGPLv3 license"; it is not the Bochs LGPL VGABIOS. Its
sha256 (`a4bc0d80cc3ca028c73dafa8fee396b8d054ce87ebd8abfbd31b06b437607880`)
equals v86's `bios/vgabios.bin` at that commit, and its strings read
"SeaBIOS VBE(C) 2011" and "SeaBIOS Developers".

To rebuild: unpack `seabios-1.16.2.tar.gz`, copy `v86-679ecd2e-seabios.config`
to `seabios-1.16.2/.config`, and run `make -C seabios-1.16.2`. A rebuild's bytes
depend on the compiler used, so they may differ from the vendored files; the
source and the configuration are the same.

## Licences

- SeaBIOS and SeaVGABIOS: GNU Lesser General Public License, version 3:
  [`bios/COPYING.LESSER`](bios/COPYING.LESSER), which incorporates the GNU
  General Public License, version 3: [`bios/COPYING`](bios/COPYING). Both are
  the copies shipped in the SeaBIOS 1.16.2 release.
- FreeDOS kernel, FreeCOM and the FreeDOS boot sector: GNU General Public
  License, version 2: [`COPYING`](COPYING), the copy shipped in the FreeDOS
  kernel ke2045 release. The ke2038 `boot.asm` says the same in its header:
  "DOS-C is free software; you can redistribute it and/or modify it under the
  terms of the GNU General Public License as published by the Free Software
  Foundation; either version 2, or (at your option) any later version".
- v86 (`libv86.js`, `v86.wasm`, `v86-fallback.wasm`, and the build script
  above): BSD-2-Clause, in [`LICENSE`](LICENSE).
