15,7 → 15,7 |
align 4 |
proc mem_test |
; if we have BIOS with fn E820, skip the test |
cmp dword [BOOT_VAR-OS_BASE + 0x9100], 0 |
cmp dword [BOOT_VARS-OS_BASE + 0x9100], 0 |
jnz .ret |
|
mov eax, cr0 |
35,12 → 35,12 |
|
and eax, not (CR0_CD+CR0_NW) ;enable caching |
mov cr0, eax |
inc dword [BOOT_VAR-OS_BASE + 0x9100] |
inc dword [BOOT_VARS-OS_BASE + 0x9100] |
xor eax, eax |
mov [BOOT_VAR-OS_BASE + 0x9104], eax |
mov [BOOT_VAR-OS_BASE + 0x9108], eax |
mov [BOOT_VAR-OS_BASE + 0x910C], edi |
mov [BOOT_VAR-OS_BASE + 0x9110], eax |
mov [BOOT_VARS-OS_BASE + 0x9104], eax |
mov [BOOT_VARS-OS_BASE + 0x9108], eax |
mov [BOOT_VARS-OS_BASE + 0x910C], edi |
mov [BOOT_VARS-OS_BASE + 0x9110], eax |
.ret: |
ret |
endp |
48,7 → 48,7 |
align 4 |
proc init_mem |
; calculate maximum allocatable address and number of allocatable pages |
mov edi, BOOT_VAR-OS_BASE + 0x9104 |
mov edi, BOOT_VARS-OS_BASE + 0x9104 |
mov ecx, [edi-4] |
xor esi, esi; esi will hold total amount of memory |
xor edx, edx; edx will hold maximum allocatable address |
195,7 → 195,7 |
rep stosd |
|
; scan through memory map and mark free areas as available |
mov ebx, BOOT_VAR-OS_BASE + 0x9104 |
mov ebx, BOOT_VARS-OS_BASE + 0x9104 |
mov edx, [ebx-4] |
.scanmap: |
cmp [ebx+16], byte 1 |
453,6 → 453,9 |
acpi_dev_size rd 1 |
|
acpi_rsdt_base rd 1 |
acpi_fadt_base rd 1 |
acpi_dsdt_base rd 1 |
acpi_dsdt_size rd 1 |
acpi_madt_base rd 1 |
acpi_ioapic_base rd 1 |
|
464,6 → 467,7 |
ACPI_HI_RSDP_WINDOW_END equ 0x00100000 |
ACPI_RSDP_CHECKSUM_LENGTH equ 20 |
ACPI_MADT_SIGN equ 0x43495041 |
ACPI_FADT_SIGN equ 0x50434146 |
|
|
acpi_locate: |
535,10 → 539,23 |
jz .done |
|
mov ecx, [eax+16] |
mov edx, ACPI_MADT_SIGN |
mov edx, 0x50434146 |
mov [acpi_rsdt_base-OS_BASE], ecx |
call rsdt_find |
mov [acpi_fadt_base-OS_BASE], eax |
test eax, eax |
jz @f |
|
mov eax, [eax+40] |
mov [acpi_dsdt_base-OS_BASE], eax |
mov eax, [eax+4] |
mov [acpi_dsdt_size-OS_BASE], eax |
|
@@: |
mov edx, ACPI_MADT_SIGN |
mov ecx, [acpi_rsdt_base-OS_BASE] |
call rsdt_find |
test eax, eax |
jz .done |
|
mov [acpi_madt_base-OS_BASE], eax |