use e820 to get available memory

This commit is contained in:
pantonshire committed 2024-07-23 07:40:29 +01:00
1 parent 8e5761f610
commit fdf6d81b2e
4 files changed
+99 -10

No files matched your search

+12 -2
View File
@@ -1,8 +1,14 @@
%define BOOT0_LOADPOINT 0x7c00
%define BOOT1_LOADPOINT 0x8200
%define GLOBALS 0x7000
%define STACK_BASE GLOBALS
%define MEMMAP 0x6a00
%define MEMMAP_END BOOT0_LOADPOINT
%define MEMMAP_ENT_SIZE 24
%define MEMMAP_CAP ((MEMMAP_END - MEMMAP) / MEMMAP_ENT_SIZE)
%define GLOBALS 0x4000
%define GLOBALS_END MEMMAP
%define STACK_BASE GLOBALS
%define EBDA_START 0x080000
@@ -25,6 +31,9 @@
%define INTEL_8042_CMD_CONTROLLER_OUT_PORT_READ 0xd0
%define INTEL_8042_CMD_CONTROLLER_OUT_PORT_WRITE 0xd1
; ASCII string "SMAP", which is used by e820 as a magic number argument and return value.
%define E820_MAGIC 0x534d4150
; boot0 base stack frame variable offsets / globals
; (we use the same offsets once we copy the variables to the globals section)
; -------------------------------------------------------------------------------------------------
@@ -53,6 +62,7 @@
; ------------------------------------------------------------------------------------------------
%define VGA_COL 0x1c
%define TEXTBUF_LINE 0x1e
%define MEMMAP_ENTRIES 0x20
%macro fnstart 0
push bp