Pre-boot conditions

Contents:

Overview
Memory layout
Machine state
Calling the setup code


Overview

An OS can be booted from many sources. Swarm is designed so that as long as certain conditions are met any piece of code can boot Swarm. This document describes the conditions that need to be fullfilled by the boot code before starting the setup code.



Memory Layout

When control is passed to the setup code conventional memory should look like this:
 
 
Address Size (bytes) Use
 0x000000  1024  Real mode IVT
 0x000400  512  BIOS parameter area
 0x000600  141824  Safe area for boot code (and DOS)
 0x023000  -  Boot image
 -  -  BIOS extended data area
 0x0A0000  131072  Video display memory
 0x0C0000   262144  BIOS ROMS
 



Machine State

The cpu should be in real mode and the video mode should be 80x25x16. SS:SP should also point to a valid 16 bit stack at 0x2200:0xFFC.



Calling the Setup Code

This is done with a simple 16 bit far call:

    call 0x2300:8
 
If the setup code returns from this call there has been an error. The offset (base = 0x23000) of an ASCIIZ error string is returned in SI.
 



Parent file