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.
boot/defines.s

64 lines
1.9 KiB
ArmAsm

%define BOOT0_LOADPOINT 0x7c00
%define BOOT1_LOADPOINT 0x8200
%define GLOBALS 0x7000
%define STACK_BASE GLOBALS
%define EBDA_START 0x080000
%define BOOT1_MAGIC 0x544e4150
%define VGA_WIDTH 80
%define VGA_HEIGHT 25
%define INTEL_8042_IO_DATA 0x60
%define INTEL_8042_IN_STATUS 0x64
%define INTEL_8042_OUT_CMD 0x64
%define INTEL_8042_STATUS_OBUF 0
%define INTEL_8042_STATUS_IBUF 1
%define INTEL_8042_CMD_PS2_1_DISABLE 0xad
%define INTEL_8042_CMD_PS2_1_ENABLE 0xae
%define INTEL_8042_CMD_CONTROLLER_OUT_PORT_READ 0xd0
%define INTEL_8042_CMD_CONTROLLER_OUT_PORT_WRITE 0xd1
; boot0 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
%define BOOT1_GPT_ENTRY_ADDR 0x1a
; Globals
; ------------------------------------------------------------------------------------------------
%define VGA_COL 0x1c
%define TEXTBUF_LINE 0x1e
%macro fnstart 0
push bp
mov bp, sp
%endmacro
%macro fnret 0
pop bp
ret
%endmacro