Kernel: initialize keyboard before mouse

git-svn-id: svn://kolibrios.org@2141 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2011-09-01 06:55:15 +00:00
parent 57633abf05
commit 7df91a3195
3 changed files with 51 additions and 55 deletions

View File

@ -1,7 +1,7 @@
@echo off @echo off
cls cls
set languages=en ru ge et set languages=en ru ge et
set drivers=com_mouse emu10k1x ensoniq fm801 infinity sis sound uart viasound vmode vt823(x) set drivers=com_mouse emu10k1x ensoniq fm801 infinity sis sound uart viasound vmode vt823x
set targets=all kernel drivers skins clean set targets=all kernel drivers skins clean
call :Check_Target %1 call :Check_Target %1

View File

@ -286,7 +286,7 @@ align 4
proc alloc_kernel_space stdcall, size:dword proc alloc_kernel_space stdcall, size:dword
local block_ind:DWORD local block_ind:DWORD
xchg bx, bx ; xchg bx, bx
push ebx push ebx
push esi push esi
@ -438,7 +438,7 @@ endp
align 4 align 4
proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
xchg bx, bx ; xchg bx, bx
mov ecx, heap_mutex mov ecx, heap_mutex
call mutex_lock call mutex_lock

View File

@ -616,43 +616,12 @@ high_code:
call pci_irq_fixup call pci_irq_fixup
call unmask_timer
; SET KEYBOARD PARAMETERS
mov al, 0xf6 ; reset keyboard, scan enabled
call kb_write
; wait until 8042 is ready
xor ecx,ecx
@@:
in al,64h
and al,00000010b
loopnz @b
; mov al, 0xED ; Keyboard LEDs - only for testing!
; call kb_write
; call kb_read
; mov al, 111b
; call kb_write
; call kb_read
mov al, 0xF3 ; set repeat rate & delay
call kb_write
; call kb_read
mov al, 0 ; 30 250 ;00100010b ; 24 500 ;00100100b ; 20 500
call kb_write
; call kb_read
;// mike.dld [
call set_lights
stdcall attach_int_handler, 1, irq1, 0
;// mike.dld ]
; Enable timer IRQ (IRQ0) and hard drives IRQs (IRQ14, IRQ15) ; Enable timer IRQ (IRQ0) and hard drives IRQs (IRQ14, IRQ15)
; they are used: when partitions are scanned, hd_read relies on timer ; they are used: when partitions are scanned, hd_read relies on timer
call unmask_timer
stdcall enable_irq, 2 ; @#$%! PIC
stdcall enable_irq, 6 ; FDD stdcall enable_irq, 6 ; FDD
stdcall enable_irq, 13 ; co-processor
stdcall enable_irq, 14 stdcall enable_irq, 14
stdcall enable_irq, 15 stdcall enable_irq, 15
@ -857,16 +826,6 @@ end if
call set_variables call set_variables
; SET MOUSE
stdcall load_driver, szPS2MDriver
; stdcall load_driver, szCOM_MDriver
mov esi,boot_setmouse
call boot_log
call setmouse
; STACK AND FDC ; STACK AND FDC
call stack_init call stack_init
@ -946,6 +905,45 @@ first_app_found:
push 1 push 1
pop dword [CURRENT_TASK] ; set OS task fisrt pop dword [CURRENT_TASK] ; set OS task fisrt
; stdcall enable_irq, 1
; SET KEYBOARD PARAMETERS
mov al, 0xf6 ; reset keyboard, scan enabled
call kb_write
; wait until 8042 is ready
xor ecx,ecx
@@:
in al,64h
and al,00000010b
loopnz @b
; mov al, 0xED ; Keyboard LEDs - only for testing!
; call kb_write
; call kb_read
; mov al, 111b
; call kb_write
; call kb_read
mov al, 0xF3 ; set repeat rate & delay
call kb_write
; call kb_read
mov al, 0 ; 30 250 ;00100010b ; 24 500 ;00100100b ; 20 500
call kb_write
; call kb_read
;// mike.dld [
call set_lights
;// mike.dld ]
stdcall attach_int_handler, 1, irq1, 0
; SET MOUSE
stdcall load_driver, szPS2MDriver
; stdcall load_driver, szCOM_MDriver
mov esi,boot_setmouse
call boot_log
call setmouse
; Setup serial output console (if enabled) ; Setup serial output console (if enabled)
@ -999,9 +997,6 @@ if preboot_blogesc
jne .bll1 jne .bll1
end if end if
cli ;guarantee forbidance of interrupts.
stdcall enable_irq, 2 ; @#$%! PIC
stdcall enable_irq, 13 ; co-processor
cmp [IDEContrRegsBaseAddr], 0 cmp [IDEContrRegsBaseAddr], 0
setnz [dma_hdd] setnz [dma_hdd]
mov [timer_ticks_enable],1 ; for cd driver mov [timer_ticks_enable],1 ; for cd driver
@ -1142,8 +1137,9 @@ endg
set_variables: set_variables:
mov ecx,0x100 ; flush port 0x60 mov ecx,0x16 ; flush port 0x60
.fl60: in al,0x60 .fl60:
in al,0x60
loop .fl60 loop .fl60
push eax push eax