acpi:print e820 memory map

git-svn-id: svn://kolibrios.org@2442 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2012-03-09 12:55:55 +00:00
parent 6dcd9aa69b
commit 3340831e5e
5 changed files with 38 additions and 4 deletions

View File

@ -429,7 +429,7 @@ start_ap:
jz .exit
cmp eax, [cpu_count]
ja .exit
jae .exit
mov eax, [smpt+eax*4]
shl eax, 24

View File

@ -8,6 +8,7 @@
$Revision$
align 4
proc alloc_page
@ -1554,3 +1555,27 @@ proc create_ring_buffer stdcall, size:dword, flags:dword
.fail:
ret
endp
align 4
print_mem:
mov edi, BOOT_VAR + 0x9104
mov ecx, [edi-4]
test ecx, ecx
jz .done
@@:
mov eax, [edi]
mov edx, [edi+4]
add eax, [edi+8]
adc edx, [edi+12]
DEBUGF 1, "K : E820 %x%x - %x%x type %d\n", \
[edi+4], [edi],\
edx, eax, [edi+16]
add edi, 20
dec ecx
jnz @b
.done:
ret

View File

@ -23,8 +23,8 @@
cmp eax, 0x534D4150
jnz no_E820
e820_mem_loop:
cmp byte [di+16], 1 ; ignore non-free areas
jnz e820_mem_next
; cmp byte [di+16], 1 ; ignore non-free areas
; jnz e820_mem_next
inc byte [0x9100]
add di, 20
e820_mem_next:

View File

@ -45,8 +45,12 @@ proc mem_test
ret
endp
align 4
proc init_mem
xchg bx, bx
; calculate maximum allocatable address and number of allocatable pages
mov edi, BOOT_VAR-OS_BASE + 0x9104
mov ecx, [edi-4]
@ -55,6 +59,9 @@ proc init_mem
.calcmax:
; round all to pages
mov eax, [edi]
cmp [edi+16], byte 1
jne .unusable
test eax, 0xFFF
jz @f
neg eax

View File

@ -1056,10 +1056,12 @@ end if
mov eax, [cpu_count]
test eax, eax
jnz @F
mov al, 1 ; at least one CPU
mov al, 1 ; at least one CPU
@@:
DEBUGF 1, "K : %d CPU detected\n", eax
call print_mem
; START MULTITASKING
; A 'All set - press ESC to start' messages if need