forked from KolibriOS/kolibrios
acpi:print cpu count
git-svn-id: svn://kolibrios.org@2441 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
6f8e8ebd03
commit
6dcd9aa69b
@ -145,7 +145,7 @@ FirstDataSector dw 0 ; begin of data
|
|||||||
;
|
;
|
||||||
;=========================================================================
|
;=========================================================================
|
||||||
|
|
||||||
include 'bootvesa.inc' ;Include source for boot vesa
|
include 'bootvesa.inc' ;Include source for boot vesa
|
||||||
if defined extended_primary_loader
|
if defined extended_primary_loader
|
||||||
include 'parsers.inc'
|
include 'parsers.inc'
|
||||||
end if
|
end if
|
||||||
@ -387,7 +387,7 @@ sayerr:
|
|||||||
|
|
||||||
push 0
|
push 0
|
||||||
pop es
|
pop es
|
||||||
and word [es:0x9031], 0
|
and word [es:BOOT_IDE_BASE_ADDR], 0
|
||||||
; \begin{Mario79}
|
; \begin{Mario79}
|
||||||
; find HDD IDE DMA PCI device
|
; find HDD IDE DMA PCI device
|
||||||
; check for PCI BIOS
|
; check for PCI BIOS
|
||||||
@ -424,7 +424,7 @@ sayerr:
|
|||||||
int 0x1A
|
int 0x1A
|
||||||
jc .nopci
|
jc .nopci
|
||||||
and cx, 0xFFF0 ; clear address decode type
|
and cx, 0xFFF0 ; clear address decode type
|
||||||
mov [es:0x9031], cx
|
mov [es:BOOT_IDE_BASE_ADDR], cx
|
||||||
.nopci:
|
.nopci:
|
||||||
; \end{Mario79}
|
; \end{Mario79}
|
||||||
|
|
||||||
@ -456,15 +456,15 @@ wait_loop: ; variant 2
|
|||||||
loopnz @b
|
loopnz @b
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; --------------- APM ---------------------
|
; --------------- 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
|
mov ax, 0x5300
|
||||||
xor bx, bx
|
xor bx, bx
|
||||||
int 0x15
|
int 0x15
|
||||||
jc apm_end ; APM not found
|
jc apm_end ; APM not found
|
||||||
test cx, 2
|
test cx, 2
|
||||||
jz apm_end ; APM 32-bit protected-mode interface not supported
|
jz apm_end ; APM 32-bit protected-mode interface not supported
|
||||||
mov [es:0x9044], ax ; Save APM Version
|
mov [es:BOOT_APM_VERSION], ax ; Save APM Version
|
||||||
mov [es:0x9046], cx ; Save APM flags
|
mov [es:BOOT_APM_FLAGS], cx ; Save APM flags
|
||||||
|
|
||||||
; Write APM ver ----
|
; Write APM ver ----
|
||||||
and ax, 0xf0f
|
and ax, 0xf0f
|
||||||
@ -483,10 +483,10 @@ wait_loop: ; variant 2
|
|||||||
xor bx, bx
|
xor bx, bx
|
||||||
int 0x15
|
int 0x15
|
||||||
|
|
||||||
mov [es:0x9040], ebx
|
mov [es:BOOT_APM_ENTRY], ebx
|
||||||
mov [es:0x9050], ax
|
mov [es:BOOT_APM_CODE_32], ax
|
||||||
mov [es:0x9052], cx
|
mov [es:BOOT_APM_CODE_16], cx
|
||||||
mov [es:0x9054], dx
|
mov [es:BOOT_APM_DATA_16], dx
|
||||||
|
|
||||||
apm_end:
|
apm_end:
|
||||||
_setcursor d80x25_top_num, 0
|
_setcursor d80x25_top_num, 0
|
||||||
@ -630,7 +630,7 @@ end if
|
|||||||
push dword [es:8*4]
|
push dword [es:8*4]
|
||||||
pop dword [.oldtimer]
|
pop dword [.oldtimer]
|
||||||
push dword [.timer]
|
push dword [.timer]
|
||||||
pop dword [es:8*4]
|
pop dword [es:8*4]
|
||||||
; mov eax, [es:8*4]
|
; mov eax, [es:8*4]
|
||||||
; mov [.oldtimer], eax
|
; mov [.oldtimer], eax
|
||||||
; mov eax, [.timer]
|
; mov eax, [.timer]
|
||||||
@ -716,7 +716,7 @@ end if
|
|||||||
cmp ah, 0x50;x,0x50E0 ; down
|
cmp ah, 0x50;x,0x50E0 ; down
|
||||||
jne .pgup
|
jne .pgup
|
||||||
cmp word[es:si+10], -1
|
cmp word[es:si+10], -1
|
||||||
je .loops
|
je .loops
|
||||||
add word [cursor_pos], size_of_step
|
add word [cursor_pos], size_of_step
|
||||||
jmp .loops
|
jmp .loops
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ end if
|
|||||||
push word [es:bp+6]
|
push word [es:bp+6]
|
||||||
pop word [number_vm]
|
pop word [number_vm]
|
||||||
mov word [preboot_graph], bp ;save choose
|
mov word [preboot_graph], bp ;save choose
|
||||||
|
|
||||||
jmp .d
|
jmp .d
|
||||||
|
|
||||||
.change_b:
|
.change_b:
|
||||||
@ -947,18 +947,17 @@ end if
|
|||||||
|
|
||||||
; GRAPHICS ACCELERATION
|
; GRAPHICS ACCELERATION
|
||||||
; force yes
|
; force yes
|
||||||
mov [es:0x901C], byte 1
|
mov [es:BOOT_MTRR], byte 1
|
||||||
|
|
||||||
; DMA ACCESS TO HD
|
; DMA ACCESS TO HD
|
||||||
|
|
||||||
mov al, [preboot_dma]
|
mov al, [preboot_dma]
|
||||||
mov [es:0x901F], al
|
mov [es:BOOT_DMA], al
|
||||||
|
|
||||||
;; VRR_M USE
|
;; VRR_M USE
|
||||||
;
|
;
|
||||||
; mov al,[preboot_vrrm]
|
; mov al,[preboot_vrrm]
|
||||||
; mov [es:0x9030], al
|
; mov [es:0x9030], al
|
||||||
mov [es:0x901E], byte 1
|
|
||||||
|
|
||||||
; BOOT DEVICE
|
; BOOT DEVICE
|
||||||
|
|
||||||
@ -1005,7 +1004,7 @@ include '../detect/biosmem.inc'
|
|||||||
; TODO: !!!! read only first sector and set variables !!!!!
|
; TODO: !!!! read only first sector and set variables !!!!!
|
||||||
; ...
|
; ...
|
||||||
; TODO: !!! then read flippy image track by track
|
; TODO: !!! then read flippy image track by track
|
||||||
|
|
||||||
mov cx, 0x0001 ; startcyl,startsector
|
mov cx, 0x0001 ; startcyl,startsector
|
||||||
.a1:
|
.a1:
|
||||||
push cx dx
|
push cx dx
|
||||||
@ -1097,7 +1096,7 @@ include '../detect/biosmem.inc'
|
|||||||
; and copy them to extended memory
|
; and copy them to extended memory
|
||||||
mov si, movedesc
|
mov si, movedesc
|
||||||
mov [si+8*2+3], bh ; from
|
mov [si+8*2+3], bh ; from
|
||||||
|
|
||||||
mov ax, word [BPB_BytsPerSec]
|
mov ax, word [BPB_BytsPerSec]
|
||||||
shr ax, 1 ; words per sector
|
shr ax, 1 ; words per sector
|
||||||
mov cx, word [BPB_RsvdSecCnt]
|
mov cx, word [BPB_RsvdSecCnt]
|
||||||
@ -1105,7 +1104,7 @@ include '../detect/biosmem.inc'
|
|||||||
mul cx
|
mul cx
|
||||||
push ax ; save to stack count of words in boot+FAT
|
push ax ; save to stack count of words in boot+FAT
|
||||||
xchg ax, cx
|
xchg ax, cx
|
||||||
|
|
||||||
push es
|
push es
|
||||||
push ds
|
push ds
|
||||||
pop es
|
pop es
|
||||||
@ -1131,7 +1130,7 @@ sayerr_memmove:
|
|||||||
; TODO: BPB_NumFATs !!!!!
|
; TODO: BPB_NumFATs !!!!!
|
||||||
add bx, word [BPB_BytsPerSec] ; !!! TODO: may be need multiply by BPB_RsvdSecCnt !!!
|
add bx, word [BPB_BytsPerSec] ; !!! TODO: may be need multiply by BPB_RsvdSecCnt !!!
|
||||||
mov byte [si+8*2+3], bh ; bx - begin of FAT
|
mov byte [si+8*2+3], bh ; bx - begin of FAT
|
||||||
|
|
||||||
mov ax, word [BPB_BytsPerSec]
|
mov ax, word [BPB_BytsPerSec]
|
||||||
shr ax, 1 ; words per sector
|
shr ax, 1 ; words per sector
|
||||||
mov cx, word [BPB_FATSz16]
|
mov cx, word [BPB_FATSz16]
|
||||||
@ -1146,12 +1145,12 @@ sayerr_memmove:
|
|||||||
pop es
|
pop es
|
||||||
test ah, ah
|
test ah, ah
|
||||||
jnz sayerr_floppy
|
jnz sayerr_floppy
|
||||||
|
|
||||||
mov ax, cx
|
mov ax, cx
|
||||||
shl ax, 1
|
shl ax, 1
|
||||||
and eax, 0ffffh ; ax - count of bytes in FAT
|
and eax, 0ffffh ; ax - count of bytes in FAT
|
||||||
add dword [si+8*3+2], eax
|
add dword [si+8*3+2], eax
|
||||||
|
|
||||||
; reading RootDir
|
; reading RootDir
|
||||||
; TODO: BPB_NumFATs
|
; TODO: BPB_NumFATs
|
||||||
add bx, ax
|
add bx, ax
|
||||||
@ -1176,7 +1175,7 @@ sayerr_memmove:
|
|||||||
pop bx
|
pop bx
|
||||||
push bx
|
push bx
|
||||||
add word [FirstDataSector], bx ; Begin of data region of floppy
|
add word [FirstDataSector], bx ; Begin of data region of floppy
|
||||||
|
|
||||||
; read RootDir
|
; read RootDir
|
||||||
call conv_abs_to_THS
|
call conv_abs_to_THS
|
||||||
pop ax
|
pop ax
|
||||||
@ -1337,7 +1336,7 @@ end if
|
|||||||
xor ax, ax
|
xor ax, ax
|
||||||
mov es, ax
|
mov es, ax
|
||||||
|
|
||||||
mov ax, [es:0x9008] ; vga & 320x200
|
mov ax, [es:BOOT_VESA_MODE] ; vga & 320x200
|
||||||
mov bx, ax
|
mov bx, ax
|
||||||
cmp ax, 0x13
|
cmp ax, 0x13
|
||||||
je setgr
|
je setgr
|
||||||
|
@ -193,7 +193,7 @@ calc_vmodes_table:
|
|||||||
mov word [es:bx], 640
|
mov word [es:bx], 640
|
||||||
mov word [es:bx+2], 480
|
mov word [es:bx+2], 480
|
||||||
mov word [es:bx+6], 0x13
|
mov word [es:bx+6], 0x13
|
||||||
|
|
||||||
mov word [es:bx+10], 640
|
mov word [es:bx+10], 640
|
||||||
mov word [es:bx+12], 480
|
mov word [es:bx+12], 480
|
||||||
mov word [es:bx+16], 0x12
|
mov word [es:bx+16], 0x12
|
||||||
@ -251,7 +251,7 @@ calc_vmodes_table:
|
|||||||
mov [es:bx+6], cx ; +6 : mode number
|
mov [es:bx+6], cx ; +6 : mode number
|
||||||
movzx ax, byte [es:mi.BitsPerPixel]
|
movzx ax, byte [es:mi.BitsPerPixel]
|
||||||
mov word [es:bx+8], ax ; +8 : bits per pixel
|
mov word [es:bx+8], ax ; +8 : bits per pixel
|
||||||
add bx, size_of_step ; size of record
|
add bx, size_of_step ; size of record
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
add si, 2
|
add si, 2
|
||||||
@ -278,11 +278,11 @@ calc_vmodes_table:
|
|||||||
; je .exit
|
; je .exit
|
||||||
; add bx,word [es:bp+2]
|
; add bx,word [es:bp+2]
|
||||||
; add bx,word [es:bp+8]
|
; add bx,word [es:bp+8]
|
||||||
;
|
;
|
||||||
; cmp ax,bx
|
; cmp ax,bx
|
||||||
; ja .loops
|
; ja .loops
|
||||||
; jmp .again
|
; jmp .again
|
||||||
;.loops:
|
;.loops:
|
||||||
; push dword [es:si]
|
; push dword [es:si]
|
||||||
; push dword [es:si+4]
|
; push dword [es:si+4]
|
||||||
; push dword [es:si+8]
|
; push dword [es:si+8]
|
||||||
@ -353,7 +353,7 @@ end if
|
|||||||
mov si, mode9
|
mov si, mode9
|
||||||
.print:
|
.print:
|
||||||
call printplain
|
call printplain
|
||||||
ret
|
ret
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
check_first_parm:
|
check_first_parm:
|
||||||
if defined extended_primary_loader
|
if defined extended_primary_loader
|
||||||
@ -493,7 +493,7 @@ end if
|
|||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
|
||||||
;default_vmode:
|
;default_vmode:
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
draw_vmodes_table:
|
draw_vmodes_table:
|
||||||
_setcursor 9, 2
|
_setcursor 9, 2
|
||||||
@ -515,10 +515,10 @@ draw_vmodes_table:
|
|||||||
|
|
||||||
|
|
||||||
add cx, size_of_step*long_v_table
|
add cx, size_of_step*long_v_table
|
||||||
|
|
||||||
cmp ax, cx
|
cmp ax, cx
|
||||||
jb .ok
|
jb .ok
|
||||||
|
|
||||||
sub cx, size_of_step*long_v_table
|
sub cx, size_of_step*long_v_table
|
||||||
add cx, size_of_step
|
add cx, size_of_step
|
||||||
cmp cx, word[end_cursor]
|
cmp cx, word[end_cursor]
|
||||||
@ -624,7 +624,7 @@ draw_vmodes_table:
|
|||||||
;draw cursor
|
;draw cursor
|
||||||
mov word[ds:_rs+21], '>>'
|
mov word[ds:_rs+21], '>>'
|
||||||
mov word[ds:_rs+46], '<<'
|
mov word[ds:_rs+46], '<<'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.next:
|
.next:
|
||||||
@ -707,7 +707,7 @@ clear_vmodes_table:
|
|||||||
mov cx, 70
|
mov cx, 70
|
||||||
add di, 20
|
add di, 20
|
||||||
dec bp
|
dec bp
|
||||||
jns .loop_start
|
jns .loop_start
|
||||||
pop es
|
pop es
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
@ -720,15 +720,15 @@ set_vmode:
|
|||||||
|
|
||||||
mov si, word [preboot_graph] ;[preboot_graph]
|
mov si, word [preboot_graph] ;[preboot_graph]
|
||||||
mov cx, word [es:si+6] ; number of mode
|
mov cx, word [es:si+6] ; number of mode
|
||||||
|
|
||||||
|
|
||||||
mov ax, word [es:si+0] ; resolution X
|
mov ax, word [es:si+0] ; resolution X
|
||||||
mov bx, word [es:si+2] ; resolution Y
|
mov bx, word [es:si+2] ; resolution Y
|
||||||
|
|
||||||
|
|
||||||
mov word [es:0x900A], ax ; resolution X
|
mov word [es:BOOT_X_RES], ax ; resolution X
|
||||||
mov word [es:0x900C], bx ; resolution Y
|
mov word [es:BOOT_Y_RES], bx ; resolution Y
|
||||||
mov word [es:0x9008], cx ; number of mode
|
mov word [es:BOOT_VESA_MODE], cx ; number of mode
|
||||||
|
|
||||||
cmp cx, 0x12
|
cmp cx, 0x12
|
||||||
je .mode0x12_0x13
|
je .mode0x12_0x13
|
||||||
@ -747,11 +747,11 @@ set_vmode:
|
|||||||
int 0x10
|
int 0x10
|
||||||
; LFB
|
; LFB
|
||||||
mov eax, [es:mi.PhysBasePtr];di+0x28]
|
mov eax, [es:mi.PhysBasePtr];di+0x28]
|
||||||
mov [es:0x9018], eax
|
mov [es:BOOT_LFB], eax
|
||||||
; ---- vbe voodoo
|
; ---- vbe voodoo
|
||||||
BytesPerLine equ 0x10
|
BytesPerLine equ 0x10
|
||||||
mov ax, [es:di+BytesPerLine]
|
mov ax, [es:di+BytesPerLine]
|
||||||
mov [es:0x9001], ax
|
mov [es:BOOT_PITCH], ax
|
||||||
; BPP
|
; BPP
|
||||||
cmp [es:mi.BitsPerPixel], 16
|
cmp [es:mi.BitsPerPixel], 16
|
||||||
jne .l0
|
jne .l0
|
||||||
@ -760,12 +760,12 @@ set_vmode:
|
|||||||
mov [es:mi.BitsPerPixel], 15
|
mov [es:mi.BitsPerPixel], 15
|
||||||
.l0:
|
.l0:
|
||||||
mov al, byte [es:di+0x19]
|
mov al, byte [es:di+0x19]
|
||||||
mov [es:0x9000], al
|
mov [es:BOOT_BPP], al
|
||||||
jmp .exit
|
jmp .exit
|
||||||
|
|
||||||
.mode0x12_0x13:
|
.mode0x12_0x13:
|
||||||
mov byte [es:0x9000], 32
|
mov byte [es:BOOT_BPP], 32
|
||||||
or dword [es:0x9018], 0xFFFFFFFF; 0x800000
|
or dword [es:BOOT_LFB], 0xFFFFFFFF; 0x800000
|
||||||
|
|
||||||
|
|
||||||
; VESA 1.2 PM BANK SWITCH ADDRESS
|
; VESA 1.2 PM BANK SWITCH ADDRESS
|
||||||
@ -788,10 +788,6 @@ set_vmode:
|
|||||||
.exit:
|
.exit:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
; mov dword[es:0x9018],0x000A0000
|
|
||||||
; ret
|
|
||||||
|
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
|
@ -363,22 +363,30 @@ PG_SHARED equ 0x200
|
|||||||
|
|
||||||
;;;;;;;;;;;boot time variables
|
;;;;;;;;;;;boot time variables
|
||||||
|
|
||||||
;BOOT_BPP equ 0x9000 ;byte bits per pixel
|
BOOT_BPP equ 0x9000 ;byte bits per pixel
|
||||||
BOOT_SCANLINE equ 0x9001 ;word scanline length
|
BOOT_PITCH equ 0x9001 ;word scanline length
|
||||||
BOOT_VESA_MODE equ 0x9008 ;word vesa video mode
|
BOOT_VESA_MODE equ 0x9008 ;word vesa video mode
|
||||||
;;BOOT_X_RES equ 0x900A ;word X res
|
BOOT_X_RES equ 0x900A ;word X res
|
||||||
;;BOOT_Y_RES equ 0x900C ;word Y res
|
BOOT_Y_RES equ 0x900C ;word Y res
|
||||||
;;BOOT_MOUSE_PORT equ 0x9010 ;byte mouse port - not used
|
;;BOOT_MOUSE_PORT equ 0x9010 ;byte mouse port - not used
|
||||||
BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch
|
BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch
|
||||||
BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address
|
BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address
|
||||||
BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration
|
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_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_PCI_DATA equ 0x9020 ;8bytes pci data
|
||||||
BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no
|
BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no
|
||||||
BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr
|
BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr
|
||||||
BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount
|
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_FILE_NAME equ 0
|
||||||
TMP_CMD_LINE equ 1024
|
TMP_CMD_LINE equ 1024
|
||||||
TMP_ICON_OFFS equ 1280
|
TMP_ICON_OFFS equ 1280
|
||||||
|
@ -70,7 +70,7 @@ APIC_init:
|
|||||||
call IRQ_mask_all
|
call IRQ_mask_all
|
||||||
|
|
||||||
; IOAPIC init
|
; 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 [IOAPIC_base], eax
|
||||||
|
|
||||||
mov eax, IOAPIC_VER
|
mov eax, IOAPIC_VER
|
||||||
@ -134,7 +134,7 @@ LAPIC_init:
|
|||||||
cmp [LAPIC_BASE], 0
|
cmp [LAPIC_BASE], 0
|
||||||
jne .done
|
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 [LAPIC_BASE], eax
|
||||||
mov esi, eax
|
mov esi, eax
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ proc init_LFB
|
|||||||
|
|
||||||
cmp dword [LFBAddress], -1
|
cmp dword [LFBAddress], -1
|
||||||
jne @f
|
jne @f
|
||||||
mov [BOOT_VAR+0x901c], byte 2
|
mov [BOOT_VAR+BOOT_MTRR], byte 2
|
||||||
; max VGA=640*480*4=1228800 bytes
|
; max VGA=640*480*4=1228800 bytes
|
||||||
; + 32*640*4=81920 bytes for mouse pointer
|
; + 32*640*4=81920 bytes for mouse pointer
|
||||||
stdcall alloc_pages, ((1228800+81920)/4096)
|
stdcall alloc_pages, ((1228800+81920)/4096)
|
||||||
@ -378,7 +378,7 @@ proc init_LFB
|
|||||||
@@:
|
@@:
|
||||||
test [SCR_MODE], word 0100000000000000b
|
test [SCR_MODE], word 0100000000000000b
|
||||||
jnz @f
|
jnz @f
|
||||||
mov [BOOT_VAR+0x901c], byte 2
|
mov [BOOT_VAR+BOOT_MTRR], byte 2
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
call init_mtrr
|
call init_mtrr
|
||||||
@ -1364,7 +1364,7 @@ endp
|
|||||||
align 4
|
align 4
|
||||||
proc init_mtrr
|
proc init_mtrr
|
||||||
|
|
||||||
cmp [BOOT_VAR+0x901c], byte 2
|
cmp [BOOT_VAR+BOOT_MTRR], byte 2
|
||||||
je .exit
|
je .exit
|
||||||
|
|
||||||
bt [cpu_caps], CAPS_MTRR
|
bt [cpu_caps], CAPS_MTRR
|
||||||
|
@ -519,15 +519,6 @@ align 4
|
|||||||
mov eax, [ebx]
|
mov eax, [ebx]
|
||||||
pop esi
|
pop esi
|
||||||
pop ebx
|
pop ebx
|
||||||
ret
|
|
||||||
|
|
||||||
align 4
|
|
||||||
madt_find:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@ -544,7 +535,7 @@ check_acpi:
|
|||||||
test eax, eax
|
test eax, eax
|
||||||
jz .done
|
jz .done
|
||||||
|
|
||||||
xchg bx, bx
|
; xchg bx, bx
|
||||||
|
|
||||||
mov [acpi_madt_base-OS_BASE], eax
|
mov [acpi_madt_base-OS_BASE], eax
|
||||||
mov ecx, [eax+36]
|
mov ecx, [eax+36]
|
||||||
@ -555,7 +546,7 @@ check_acpi:
|
|||||||
shr ebx, 24 ; read APIC ID
|
shr ebx, 24 ; read APIC ID
|
||||||
|
|
||||||
mov [edi], ebx ; bootstrap always first
|
mov [edi], ebx ; bootstrap always first
|
||||||
inc [cpu_count]
|
inc [cpu_count-OS_BASE]
|
||||||
add edi, 4
|
add edi, 4
|
||||||
|
|
||||||
lea edx, [eax+44]
|
lea edx, [eax+44]
|
||||||
|
@ -328,8 +328,10 @@ bios32_entry dd ?
|
|||||||
tmp_page_tabs dd ?
|
tmp_page_tabs dd ?
|
||||||
|
|
||||||
|
|
||||||
__DEBUG__ fix 1
|
__DEBUG__ fix 1
|
||||||
__DEBUG_LEVEL__ fix 1
|
__DEBUG_LEVEL__ fix 1
|
||||||
|
include 'fdo.inc'
|
||||||
|
|
||||||
include 'init.inc'
|
include 'init.inc'
|
||||||
|
|
||||||
org OS_BASE+$
|
org OS_BASE+$
|
||||||
@ -401,17 +403,17 @@ high_code:
|
|||||||
call mutex_init
|
call mutex_init
|
||||||
|
|
||||||
; SAVE REAL MODE VARIABLES
|
; SAVE REAL MODE VARIABLES
|
||||||
mov ax, [BOOT_VAR + 0x9031]
|
mov ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
|
||||||
mov [IDEContrRegsBaseAddr], ax
|
mov [IDEContrRegsBaseAddr], ax
|
||||||
; --------------- APM ---------------------
|
; --------------- APM ---------------------
|
||||||
|
|
||||||
; init selectors
|
; init selectors
|
||||||
mov ebx, [BOOT_VAR+0x9040] ; offset of APM entry point
|
mov ebx, [BOOT_VAR+BOOT_APM_ENTRY] ; offset of APM entry point
|
||||||
movzx eax, word [BOOT_VAR+0x9050]; real-mode segment base address of
|
movzx eax, word [BOOT_VAR+BOOT_APM_CODE_32] ; real-mode segment base address of
|
||||||
; protected-mode 32-bit code segment
|
; 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
|
; 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
|
; protected-mode 16-bit data segment
|
||||||
|
|
||||||
shl eax, 4
|
shl eax, 4
|
||||||
@ -432,30 +434,28 @@ high_code:
|
|||||||
mov dword[apm_entry], ebx
|
mov dword[apm_entry], ebx
|
||||||
mov word [apm_entry + 4], apm_code_32 - gdts
|
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
|
mov [apm_vf], eax
|
||||||
; -----------------------------------------
|
; -----------------------------------------
|
||||||
; movzx eax,byte [BOOT_VAR+0x9010] ; mouse port
|
mov al, [BOOT_VAR+BOOT_DMA] ; DMA access
|
||||||
; mov [0xF604],byte 1 ;al
|
|
||||||
mov al, [BOOT_VAR+0x901F] ; DMA access
|
|
||||||
mov [allow_dma_access], al
|
mov [allow_dma_access], al
|
||||||
movzx eax, byte [BOOT_VAR+0x9000] ; bpp
|
movzx eax, byte [BOOT_VAR+BOOT_BPP] ; bpp
|
||||||
mov [ScreenBPP], al
|
mov [ScreenBPP], al
|
||||||
|
|
||||||
mov [_display.bpp], eax
|
mov [_display.bpp], eax
|
||||||
mov [_display.vrefresh], 60
|
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
|
mov [_display.width], eax
|
||||||
dec eax
|
dec eax
|
||||||
mov [Screen_Max_X], eax
|
mov [Screen_Max_X], eax
|
||||||
mov [screen_workarea.right], 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
|
mov [_display.height], eax
|
||||||
dec eax
|
dec eax
|
||||||
mov [Screen_Max_Y], eax
|
mov [Screen_Max_Y], eax
|
||||||
mov [screen_workarea.bottom], 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 [SCR_MODE], eax
|
||||||
; mov eax, [BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add
|
; mov eax, [BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add
|
||||||
; mov [BANK_SWITCH], eax
|
; mov [BANK_SWITCH], eax
|
||||||
@ -464,7 +464,7 @@ high_code:
|
|||||||
je @f
|
je @f
|
||||||
cmp [SCR_MODE], word 0x12 ; VGA 640x480
|
cmp [SCR_MODE], word 0x12 ; VGA 640x480
|
||||||
je @f
|
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 [BytesPerScanLine], ax
|
||||||
mov [_display.pitch], eax
|
mov [_display.pitch], eax
|
||||||
@@:
|
@@:
|
||||||
@ -482,8 +482,7 @@ high_code:
|
|||||||
|
|
||||||
; GRAPHICS ADDRESSES
|
; GRAPHICS ADDRESSES
|
||||||
|
|
||||||
and byte [BOOT_VAR+0x901e], 0x0
|
mov eax, [BOOT_VAR+BOOT_LFB]
|
||||||
mov eax, [BOOT_VAR+0x9018]
|
|
||||||
mov [LFBAddress], eax
|
mov [LFBAddress], eax
|
||||||
|
|
||||||
cmp [SCR_MODE], word 0100000000000000b
|
cmp [SCR_MODE], word 0100000000000000b
|
||||||
@ -1054,6 +1053,12 @@ if defined debug_com_base
|
|||||||
|
|
||||||
|
|
||||||
end if
|
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
|
; START MULTITASKING
|
||||||
|
|
||||||
@ -1080,7 +1085,6 @@ end if
|
|||||||
; Fly :)
|
; Fly :)
|
||||||
|
|
||||||
include 'unpacker.inc'
|
include 'unpacker.inc'
|
||||||
include 'fdo.inc'
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
boot_log:
|
boot_log:
|
||||||
@ -1214,10 +1218,10 @@ set_variables:
|
|||||||
loop .fl60
|
loop .fl60
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
mov ax, [BOOT_VAR+0x900c]
|
mov ax, [BOOT_VAR+BOOT_Y_RES]
|
||||||
shr ax, 1
|
shr ax, 1
|
||||||
shl eax, 16
|
shl eax, 16
|
||||||
mov ax, [BOOT_VAR+0x900A]
|
mov ax, [BOOT_VAR+BOOT_X_RES]
|
||||||
shr ax, 1
|
shr ax, 1
|
||||||
mov [MOUSE_X], eax
|
mov [MOUSE_X], eax
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ calc_vmodes_table:
|
|||||||
mov word [es:bx], 640
|
mov word [es:bx], 640
|
||||||
mov word [es:bx+2], 480
|
mov word [es:bx+2], 480
|
||||||
mov word [es:bx+6], 0x13
|
mov word [es:bx+6], 0x13
|
||||||
|
|
||||||
mov word [es:bx+10], 640
|
mov word [es:bx+10], 640
|
||||||
mov word [es:bx+12], 480
|
mov word [es:bx+12], 480
|
||||||
mov word [es:bx+16], 0x12
|
mov word [es:bx+16], 0x12
|
||||||
@ -249,7 +249,7 @@ calc_vmodes_table:
|
|||||||
mov [es:bx+6], cx ; +6 : mode number
|
mov [es:bx+6], cx ; +6 : mode number
|
||||||
movzx ax, byte [es:mi.BitsPerPixel]
|
movzx ax, byte [es:mi.BitsPerPixel]
|
||||||
mov word [es:bx+8], ax ; +8 : bits per pixel
|
mov word [es:bx+8], ax ; +8 : bits per pixel
|
||||||
add bx, size_of_step ; size of record
|
add bx, size_of_step ; size of record
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
add si, 2
|
add si, 2
|
||||||
@ -276,11 +276,11 @@ calc_vmodes_table:
|
|||||||
; je .exit
|
; je .exit
|
||||||
; add bx,word [es:bp+2]
|
; add bx,word [es:bp+2]
|
||||||
; add bx,word [es:bp+8]
|
; add bx,word [es:bp+8]
|
||||||
;
|
;
|
||||||
; cmp ax,bx
|
; cmp ax,bx
|
||||||
; ja .loops
|
; ja .loops
|
||||||
; jmp .again
|
; jmp .again
|
||||||
;.loops:
|
;.loops:
|
||||||
; push dword [es:si]
|
; push dword [es:si]
|
||||||
; push dword [es:si+4]
|
; push dword [es:si+4]
|
||||||
; push dword [es:si+8]
|
; push dword [es:si+8]
|
||||||
@ -455,7 +455,7 @@ check_first_parm:
|
|||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
|
|
||||||
;default_vmode:
|
;default_vmode:
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
draw_vmodes_table:
|
draw_vmodes_table:
|
||||||
_setcursor 9, 2
|
_setcursor 9, 2
|
||||||
@ -477,10 +477,10 @@ draw_vmodes_table:
|
|||||||
|
|
||||||
|
|
||||||
add cx, size_of_step*long_v_table
|
add cx, size_of_step*long_v_table
|
||||||
|
|
||||||
cmp ax, cx
|
cmp ax, cx
|
||||||
jb .ok
|
jb .ok
|
||||||
|
|
||||||
sub cx, size_of_step*long_v_table
|
sub cx, size_of_step*long_v_table
|
||||||
add cx, size_of_step
|
add cx, size_of_step
|
||||||
cmp cx, word[end_cursor]
|
cmp cx, word[end_cursor]
|
||||||
@ -586,7 +586,7 @@ draw_vmodes_table:
|
|||||||
;draw cursor
|
;draw cursor
|
||||||
mov word[ds:_rs+21], '>>'
|
mov word[ds:_rs+21], '>>'
|
||||||
mov word[ds:_rs+46], '<<'
|
mov word[ds:_rs+46], '<<'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.next:
|
.next:
|
||||||
@ -682,15 +682,15 @@ set_vmode:
|
|||||||
|
|
||||||
mov si, word [preboot_graph] ;[preboot_graph]
|
mov si, word [preboot_graph] ;[preboot_graph]
|
||||||
mov cx, word [es:si+6] ; number of mode
|
mov cx, word [es:si+6] ; number of mode
|
||||||
|
|
||||||
|
|
||||||
mov ax, word [es:si+0] ; resolution X
|
mov ax, word [es:si+0] ; resolution X
|
||||||
mov bx, word [es:si+2] ; resolution Y
|
mov bx, word [es:si+2] ; resolution Y
|
||||||
|
|
||||||
|
|
||||||
mov word [es:0x900A], ax ; resolution X
|
mov word [es:BOOT_X_RES], ax ; resolution X
|
||||||
mov word [es:0x900C], bx ; resolution Y
|
mov word [es:BOOT_Y_RES], bx ; resolution Y
|
||||||
mov word [es:0x9008], cx ; number of mode
|
mov word [es:BOOT_VESA_MODE], cx ; number of mode
|
||||||
|
|
||||||
cmp cx, 0x12
|
cmp cx, 0x12
|
||||||
je .mode0x12_0x13
|
je .mode0x12_0x13
|
||||||
@ -709,11 +709,11 @@ set_vmode:
|
|||||||
int 0x10
|
int 0x10
|
||||||
; LFB
|
; LFB
|
||||||
mov eax, [es:mi.PhysBasePtr];di+0x28]
|
mov eax, [es:mi.PhysBasePtr];di+0x28]
|
||||||
mov [es:0x9018], eax
|
mov [es:BOOT_LFB], eax
|
||||||
; ---- vbe voodoo
|
; ---- vbe voodoo
|
||||||
BytesPerLine equ 0x10
|
BytesPerLine equ 0x10
|
||||||
mov ax, [es:di+BytesPerLine]
|
mov ax, [es:di+BytesPerLine]
|
||||||
mov [es:0x9001], ax
|
mov [es:BOOT_PITCH], ax
|
||||||
; BPP
|
; BPP
|
||||||
cmp [es:mi.BitsPerPixel], 16
|
cmp [es:mi.BitsPerPixel], 16
|
||||||
jne .l0
|
jne .l0
|
||||||
@ -722,12 +722,12 @@ set_vmode:
|
|||||||
mov [es:mi.BitsPerPixel], 15
|
mov [es:mi.BitsPerPixel], 15
|
||||||
.l0:
|
.l0:
|
||||||
mov al, byte [es:di+0x19]
|
mov al, byte [es:di+0x19]
|
||||||
mov [es:0x9000], al
|
mov [es:BOOT_BPP], al
|
||||||
jmp .exit
|
jmp .exit
|
||||||
|
|
||||||
.mode0x12_0x13:
|
.mode0x12_0x13:
|
||||||
mov byte [es:0x9000], 32
|
mov byte [es:BOOT_BPP], 32
|
||||||
or dword [es:0x9018], 0xFFFFFFFF; 0x800000
|
or dword [es:BOOT_LFB], 0xFFFFFFFF; 0x800000
|
||||||
|
|
||||||
|
|
||||||
; VESA 1.2 PM BANK SWITCH ADDRESS
|
; VESA 1.2 PM BANK SWITCH ADDRESS
|
||||||
@ -753,9 +753,6 @@ set_vmode:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
; mov dword[es:0x9018],0x000A0000
|
|
||||||
; ret
|
|
||||||
|
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
|
@ -157,7 +157,7 @@ sayerr:
|
|||||||
|
|
||||||
push 0
|
push 0
|
||||||
pop es
|
pop es
|
||||||
and word [es:0x9031], 0
|
and word [es:BOOT_IDE_BASE_ADDR], 0
|
||||||
; \begin{Mario79}
|
; \begin{Mario79}
|
||||||
; find HDD IDE DMA PCI device
|
; find HDD IDE DMA PCI device
|
||||||
; check for PCI BIOS
|
; check for PCI BIOS
|
||||||
@ -194,7 +194,7 @@ sayerr:
|
|||||||
int 0x1A
|
int 0x1A
|
||||||
jc .nopci
|
jc .nopci
|
||||||
and cx, 0xFFF0 ; clear address decode type
|
and cx, 0xFFF0 ; clear address decode type
|
||||||
mov [es:0x9031], cx
|
mov [es:BOOT_IDE_BASE_ADDR], cx
|
||||||
.nopci:
|
.nopci:
|
||||||
; \end{Mario79}
|
; \end{Mario79}
|
||||||
|
|
||||||
@ -226,15 +226,15 @@ wait_loop: ; variant 2
|
|||||||
loopnz @b
|
loopnz @b
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; --------------- APM ---------------------
|
; --------------- 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
|
mov ax, 0x5300
|
||||||
xor bx, bx
|
xor bx, bx
|
||||||
int 0x15
|
int 0x15
|
||||||
jc apm_end ; APM not found
|
jc apm_end ; APM not found
|
||||||
test cx, 2
|
test cx, 2
|
||||||
jz apm_end ; APM 32-bit protected-mode interface not supported
|
jz apm_end ; APM 32-bit protected-mode interface not supported
|
||||||
mov [es:0x9044], ax ; Save APM Version
|
mov [es:BOOT_APM_VERSION], ax ; Save APM Version
|
||||||
mov [es:0x9046], cx ; Save APM flags
|
mov [es:BOOT_APM_FLAGS], cx ; Save APM flags
|
||||||
|
|
||||||
; Write APM ver ----
|
; Write APM ver ----
|
||||||
and ax, 0xf0f
|
and ax, 0xf0f
|
||||||
@ -253,10 +253,10 @@ wait_loop: ; variant 2
|
|||||||
xor bx, bx
|
xor bx, bx
|
||||||
int 0x15
|
int 0x15
|
||||||
|
|
||||||
mov [es:0x9040], ebx
|
mov [es:BOOT_APM_ENTRY], ebx
|
||||||
mov [es:0x9050], ax
|
mov [es:BOOT_APM_CODE_32], ax
|
||||||
mov [es:0x9052], cx
|
mov [es:BOOT_APM_CODE_16], cx
|
||||||
mov [es:0x9054], dx
|
mov [es:BOOT_APM_DATA_16], dx
|
||||||
|
|
||||||
apm_end:
|
apm_end:
|
||||||
_setcursor d80x25_top_num, 0
|
_setcursor d80x25_top_num, 0
|
||||||
@ -514,7 +514,7 @@ cfgmanager:
|
|||||||
push word [es:bp+6]
|
push word [es:bp+6]
|
||||||
pop word [number_vm]
|
pop word [number_vm]
|
||||||
mov word [preboot_graph], bp ;save choose
|
mov word [preboot_graph], bp ;save choose
|
||||||
|
|
||||||
jmp .d
|
jmp .d
|
||||||
|
|
||||||
.change_b:
|
.change_b:
|
||||||
@ -670,18 +670,17 @@ end if
|
|||||||
|
|
||||||
; GRAPHICS ACCELERATION
|
; GRAPHICS ACCELERATION
|
||||||
; force yes
|
; force yes
|
||||||
mov [es:0x901C], byte 1
|
mov [es:BOOT_MTRR], byte 1
|
||||||
|
|
||||||
; DMA ACCESS TO HD
|
; DMA ACCESS TO HD
|
||||||
|
|
||||||
mov al, [preboot_dma]
|
mov al, [preboot_dma]
|
||||||
mov [es:0x901F], al
|
mov [es:BOOT_DMA], al
|
||||||
|
|
||||||
; VRR_M USE
|
; VRR_M USE
|
||||||
|
|
||||||
mov al, [preboot_vrrm]
|
; mov al, [preboot_vrrm]
|
||||||
mov [es:0x9030], al
|
; mov [es:0x9030], al
|
||||||
mov [es:0x901E], byte 1
|
|
||||||
|
|
||||||
; BOOT DEVICE
|
; BOOT DEVICE
|
||||||
|
|
||||||
@ -698,7 +697,7 @@ end if
|
|||||||
xor ax, ax
|
xor ax, ax
|
||||||
mov es, ax
|
mov es, ax
|
||||||
|
|
||||||
mov ax, [es:0x9008] ; vga & 320x200
|
mov ax, [es:BOOT_VESA_MODE] ; vga & 320x200
|
||||||
mov bx, ax
|
mov bx, ax
|
||||||
cmp ax, 0x13
|
cmp ax, 0x13
|
||||||
je setgr
|
je setgr
|
||||||
|
Loading…
Reference in New Issue
Block a user