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 jz .exit
cmp eax, [cpu_count] cmp eax, [cpu_count]
ja .exit jae .exit
mov eax, [smpt+eax*4] mov eax, [smpt+eax*4]
shl eax, 24 shl eax, 24

View File

@ -8,6 +8,7 @@
$Revision$ $Revision$
align 4 align 4
proc alloc_page proc alloc_page
@ -1554,3 +1555,27 @@ proc create_ring_buffer stdcall, size:dword, flags:dword
.fail: .fail:
ret ret
endp 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 cmp eax, 0x534D4150
jnz no_E820 jnz no_E820
e820_mem_loop: e820_mem_loop:
cmp byte [di+16], 1 ; ignore non-free areas ; cmp byte [di+16], 1 ; ignore non-free areas
jnz e820_mem_next ; jnz e820_mem_next
inc byte [0x9100] inc byte [0x9100]
add di, 20 add di, 20
e820_mem_next: e820_mem_next:

View File

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

View File

@ -1060,6 +1060,8 @@ end if
@@: @@:
DEBUGF 1, "K : %d CPU detected\n", eax DEBUGF 1, "K : %d CPU detected\n", eax
call print_mem
; START MULTITASKING ; START MULTITASKING
; A 'All set - press ESC to start' messages if need ; A 'All set - press ESC to start' messages if need