From 54476eeea1e93d3df0bd4847b76915def6e4da59 Mon Sep 17 00:00:00 2001 From: Thomas Oltmann Date: Fri, 4 Jul 2025 16:33:05 +0200 Subject: [PATCH] Working on e820 memory map --- lboot.S | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lboot.S b/lboot.S index 0636bdc..5274e6f 100644 --- a/lboot.S +++ b/lboot.S @@ -24,6 +24,10 @@ _start: cli call print call unreal + mov $msg_memmap, %si + call print + call memmap + mov $msg_fin, %si call print 1: hlt @@ -67,6 +71,23 @@ unreal: push %ds 2: pop %ds ret +memmap: push %bp + mov %sp, %bp + sub $24, %sp + + mov %ss, %ax + mov %ax, %es + mov %sp, %di + xor %ebx, %ebx + mov $0x534D4150, %edx + mov $24, %ecx + mov $0xE820, %eax + int $0x15 + + mov %bp, %sp + pop %bp + ret + print: xor %bx, %bx 1: mov $COM1+5, %dx @@ -115,4 +136,5 @@ gdt_ptr: .word gdt_size-1 msg_start: .asciz "Netboot via fernlader v1 ...\r\n" msg_a20: .asciz " * Enabling A20\r\n" msg_unreal: .asciz " * Unreal Mode\r\n" +msg_memmap: .asciz " * Fetching Memory Map\r\n" msg_fin: .asciz "Finished.\r\n"