wip refactor
This commit is contained in:
1 parent
ae2720c826
commit
2b1a9f9412
15 files changed
+906
-20
No files matched your search
@@ -62,13 +62,3 @@
|
||||
%define VGA_COL 0x1c
|
||||
%define TEXTBUF_LINE 0x1e
|
||||
%define MEMMAP_ENTRIES 0x20
|
||||
|
||||
%macro fnstart 0
|
||||
push bp
|
||||
mov bp, sp
|
||||
%endmacro
|
||||
|
||||
%macro fnret 0
|
||||
pop bp
|
||||
ret
|
||||
%endmacro
|
||||
@@ -0,0 +1,14 @@
|
||||
%ifndef BOOT_FN_H
|
||||
%define BOOT_FN_H
|
||||
|
||||
%macro fnstart 0
|
||||
push bp
|
||||
mov bp, sp
|
||||
%endmacro
|
||||
|
||||
%macro fnret 0
|
||||
pop bp
|
||||
ret
|
||||
%endmacro
|
||||
|
||||
%endif
|
||||
@@ -0,0 +1,18 @@
|
||||
%ifndef BOOT_LAYOUT_H
|
||||
%define BOOT_LAYOUT_H
|
||||
|
||||
%define S1_ADDR 0x7c00
|
||||
%define S2_ADDR 0x8200
|
||||
|
||||
; %define MEMMAP 0x6a00
|
||||
; %define MEMMAP_END S2_ADDR
|
||||
; %define MEMMAP_ENT_SIZE 32
|
||||
; %define MEMMAP_CAP ((MEMMAP_END - MEMMAP) / MEMMAP_ENT_SIZE)
|
||||
|
||||
%define REAL_GLOBALS 0x4000
|
||||
%define REAL_GLOBALS_END 0x6a00
|
||||
%define REAL_STACK_BASE REAL_GLOBALS
|
||||
|
||||
%define S234_MAGIC 0x544e4150
|
||||
|
||||
%endif
|
||||
@@ -0,0 +1,28 @@
|
||||
%ifndef BOOT_S1_VARS_H
|
||||
%define BOOT_S1_VARS_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
|
||||
%define STAGE_2_GPT_ENTRY_ADDR 0x1a
|
||||
|
||||
%endif
|
||||
@@ -0,0 +1,8 @@
|
||||
%ifndef BOOT_S2_FNS_H
|
||||
%define BOOT_S2_FNS_H
|
||||
|
||||
extern addr32_to_addr16
|
||||
extern read_sector
|
||||
extern panic_simple
|
||||
|
||||
%endif
|
||||
Reference in new issue
Block a user