Fixed bug - COM modem completely does not work.

git-svn-id: svn://kolibrios.org@58 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2006-03-11 18:10:47 +00:00
parent f1f3efb4ba
commit 0e57fd1908
5 changed files with 77 additions and 35 deletions

View File

@ -166,13 +166,13 @@ endg
macro save_ring3_context
{
push ds es
pushad
push ds es
pushad
}
macro restore_ring3_context
{
popad
pop es ds
popad
pop es ds
}
; simply return control to interrupted process
@ -231,16 +231,16 @@ exc_c:
movzx ecx, bl
push ecx
mov ecx, [0x3010]
push dword [ecx+4] ; PID of current process
push dword [ecx+4] ; PID of current process
push 12
pop ecx
push 1 ; 1=exception
push 1 ; 1=exception
call debugger_notify
pop ecx
pop ecx
pop ecx
mov edx, [0x3010]
mov byte [edx+0xA], 1 ; suspended
mov byte [edx+0xA], 1 ; suspended
call change_task
restore_ring3_context
iretd
@ -386,7 +386,14 @@ p_irq3:
mov ax, os_data
mov ds, ax
mov es, ax
cmp [com2_mouse_detected],0
je old_irq3_handler
call check_mouse_data_com2
jmp p_irq3_1
old_irq3_handler:
mov edi,3
call irqhandler
p_irq3_1:
restore_ring3_context
iret
@ -395,7 +402,14 @@ p_irq4:
mov ax, os_data
mov ds, ax
mov es, ax
cmp [com1_mouse_detected],0
je old_irq4_handler
call check_mouse_data_com1
jmp p_irq4_1
old_irq4_handler:
mov edi,4
call irqhandler
p_irq4_1:
restore_ring3_context
iret

View File

@ -13,6 +13,20 @@ Detect_COM_Mouse:
cmp AL,'M'
jne @f
mov [com1_mouse_detected],1
pusha
mov eax,4
shl eax,2
mov [irq_owner+eax],byte 1
inc dword [0x2d0000]
mov edi,[0x2d0000]
shl edi,4
mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x3f0
mov [0x2d0000+edi+8],dword 0x3ff
popa
mov esi,boot_setmouse_type+22
call boot_log
@@:
@ -21,6 +35,20 @@ Detect_COM_Mouse:
cmp AL,'M'
jne @f
mov [com2_mouse_detected],1
pusha
mov eax,3
shl eax,2
mov [irq_owner+eax],byte 1
inc dword [0x2d0000]
mov edi,[0x2d0000]
shl edi,4
mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x2f0
mov [0x2d0000+edi+8],dword 0x2ff
popa
mov esi,boot_setmouse_type+44
call boot_log
@@:

View File

@ -9,8 +9,8 @@ ThirdByte DB 0
;* НОВЫЙ ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ *
;***************************************
check_mouse_data_com1:
cmp [com1_mouse_detected],0
je @@EndMouseInterrupt
; cmp [com1_mouse_detected],0
; je @@EndMouseInterrupt
; Проверить наличие данных
mov DX,3F8h ;[COMPortBaseAddr]
add DX,5 ;xFDh

View File

@ -9,8 +9,8 @@ ThirdByte_1 DB 0
;* НОВЫЙ ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ *
;***************************************
check_mouse_data_com2:
cmp [com2_mouse_detected],0
je @@EndMouseInterrupt_1
; cmp [com2_mouse_detected],0
; je @@EndMouseInterrupt_1
; Проверить наличие данных
mov DX,2F8h ;[COMPortBaseAddr]
add DX,5 ;xFDh

View File

@ -969,12 +969,12 @@ reserve_irqs_ports:
mov [irq_owner+4*13],byte 1 ; math co-pros
mov [irq_owner+4*14],byte 1 ; ide I
mov [irq_owner+4*15],byte 1 ; ide II
movzx eax,byte [0xf604] ; mouse irq
dec eax
add eax,mouseirqtable
movzx eax,byte [eax]
shl eax,2
mov [irq_owner+eax],byte 1
; movzx eax,byte [0xf604] ; mouse irq
; dec eax
; add eax,mouseirqtable
; movzx eax,byte [eax]
; shl eax,2
; mov [irq_owner+eax],byte 1
; RESERVE PORTS
@ -984,24 +984,24 @@ reserve_irqs_ports:
mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x0
mov [0x2d0000+edi+8],dword 0xff
cmp [0xf604],byte 2 ; com1 mouse -> 0x3f0-0x3ff
jne ripl1
inc dword [0x2d0000]
mov edi,[0x2d0000]
shl edi,4
mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x3f0
mov [0x2d0000+edi+8],dword 0x3ff
ripl1:
cmp [0xf604],byte 3 ; com2 mouse -> 0x2f0-0x2ff
jne ripl2
inc dword [0x2d0000]
mov edi,[0x2d0000]
shl edi,4
mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x2f0
mov [0x2d0000+edi+8],dword 0x2ff
ripl2:
; cmp [0xf604],byte 2 ; com1 mouse -> 0x3f0-0x3ff
; jne ripl1
; inc dword [0x2d0000]
; mov edi,[0x2d0000]
; shl edi,4
; mov [0x2d0000+edi+0],dword 1
; mov [0x2d0000+edi+4],dword 0x3f0
; mov [0x2d0000+edi+8],dword 0x3ff
; ripl1:
; cmp [0xf604],byte 3 ; com2 mouse -> 0x2f0-0x2ff
; jne ripl2
; inc dword [0x2d0000]
; mov edi,[0x2d0000]
; shl edi,4
; mov [0x2d0000+edi+0],dword 1
; mov [0x2d0000+edi+4],dword 0x2f0
; mov [0x2d0000+edi+8],dword 0x2ff
; ripl2:
popad
ret