AMC-OS Loader: Difference between revisions

From AMC-OS Developers
Jump to navigation Jump to search
Line 9: Line 9:
AMC-OS Loader follow this procedure :
AMC-OS Loader follow this procedure :
* System check : Check that we have a 386+ running in real-mode
* 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)
* Ask BIOS information on the available RAM in the system and initialize low memory (<640KB) for allocation.
* Locate the <tt>MODULES</tt> directory containing all kernel files required for boot
* Load all kernel files in memory using the contents of the <tt>[[AMCOS.MOD]]</tt> file
* Precisely [[Identifying CPU|identify the CPU]] using either the CPUID instruction or a CPU reset, and calculates its running frequency
* Precisely [[Identifying CPU|identify the CPU]] using either the CPUID instruction or a CPU reset, and calculates its running frequency
* Check if we start from a MBR (removeable media) or a VBR and locate volume to boot
* Identify the volume type (FAT12, FAT16...) and initialize according filesystem driver.
* Locate and load the required kernel files
* Identify the video graphics card, check VESA support to get best text resolution during kernel initialization
* 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)
* Prepare the CPU for protected mode (GDT and system descriptors)

Revision as of 12:52, 16 May 2017

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
  • Ask BIOS information on the available RAM in the system and initialize low memory (<640KB) for allocation.
  • Precisely identify the CPU using either the CPUID instruction or a CPU reset, and calculates its running frequency
  • Check if we start from a MBR (removeable media) or a VBR and locate volume to boot
  • Identify the volume type (FAT12, FAT16...) and initialize according filesystem driver.
  • Locate and load the required kernel files
  • 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.