You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB
ArmAsm

%ifndef BOOT_GLOBALS_H
%define BOOT_GLOBALS_H
; Stage 1 base stack frame variable offsets / globals
; (we use the same offsets once we copy the variables to the globals section)
; -------------------------------------------------------------------------------------------------
; The boot drive number given to us by the BIOS.
%define BOOT_DRIVE 0x02
; Boot drive geometry
%define SECTORS_PER_TRACK 0x04
%define N_HEADS 0x06
; Starting LBA of the GPT partition entries array.
%define GPT_ENTRIES_START_LBA 0x08
; Number of GPT entries, saturated to 16 bits.
%define GPT_N_ENTRIES_16 0x0a
; Number of sectors to advance by once we've read every GPT entry in the current sector.
%define GPT_SECTOR_STRIDE 0x0c
; Number of bytes to advance by in the current sector once we've read a GPT entry.
%define GPT_BYTE_STRIDE 0x0e
; Number of GPT entries which can fit in a single sector.
%define GPT_ENTRIES_PER_SECTOR 0x10
%define GPT_CURRENT_ENTRY_IDX 0x12
%define GPT_SECTOR_ENTRY_IDX 0x14
%define GPT_SECTORS_LOADED 0x16
%define GPT_CURRENT_LBA 0x18
; 2-byte address of the partition GPT entry loaded into memory.
%define STAGE_2_GPT_ENTRY_ADDR 0x1a
; Stage 2 globals
; -------------------------------------------------------------------------------------------------
; 4-byte partition end LBA.
%define LOADER_PART_END_LBA 0x1c
; 2-byte stage 2 start LBA.
%define STAGE_2_START_LBA 0x20
; 2-byte stage 2 start LBA (inclusive).
%define STAGE_2_END_LBA 0x22
%endif