Working on e820 memory map
This commit is contained in:
parent
f157f82657
commit
54476eeea1
1 changed files with 22 additions and 0 deletions
22
lboot.S
22
lboot.S
|
|
@ -24,6 +24,10 @@ _start: cli
|
||||||
call print
|
call print
|
||||||
call unreal
|
call unreal
|
||||||
|
|
||||||
|
mov $msg_memmap, %si
|
||||||
|
call print
|
||||||
|
call memmap
|
||||||
|
|
||||||
mov $msg_fin, %si
|
mov $msg_fin, %si
|
||||||
call print
|
call print
|
||||||
1: hlt
|
1: hlt
|
||||||
|
|
@ -67,6 +71,23 @@ unreal: push %ds
|
||||||
2: pop %ds
|
2: pop %ds
|
||||||
ret
|
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
|
print: xor %bx, %bx
|
||||||
|
|
||||||
1: mov $COM1+5, %dx
|
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_start: .asciz "Netboot via fernlader v1 ...\r\n"
|
||||||
msg_a20: .asciz " * Enabling A20\r\n"
|
msg_a20: .asciz " * Enabling A20\r\n"
|
||||||
msg_unreal: .asciz " * Unreal Mode\r\n"
|
msg_unreal: .asciz " * Unreal Mode\r\n"
|
||||||
|
msg_memmap: .asciz " * Fetching Memory Map\r\n"
|
||||||
msg_fin: .asciz "Finished.\r\n"
|
msg_fin: .asciz "Finished.\r\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue