acpi:print cpu count

git-svn-id: svn://kolibrios.org@2441 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2012-03-09 11:35:26 +00:00
parent 6f8e8ebd03
commit 6dcd9aa69b
9 changed files with 123 additions and 129 deletions

View File

@ -387,7 +387,7 @@ sayerr:
push 0
pop es
and word [es:0x9031], 0
and word [es:BOOT_IDE_BASE_ADDR], 0
; \begin{Mario79}
; find HDD IDE DMA PCI device
; check for PCI BIOS
@ -424,7 +424,7 @@ sayerr:
int 0x1A
jc .nopci
and cx, 0xFFF0 ; clear address decode type
mov [es:0x9031], cx
mov [es:BOOT_IDE_BASE_ADDR], cx
.nopci:
; \end{Mario79}
@ -456,15 +456,15 @@ wait_loop: ; variant 2
loopnz @b
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; --------------- APM ---------------------
and word [es:0x9044], 0 ; ver = 0.0 (APM not found)
and word [es:BOOT_APM_VERSION], 0 ; ver = 0.0 (APM not found)
mov ax, 0x5300
xor bx, bx
int 0x15
jc apm_end ; APM not found
test cx, 2
jz apm_end ; APM 32-bit protected-mode interface not supported
mov [es:0x9044], ax ; Save APM Version
mov [es:0x9046], cx ; Save APM flags
mov [es:BOOT_APM_VERSION], ax ; Save APM Version
mov [es:BOOT_APM_FLAGS], cx ; Save APM flags
; Write APM ver ----
and ax, 0xf0f
@ -483,10 +483,10 @@ wait_loop: ; variant 2
xor bx, bx
int 0x15
mov [es:0x9040], ebx
mov [es:0x9050], ax
mov [es:0x9052], cx
mov [es:0x9054], dx
mov [es:BOOT_APM_ENTRY], ebx
mov [es:BOOT_APM_CODE_32], ax
mov [es:BOOT_APM_CODE_16], cx
mov [es:BOOT_APM_DATA_16], dx
apm_end:
_setcursor d80x25_top_num, 0
@ -947,18 +947,17 @@ end if
; GRAPHICS ACCELERATION
; force yes
mov [es:0x901C], byte 1
mov [es:BOOT_MTRR], byte 1
; DMA ACCESS TO HD
mov al, [preboot_dma]
mov [es:0x901F], al
mov [es:BOOT_DMA], al
;; VRR_M USE
;
; mov al,[preboot_vrrm]
; mov [es:0x9030], al
mov [es:0x901E], byte 1
; BOOT DEVICE
@ -1337,7 +1336,7 @@ end if
xor ax, ax
mov es, ax
mov ax, [es:0x9008] ; vga & 320x200
mov ax, [es:BOOT_VESA_MODE] ; vga & 320x200
mov bx, ax
cmp ax, 0x13
je setgr

View File

@ -726,9 +726,9 @@ set_vmode:
mov bx, word [es:si+2] ; resolution Y
mov word [es:0x900A], ax ; resolution X
mov word [es:0x900C], bx ; resolution Y
mov word [es:0x9008], cx ; number of mode
mov word [es:BOOT_X_RES], ax ; resolution X
mov word [es:BOOT_Y_RES], bx ; resolution Y
mov word [es:BOOT_VESA_MODE], cx ; number of mode
cmp cx, 0x12
je .mode0x12_0x13
@ -747,11 +747,11 @@ set_vmode:
int 0x10
; LFB
mov eax, [es:mi.PhysBasePtr];di+0x28]
mov [es:0x9018], eax
mov [es:BOOT_LFB], eax
; ---- vbe voodoo
BytesPerLine equ 0x10
mov ax, [es:di+BytesPerLine]
mov [es:0x9001], ax
mov [es:BOOT_PITCH], ax
; BPP
cmp [es:mi.BitsPerPixel], 16
jne .l0
@ -760,12 +760,12 @@ set_vmode:
mov [es:mi.BitsPerPixel], 15
.l0:
mov al, byte [es:di+0x19]
mov [es:0x9000], al
mov [es:BOOT_BPP], al
jmp .exit
.mode0x12_0x13:
mov byte [es:0x9000], 32
or dword [es:0x9018], 0xFFFFFFFF; 0x800000
mov byte [es:BOOT_BPP], 32
or dword [es:BOOT_LFB], 0xFFFFFFFF; 0x800000
; VESA 1.2 PM BANK SWITCH ADDRESS
@ -788,10 +788,6 @@ set_vmode:
.exit:
ret
; mov dword[es:0x9018],0x000A0000
; ret
;=============================================================================
;=============================================================================
;=============================================================================

View File

@ -363,22 +363,30 @@ PG_SHARED equ 0x200
;;;;;;;;;;;boot time variables
;BOOT_BPP equ 0x9000 ;byte bits per pixel
BOOT_SCANLINE equ 0x9001 ;word scanline length
BOOT_BPP equ 0x9000 ;byte bits per pixel
BOOT_PITCH equ 0x9001 ;word scanline length
BOOT_VESA_MODE equ 0x9008 ;word vesa video mode
;;BOOT_X_RES equ 0x900A ;word X res
;;BOOT_Y_RES equ 0x900C ;word Y res
BOOT_X_RES equ 0x900A ;word X res
BOOT_Y_RES equ 0x900C ;word Y res
;;BOOT_MOUSE_PORT equ 0x9010 ;byte mouse port - not used
BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch
BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address
BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration
BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display)
BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled
;BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled
BOOT_DMA equ 0x901F ;
BOOT_PCI_DATA equ 0x9020 ;8bytes pci data
BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no
BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr
BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount
BOOT_APM_ENTRY equ 0x9040
BOOT_APM_VERSION equ 0x9044
BOOT_APM_FLAGS equ 0x9046 ;unused
BOOT_APM_CODE_32 equ 0x9050
BOOT_APM_CODE_16 equ 0x9052
BOOT_APM_DATA_16 equ 0x9054
TMP_FILE_NAME equ 0
TMP_CMD_LINE equ 1024
TMP_ICON_OFFS equ 1280

View File

@ -70,7 +70,7 @@ APIC_init:
call IRQ_mask_all
; IOAPIC init
stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW
stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW+PG_NOCACHE
mov [IOAPIC_base], eax
mov eax, IOAPIC_VER
@ -134,7 +134,7 @@ LAPIC_init:
cmp [LAPIC_BASE], 0
jne .done
stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW
stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW+PG_NOCACHE
mov [LAPIC_BASE], eax
mov esi, eax

View File

@ -358,7 +358,7 @@ proc init_LFB
cmp dword [LFBAddress], -1
jne @f
mov [BOOT_VAR+0x901c], byte 2
mov [BOOT_VAR+BOOT_MTRR], byte 2
; max VGA=640*480*4=1228800 bytes
; + 32*640*4=81920 bytes for mouse pointer
stdcall alloc_pages, ((1228800+81920)/4096)
@ -378,7 +378,7 @@ proc init_LFB
@@:
test [SCR_MODE], word 0100000000000000b
jnz @f
mov [BOOT_VAR+0x901c], byte 2
mov [BOOT_VAR+BOOT_MTRR], byte 2
ret
@@:
call init_mtrr
@ -1364,7 +1364,7 @@ endp
align 4
proc init_mtrr
cmp [BOOT_VAR+0x901c], byte 2
cmp [BOOT_VAR+BOOT_MTRR], byte 2
je .exit
bt [cpu_caps], CAPS_MTRR

View File

@ -519,15 +519,6 @@ align 4
mov eax, [ebx]
pop esi
pop ebx
ret
align 4
madt_find:
ret
align 4
@ -544,7 +535,7 @@ check_acpi:
test eax, eax
jz .done
xchg bx, bx
; xchg bx, bx
mov [acpi_madt_base-OS_BASE], eax
mov ecx, [eax+36]
@ -555,7 +546,7 @@ check_acpi:
shr ebx, 24 ; read APIC ID
mov [edi], ebx ; bootstrap always first
inc [cpu_count]
inc [cpu_count-OS_BASE]
add edi, 4
lea edx, [eax+44]

View File

@ -330,6 +330,8 @@ tmp_page_tabs dd ?
__DEBUG__ fix 1
__DEBUG_LEVEL__ fix 1
include 'fdo.inc'
include 'init.inc'
org OS_BASE+$
@ -401,17 +403,17 @@ high_code:
call mutex_init
; SAVE REAL MODE VARIABLES
mov ax, [BOOT_VAR + 0x9031]
mov ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
mov [IDEContrRegsBaseAddr], ax
; --------------- APM ---------------------
; init selectors
mov ebx, [BOOT_VAR+0x9040] ; offset of APM entry point
movzx eax, word [BOOT_VAR+0x9050]; real-mode segment base address of
mov ebx, [BOOT_VAR+BOOT_APM_ENTRY] ; offset of APM entry point
movzx eax, word [BOOT_VAR+BOOT_APM_CODE_32] ; real-mode segment base address of
; protected-mode 32-bit code segment
movzx ecx, word [BOOT_VAR+0x9052]; real-mode segment base address of
movzx ecx, word [BOOT_VAR+BOOT_APM_CODE_16]; real-mode segment base address of
; protected-mode 16-bit code segment
movzx edx, word [BOOT_VAR+0x9054]; real-mode segment base address of
movzx edx, word [BOOT_VAR+BOOT_APM_DATA_16]; real-mode segment base address of
; protected-mode 16-bit data segment
shl eax, 4
@ -432,30 +434,28 @@ high_code:
mov dword[apm_entry], ebx
mov word [apm_entry + 4], apm_code_32 - gdts
mov eax, [BOOT_VAR + 0x9044]; version & flags
mov eax, [BOOT_VAR + BOOT_APM_VERSION] ; version & flags
mov [apm_vf], eax
; -----------------------------------------
; movzx eax,byte [BOOT_VAR+0x9010] ; mouse port
; mov [0xF604],byte 1 ;al
mov al, [BOOT_VAR+0x901F] ; DMA access
mov al, [BOOT_VAR+BOOT_DMA] ; DMA access
mov [allow_dma_access], al
movzx eax, byte [BOOT_VAR+0x9000] ; bpp
movzx eax, byte [BOOT_VAR+BOOT_BPP] ; bpp
mov [ScreenBPP], al
mov [_display.bpp], eax
mov [_display.vrefresh], 60
movzx eax, word [BOOT_VAR+0x900A]; X max
movzx eax, word [BOOT_VAR+BOOT_X_RES]; X max
mov [_display.width], eax
dec eax
mov [Screen_Max_X], eax
mov [screen_workarea.right], eax
movzx eax, word [BOOT_VAR+0x900C]; Y max
movzx eax, word [BOOT_VAR+BOOT_Y_RES]; Y max
mov [_display.height], eax
dec eax
mov [Screen_Max_Y], eax
mov [screen_workarea.bottom], eax
movzx eax, word [BOOT_VAR+0x9008]; screen mode
movzx eax, word [BOOT_VAR+BOOT_VESA_MODE]; screen mode
mov [SCR_MODE], eax
; mov eax, [BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add
; mov [BANK_SWITCH], eax
@ -464,7 +464,7 @@ high_code:
je @f
cmp [SCR_MODE], word 0x12 ; VGA 640x480
je @f
movzx eax, word[BOOT_VAR+0x9001] ; for other modes
movzx eax, word[BOOT_VAR+BOOT_PITCH] ; for other modes
mov [BytesPerScanLine], ax
mov [_display.pitch], eax
@@:
@ -482,8 +482,7 @@ high_code:
; GRAPHICS ADDRESSES
and byte [BOOT_VAR+0x901e], 0x0
mov eax, [BOOT_VAR+0x9018]
mov eax, [BOOT_VAR+BOOT_LFB]
mov [LFBAddress], eax
cmp [SCR_MODE], word 0100000000000000b
@ -1054,6 +1053,12 @@ if defined debug_com_base
end if
mov eax, [cpu_count]
test eax, eax
jnz @F
mov al, 1 ; at least one CPU
@@:
DEBUGF 1, "K : %d CPU detected\n", eax
; START MULTITASKING
@ -1080,7 +1085,6 @@ end if
; Fly :)
include 'unpacker.inc'
include 'fdo.inc'
align 4
boot_log:
@ -1214,10 +1218,10 @@ set_variables:
loop .fl60
push eax
mov ax, [BOOT_VAR+0x900c]
mov ax, [BOOT_VAR+BOOT_Y_RES]
shr ax, 1
shl eax, 16
mov ax, [BOOT_VAR+0x900A]
mov ax, [BOOT_VAR+BOOT_X_RES]
shr ax, 1
mov [MOUSE_X], eax

View File

@ -688,9 +688,9 @@ set_vmode:
mov bx, word [es:si+2] ; resolution Y
mov word [es:0x900A], ax ; resolution X
mov word [es:0x900C], bx ; resolution Y
mov word [es:0x9008], cx ; number of mode
mov word [es:BOOT_X_RES], ax ; resolution X
mov word [es:BOOT_Y_RES], bx ; resolution Y
mov word [es:BOOT_VESA_MODE], cx ; number of mode
cmp cx, 0x12
je .mode0x12_0x13
@ -709,11 +709,11 @@ set_vmode:
int 0x10
; LFB
mov eax, [es:mi.PhysBasePtr];di+0x28]
mov [es:0x9018], eax
mov [es:BOOT_LFB], eax
; ---- vbe voodoo
BytesPerLine equ 0x10
mov ax, [es:di+BytesPerLine]
mov [es:0x9001], ax
mov [es:BOOT_PITCH], ax
; BPP
cmp [es:mi.BitsPerPixel], 16
jne .l0
@ -722,12 +722,12 @@ set_vmode:
mov [es:mi.BitsPerPixel], 15
.l0:
mov al, byte [es:di+0x19]
mov [es:0x9000], al
mov [es:BOOT_BPP], al
jmp .exit
.mode0x12_0x13:
mov byte [es:0x9000], 32
or dword [es:0x9018], 0xFFFFFFFF; 0x800000
mov byte [es:BOOT_BPP], 32
or dword [es:BOOT_LFB], 0xFFFFFFFF; 0x800000
; VESA 1.2 PM BANK SWITCH ADDRESS
@ -753,9 +753,6 @@ set_vmode:
ret
; mov dword[es:0x9018],0x000A0000
; ret
;=============================================================================
;=============================================================================
;=============================================================================

View File

@ -157,7 +157,7 @@ sayerr:
push 0
pop es
and word [es:0x9031], 0
and word [es:BOOT_IDE_BASE_ADDR], 0
; \begin{Mario79}
; find HDD IDE DMA PCI device
; check for PCI BIOS
@ -194,7 +194,7 @@ sayerr:
int 0x1A
jc .nopci
and cx, 0xFFF0 ; clear address decode type
mov [es:0x9031], cx
mov [es:BOOT_IDE_BASE_ADDR], cx
.nopci:
; \end{Mario79}
@ -226,15 +226,15 @@ wait_loop: ; variant 2
loopnz @b
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; --------------- APM ---------------------
and word [es:0x9044], 0 ; ver = 0.0 (APM not found)
and word [es:BOOT_APM_VERSION], 0 ; ver = 0.0 (APM not found)
mov ax, 0x5300
xor bx, bx
int 0x15
jc apm_end ; APM not found
test cx, 2
jz apm_end ; APM 32-bit protected-mode interface not supported
mov [es:0x9044], ax ; Save APM Version
mov [es:0x9046], cx ; Save APM flags
mov [es:BOOT_APM_VERSION], ax ; Save APM Version
mov [es:BOOT_APM_FLAGS], cx ; Save APM flags
; Write APM ver ----
and ax, 0xf0f
@ -253,10 +253,10 @@ wait_loop: ; variant 2
xor bx, bx
int 0x15
mov [es:0x9040], ebx
mov [es:0x9050], ax
mov [es:0x9052], cx
mov [es:0x9054], dx
mov [es:BOOT_APM_ENTRY], ebx
mov [es:BOOT_APM_CODE_32], ax
mov [es:BOOT_APM_CODE_16], cx
mov [es:BOOT_APM_DATA_16], dx
apm_end:
_setcursor d80x25_top_num, 0
@ -670,18 +670,17 @@ end if
; GRAPHICS ACCELERATION
; force yes
mov [es:0x901C], byte 1
mov [es:BOOT_MTRR], byte 1
; DMA ACCESS TO HD
mov al, [preboot_dma]
mov [es:0x901F], al
mov [es:BOOT_DMA], al
; VRR_M USE
mov al, [preboot_vrrm]
mov [es:0x9030], al
mov [es:0x901E], byte 1
; mov al, [preboot_vrrm]
; mov [es:0x9030], al
; BOOT DEVICE
@ -698,7 +697,7 @@ end if
xor ax, ax
mov es, ax
mov ax, [es:0x9008] ; vga & 320x200
mov ax, [es:BOOT_VESA_MODE] ; vga & 320x200
mov bx, ax
cmp ax, 0x13
je setgr