An example code base to show how to boot on several systems and set up basic functionality, such as text display.
The current implementation is very preliminary. However, it shows how a boot loader can load the kernel image from disk and use (or simulate) a VGA text display.
The current code base supports the following systems:
- Intel 8086/8088 based systems
- Supports running in 16-bit real mode, 16-bit protected mode, 32-bit protected mode and (for IBM PC) 64-bit long mode.
- IBM PC with either MDA (monochrome) or CGA (color) display (or compatible)
- NEC PC-98
- NEC PC-88 VA
- Motorola 68000 based systems
The floppy images can be compiled using the make
command, and they are placed under bin/<platform name>/disk.<extension>
.
The following tools are required for compilation:
- i16-elf, i686-elf, x86_64-elf, m68k-elf binutils and GCC cross compilers (to compile the sources)
- Make
- Mtools (to generate BIOS parameter block)
- Python 3 (to make disk image bootable)
- Due to copyright restrictions, fonts cannot be shared in this repository. The files
src/font8x8.h
andsrc/font8x16.h
must be provided by the user for proper functioning of the system. These files contain a byte array calledfont8x8
andfont8x16
, each byte representing a row of the bitmap corresponding to each character in the font. A sample format for these files is as follows:
#ifndef _FONT8X8_H
#define _FONT8X8_H
static const uint8_t font8x8[256 * 8] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...
};
#endif // _FONT8X8_H
The script run
is provided for easy execution of the emulators.
The following options are provided (check run
for most up to date information):
- x86 16-bit real mode:
run 16
(requires QEMU),run mda 16
,run cga 16
,run pc98 16
(requires DOSBox-X),run pc88va
(requires 88VA Eternal Grafx, to be placed underexternal
, also requires conversion from raw disk image to .D88 file format) - x86 16-bit protected mode:
run pm
(requires QEMU),run mda pm
,run cga pm
,run pc98 pm
(requires DOSBox-X) - x86 32-bit protected mode:
run 32
(requires QEMU),run mda 32
,run cga 32
,run pc98 32
(requires DOSBox-X) - x86 64-bit long mode:
run 64
(requires QEMU) - Atari ST:
run atari
(requires Hatari) - Apple Macintosh:
run mac
,run mac plus
,run mac ii
(requires Mini vMac) - Commodore Amiga:
run amiga
(requires fs-uae) - Sharp X68000:
run x68000
(requires PX68k)
These emulators may also require the appropriate ROM images.
Other emulators will probably work as well.
This project would not have been possible without the many resources online and manuals for these platforms. Links to some online resources:
- OSDev.org
- sandpile.org
- Roll your own toy UNIX-clone OS by James Molloy
- Learn Assembly Programming with ChibiAkumas
- NEC PC-98 references
Some links to other similar projects: