x16-PRos

Minimalistic 16-bit OS

x16-PRos — Fast and lightweight

PRos is a minimalistic 16-bit operating system written in NASM for x86 architecture. It features a command-line interface, FAT12 file system support, and a rich set of system calls.

System Lightweight

Occupies < 200 KB on disk and optimized for 1.44 MB floppy disks.

Rich API

Provides interrupt-driven APIs for output, file operations, and string manipulation.

Educational

Ideal for learning OS development and low-level programming.

Download Image Source on GitHub Documentation
DEV BRANCH

What is the dev branch?

New features and patches will be published here before they get to main. This version of the system is not the most stable, but new features get there the fastest. Send all pull requests there.

System Requirements

Minimal

  • CPU: Intel 80186
  • RAM: 64 KB
  • Storage: 1.44 MB floppy (FAT12)
  • GPU: CGA compatible
  • Input: Keyboard (PS/2 or USB)
  • CPU: Intel 80286
  • RAM: 256 KB
  • Storage: 1.44 MB floppy (FAT12)
  • GPU: VGA compatible
  • Input: Keyboard and mouse (PS/2 or USB)
  • Sound: PC Speaker

Maximum

  • CPU: Intel 80486 / Pentium
  • RAM: 512 KB
  • Storage: 1.44 MB floppy (FAT12)
  • GPU: VGA or better
  • Input: Keyboard and mouse (PS/2 or USB)
  • Sound: PC Speaker and AdLib Soundcard

Standard Software Package

Built-in applications included in x16-PRos.

Running

You can run x16-PRos on emulators or on real hardware. Choose your preferred method:

Credits

People behind the x16-PRos project — software creators, sponsors, and helpers.

PRoX-dev

Lead developer. The creator of the kernel, the operating system, the terminal, drivers, API functions, multimedia, disk and graphics management, and almost the entire software package.

Qwez-dev

The creator of the game "Space Arcade" and build scripts for Windows.

Han Akbe

Has corrected grammar in project documentation. Edited and improved kernel code. Provided valuable advice. Developed libc for x16-PRos. An active member of the community. Also supported the project financially.

Ilnar Karazbaev

The creator of the MEMORY program, the developer of libc for x16-PRos, an active member of the community.

Saeta

Helped fix a serious file system API bug and created the first version of calc. Before creating the API, she developed a library with basic functions.

Loxsete

Barchart program creator. At the beginning of development, helped with the kernel code.

Gabriel

Percentages program creator.

Cuzhima

Hex-edit program creator.

litvincode

v0.2 calculator creator.

Running x16-PRos on Real Hardware

x16-PRos is designed for 1.44 MB floppy disks but can also run from a USB flash drive. Follow these steps to set up x16-PRos on real hardware. Use the .IMG image for persistent storage or the .ISO image for a live CD experience without saving changes.

Select the Device

Choose a USB flash drive or floppy disk to write the x16-PRos system image. For USB drives, ensure the drive is formatted as FAT12. The .IMG image supports persistent changes, while the .ISO image is for temporary, live sessions.

Write the Image

Download the x16-PRos system image (.IMG or .ISO) and use a tool like Rufus to burn it to your USB drive. Select your USB drive and the image in Rufus, then click START. Wait for the process to complete before safely ejecting the drive.

Configure BIOS for UEFI Systems

x16-PRos relies on BIOS system calls and does not support UEFI directly. If your computer uses UEFI, enable CSM in the UEFI settings. Enter the UEFI setup by pressing keys like F2 or DELETE during boot (check your motherboard manual for the exact key). Locate and enable CSM support.

UEFI CSM Settings
Change DISABLED to ENABLED for CSM support.
Access the Boot Menu

Restart your computer and enter the boot menu (typically using F8, F11, F12, or ESC). Select the USB drive option labeled "USB" (not "UEFI") to boot PRos.

Boot Menu Selection
Select your USB flash drive from the boot menu.
Boot x16-PRos

Press ENTER to start the boot process, which takes approximately 2-5 seconds. Upon first launch, you'll see the PRos installation screen.

PRos Installation Screen
The initial installation screen for x16-PRos.

Running x16-PRos on Emulators

Emulators are ideal for developers and testers. PRos supports several emulators, with QEMU being the most straightforward option. Follow these steps to run PRos on QEMU.

Install QEMU

Install qemu-system-x86_64 or qemu-system-i386 using your package manager. For example, on Debian-based systems:


sudo apt install qemu-system-x86
# Or
sudo apt install qemu-system-i386
          

For Arch Linux with audio support, install the PulseAudio package:


sudo pacman -S qemu-audio-pa
          
Run x16-PRos in QEMU

Launch x16-PRos using the following command, ensuring you have the x16-PRos.img image file:


qemu-system-x86_64 -audiodev pa,id=snd0 -machine pcspk-audiodev=snd0 -fda x16-PRos.img
          

This command configures QEMU with audio support and boots the PRos image from a virtual floppy disk.

PRos Terminal Commands

The PRos Terminal is a powerful command-line interface for interacting with the OS, supporting commands for disk operations, program execution, and multimedia tasks.

Basic Commands
CommandDescription
helpDisplay categorized command reference with navigation
infoShow system information and OS details
clsClear terminal screen
verDisplay PRos terminal version
exitExit to bootloader
System Information
CommandDescription
cpuDisplay detailed CPU information (family, model, cores, cache)
dateShow the current date (DD/MM/YY format)
timeShow current time (HH:MM:SS format, with timezone)
File Operations
CommandSyntaxDescription
dirdirList files in the current directory with size info
catcat <filename>Display file contents
sizesize <filename>Show file size in bytes
deldel <filename>Delete a file (kernel.bin protected)
copycopy <source> <dest>Copy file (root directory only)
renren <old> <new>Rename file (root directory only)
touchtouch <filename>Create an empty file
writewrite <file> <text>Write text to a file
Text Processing
CommandSyntaxDescription
grepgrep <file> <text>Search for text in a file with line/column highlighting
headhead <filename>Display the first 10 lines of a file
tailtail <filename>Display the last 10 lines of a file
Directory Operations
CommandSyntaxDescription
cdcd <dirname>Change directory (use .. for parent, / for root)
mkdirmkdir <dirname>Create a new directory
deldirdeldir <dirname>Delete an empty directory
treetreeDisplay directory structure as a tree
Disk Management
CommandSyntaxDescription
dlistdlistList available drives with size and usage
drivedrive <letter>Switch to another disk drive
Media & Display
CommandSyntaxDescription
viewview <file> [-upscale]Display BMP image with optional 2x scaling
charscharsDisplay ASCII character table
themetheme <name>Change color theme (DEFAULT/GROOVYBOX/UBUNTU)
fontfont <name>Switch font (DEFAULT/BOLD/THIN/ITALIC)
Power Management
CommandDescription
shutShutdown system via APM
rebootRestart system

API Documentation

x16-PRos provides interrupt-driven APIs for developers. Each function is selected via the AH register. All functions preserve registers via pusha/popa unless output registers are specified. On error, the carry flag (CF) is set.

INT 0x21 Output API
INT 0x22 File System API

INT 0x21 — Output API

Handles screen output in VGA 640×480 16-color mode. All text functions support newline (0x0A) conversion to CR+LF.

Display Functions
AHFunctionInputOutput / Notes
0x00Initialize OutputSets VGA mode 0x12 (640×480, 16 colors)
0x01Print String (White)SI = string ptrColor 0x0F
0x02Print String (Green)SI = string ptrColor 0x0A
0x03Print String (Cyan)SI = string ptrColor 0x0B
0x04Print String (Red)SI = string ptrColor 0x0C
0x05Print NewlineOutputs CR+LF
0x06Clear ScreenResets video mode (same as 0x00)
0x07Set Text ColorBL = color (0x00–0x0F)Sets global color for function 0x08
0x08Print String (Custom)SI = string ptrUses color set by 0x07
Font Control
AHALFunctionInputNotes
0x090x00Restore Default FontRestores BIOS ROM font
0x090x01Load Default Custom FontLoads built-in CP866 font
0x090x02Load Font from FileSI = filename ptrLoads custom .FNT file from disk
Date & Time
AHFunctionOutput
0x0AGet System TimeCH = hours, CL = minutes, DH = seconds
0x0BGet System DateCH = century, CL = year, DH = month, DL = day
VGA 16-Color Palette Reference
0x00 Black
0x01 Dark Blue
0x02 Dark Green
0x03 Dark Cyan
0x04 Dark Red
0x05 Dark Magenta
0x06 Brown
0x07 Light Gray
0x08 Dark Gray
0x09 Blue
0x0A Green
0x0B Cyan
0x0C Red
0x0D Magenta
0x0E Yellow
0x0F White

INT 0x22 — File System API

Manages files on FAT12 disks. Filenames must be in 8.3 format (e.g. FILE.TXT), case-insensitive (auto-uppercased).

Initialization
AHFunctionInputOutput / Notes
0x00Re-Initialize File SystemResets floppy controller. CF on error.
File Operations
AHFunctionInputOutput / Notes
0x01 Get File List SI = buffer for 18-byte entries BX = size low, CX = size high (32-bit total),
DX = file count
0x02Load FileSI = filename, CX = load addressBX = file size. CF on error.
0x03Write FileSI = filename, BX = buffer, CX = sizeCreates or overwrites file. CF on error.
0x04Check if File ExistsSI = filenameCF clear = exists, set = not found.
0x05Create Empty FileSI = filenameCF on error (exists or dir full).
0x06Remove FileSI = filenameFrees clusters. CF on error.
0x07Rename FileSI = old name, DI = new nameCF on error.
0x08Get File SizeSI = filenameBX = size in bytes. CF if not found.
0x10Load Huge FileSI = filename, CX = load offset, DX = segmentLoads files >64KB across segments. CF on error.
Directory Operations
AHFunctionInputOutput / Notes
0x09Change DirectorySI = dirnameCF on error (not found).
0x0AGo to Parent DirectoryCF if already at root.
0x0BCreate DirectorySI = dirnameCF on error.
0x0CRemove DirectorySI = dirnameCF on error (not empty or not found).
0x0DCheck if DirectorySI = nameCF clear = is directory, set = not.
0x0ESave Current DirectorySaves current dir state internally.
0x0FRestore Current DirectoryRestores previously saved dir state.
Drive Management
AHFunctionInputOutput / Notes
0x11List DrivesPrints available drives with size info.
0x12Change DriveSI = drive letter pointerSwitches to another disk. CF on error.
Limitations: Root directory max 224 entries. Standard load (0x02) limited to 64 KiB; use 0x10 (Load Huge File) for larger files across segments.

Program Examples

Below are example programs demonstrating the use of PRos APIs, written in NASM for the 16-bit x86 architecture.

Hello, World

Description: A simple program to output a text string to the terminal.


[BITS 16]
[ORG 0x8000]

start:
    mov ah, 0x01        ; API output print white string function
    mov si, hello_msg   ; String to output
    int 0x21            ; Call the API function
    ret                 ; Return to the terminal

hello_msg db 'Hello, PRos!', 10, 13, 0
          
Print Colored Strings

Description: A program to output the same string in multiple colors using different API functions.


[BITS 16]
[ORG 0x8000]

start:
    mov ah, 0x01        ; API output print white string function
    mov si, hello_msg   ; String to output
    int 0x21            ; Call the API function

    mov ah, 0x02        ; API output print green string function
    mov si, hello_msg
    int 0x21

    mov ah, 0x03        ; API output print cyan string function
    mov si, hello_msg
    int 0x21

    mov ah, 0x04        ; API output print red string function
    mov si, hello_msg
    int 0x21

    ret                 ; Return to the terminal

hello_msg db 'Hello, PRos!', 10, 13, 0
          

Project News

Latest updates and announcements from the x16-PRos project and it`s community.