E. Almqvist 3 years ago
parent 03e7f961d2
commit b0b9585b7d
  1. 17
      bootloader/bios/memory.asm
  2. 3
      bootloader/bootloader.asm

@ -1,5 +1,20 @@
; SRs to find memory size and leave it as a "note" for the kernel ; SRs to find memory size and leave it as a "note" for the kernel
; Descriptor Table for address ranges
addr_rng_dt_start:
addr_rng_low: dd 0
addr_rng_high: dd 0
addr_rng_len_low: dd 0
addr_rng_len_high: dd 0
addr_rng_type: dd 0
addr_eng_dt_end:
map_phys_mem_init:
mov ebx, 0
map_phys_mem: map_phys_mem:
int 0x15 mov eax, 0xe820 ; Function code
mov es,
mov edx, 'SMAP' ; Signature
int BIOS_PMEM_INT

@ -27,6 +27,7 @@
%include "bootloader/bios/convert.asm" %include "bootloader/bios/convert.asm"
%include "bootloader/bios/print.asm" %include "bootloader/bios/print.asm"
%include "bootloader/bios/disk.asm" %include "bootloader/bios/disk.asm"
%include "bootloader/bios/memory.asm"
; Protected Mode SRs ; Protected Mode SRs
%include "bootloader/equ/vga.asm" %include "bootloader/equ/vga.asm"
@ -43,7 +44,7 @@ pm_preinit:
lgdt [gdt_descriptor] ; Tell the CPU about the GDT lgdt [gdt_descriptor] ; Tell the CPU about the GDT
mov eax, cr0 ; Set first bit of the CR0 register mov eax, cr0 ; Set first bit of the CR0 register
or eax, 0x1 ; to 1 or eax, 0x1 ; to 1
mov cr0, eax ; Update the control register mov cr0, eax ; Update the control register
; Initialize PM ; Initialize PM

Loading…
Cancel
Save