Booting
Upon a cold or warm boot, microprocessors in the 680x0 series load the initial supervisor stack pointer from the second longword in memory ($4) and begin execution at the PC found in the first longword ($0). The location this points to is the base initialization point for the Atari computers. Every Atari computer or TOS clone follows a predefined set of steps to accomplish system initialization. The following illustrates these steps leaving out some hardware initialization which is specific to the particular computer line (ST, TT, Falcon, etc.).
A cold boot occurs when the computer system experiences a total loss of power and no memory locations can be considered valid (this can be done artificially by zeroing memory, as is the case with the CTRL-ALT-right SHIFT-DELETE reset). A warm boot is a manual restart of the system which can be accomplished via software or the reset button or with CTRL-ALT-DELETE reset.
Step / description:
Here is the TOS boot process, the steps in bold indicates potential virus usage.
- The Interrupt Priority Level (IPL) is set to 7 and the OS switches to supervisor mode.
- A
RESET
instruction is executed to reset external hardware devices. - The presence of diagnostic cartridge is determined. If one is inserted, it is JMP'ed to with a return address in register A6.
- If running on a MC68030/68040, the
CACR
,VBR
,TC
,TT0
andTT1
registers are initialized. - If a floating-point coprocessor is present it is initialized.
- If the
memvalid
($4F2
),memval2
($43A
), andmemval3
($51A
) system variables are all valid, a warm boot is assumed and the memory controller is initialized with the return value frommemcntrl
($424
). - Reset Vector: if the reset vector is set and
resvalid
contains$31415926
then the routine is JMP'ed to. - Memory set up (
meminit
)- The initial color palette registers are loaded and the screen base is initialized to
$10000
- Memory controller is configured
- Memory is sized if it wasn't from a previous reset (PHYSTOP).
- The initial color palette registers are loaded and the screen base is initialized to
- At first boot:
- memory is cleared after
sysvars_start
toram_size
- Magic numbers are stored in low memory to indicate the successful sizing and initialization of memory.
- Cache is set on MegaSTE, TT, Falcon
- memory is cleared after
- Screen mory is step to
PHYSTOP
- screen_size ($8000
) and the memory is cleared from here to PHYSTOP. - System variables are initialized
- Cookie jar are initialized.
- Exception vectors are initialized
- The BIOS initialization point is executed.
- MFP, IKBD are initialized
- Installed cartridges of type 2 are executed.
- The screen resolution is set, blitter initialized, initialize terminal mode (The text cursor enabled)
- Installed cartridges of type 0 are executed.
- Interrupts are enabled by lowering the IPL to 3.
- Installed cartridges of type 1 are executed.
- If running TOS 2.06, 3.06, 4.0x or 5.0x, the Fuji logo is displayed and a memory test and hard disk spin-up sequence is executed.
- HDV Boot: routine hdv_boot is called, if at least one floppy drive is attached to the system, the bootsector of the first floppy drive is loaded and if executable, it is called.
- DMA Boot: If at least one hard disk or other media is attached to the system, the first sector of each is loaded in succession until one with an executable sector is found or each has been tried.
- IDE Boot: If a hard disk sector was found that was executable, it is executed.
- Resident programs: if a Reset Resident program exists (i.e. with valid header at
$200
boundaries), it will be executed. - Startup GEM
- All
\AUTO\*.PRG
files found on the boot disk are executed. - If
cmdload
($482
) is 0 then an environment string is created and the AES is launched, otherwise\COMMAND.PRG
is loaded. - If the AES ever terminates, the system is reset and system initialization begins again.
Sources
- Lucky Lady, UDV Manual
- TOS 1.x disassembly from Thorsten Otto: Github