AMC-OS Loader

From AMC-OS Developers
Jump to navigation Jump to search

Introduction

AMC-OS Loader is a module part of the boot process. Its task is to locate the kernel in the booting volume, load it in memory and prepare all the necessary structures to start it.

AMC-OS Loader gives us much more flexibility in boot process, as we no longer have the limitation of 512 bytes of code. However, the CPU is still running in real mode, implying limitations in the size of structures and files we have to manipulate.

Process

AMC-OS Loader splash screen

AMC-OS Loader follow this procedure :

  • System check : Check that we have a 386+ running in real-mode
  • Load and compare the disk FATs, converts them to FAT16 for simpler management (for FAT12 floppy disks)
  • Locate the MODULES directory containing all kernel files required for boot
  • Load all kernel files in memory using the contents of the AMCOS.MOD file
  • Precisely identify the CPU using either the CPUID instruction or a CPU reset, and calculates its running frequency
  • Identify the video graphics card, check VESA support to get best text resolution during kernel initialization
  • Prepare the CPU for protected mode (GDT and system descriptors)
  • Do a first switch to protected mode to decode kernel AMCX file and relocate it in memory
  • Do a second switch to protected mode to start kernel

Files

AMC-OS Loader is composed of two files :

  • AMCOSLDR.SYS contains raw code of AMC-OS Loader (no header nor relocation).
  • AMCOSLDR.IMG is a picture of AMC-OS Logo displayed during AMC-OS Loader execution.

Both files are loaded by the boot sector.