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

View File

@ -13,6 +13,20 @@ Detect_COM_Mouse:
cmp AL,'M' cmp AL,'M'
jne @f jne @f
mov [com1_mouse_detected],1 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 mov esi,boot_setmouse_type+22
call boot_log call boot_log
@@: @@:
@ -21,6 +35,20 @@ Detect_COM_Mouse:
cmp AL,'M' cmp AL,'M'
jne @f jne @f
mov [com2_mouse_detected],1 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 mov esi,boot_setmouse_type+44
call boot_log call boot_log
@@: @@:

View File

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

View File

@ -9,8 +9,8 @@ ThirdByte_1 DB 0
;* НОВЫЙ ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ * ;* НОВЫЙ ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ *
;*************************************** ;***************************************
check_mouse_data_com2: check_mouse_data_com2:
cmp [com2_mouse_detected],0 ; cmp [com2_mouse_detected],0
je @@EndMouseInterrupt_1 ; je @@EndMouseInterrupt_1
; Проверить наличие данных ; Проверить наличие данных
mov DX,2F8h ;[COMPortBaseAddr] mov DX,2F8h ;[COMPortBaseAddr]
add DX,5 ;xFDh 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*13],byte 1 ; math co-pros
mov [irq_owner+4*14],byte 1 ; ide I mov [irq_owner+4*14],byte 1 ; ide I
mov [irq_owner+4*15],byte 1 ; ide II mov [irq_owner+4*15],byte 1 ; ide II
movzx eax,byte [0xf604] ; mouse irq ; movzx eax,byte [0xf604] ; mouse irq
dec eax ; dec eax
add eax,mouseirqtable ; add eax,mouseirqtable
movzx eax,byte [eax] ; movzx eax,byte [eax]
shl eax,2 ; shl eax,2
mov [irq_owner+eax],byte 1 ; mov [irq_owner+eax],byte 1
; RESERVE PORTS ; RESERVE PORTS
@ -984,24 +984,24 @@ reserve_irqs_ports:
mov [0x2d0000+edi+0],dword 1 mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x0 mov [0x2d0000+edi+4],dword 0x0
mov [0x2d0000+edi+8],dword 0xff mov [0x2d0000+edi+8],dword 0xff
cmp [0xf604],byte 2 ; com1 mouse -> 0x3f0-0x3ff ; cmp [0xf604],byte 2 ; com1 mouse -> 0x3f0-0x3ff
jne ripl1 ; jne ripl1
inc dword [0x2d0000] ; inc dword [0x2d0000]
mov edi,[0x2d0000] ; mov edi,[0x2d0000]
shl edi,4 ; shl edi,4
mov [0x2d0000+edi+0],dword 1 ; mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x3f0 ; mov [0x2d0000+edi+4],dword 0x3f0
mov [0x2d0000+edi+8],dword 0x3ff ; mov [0x2d0000+edi+8],dword 0x3ff
ripl1: ; ripl1:
cmp [0xf604],byte 3 ; com2 mouse -> 0x2f0-0x2ff ; cmp [0xf604],byte 3 ; com2 mouse -> 0x2f0-0x2ff
jne ripl2 ; jne ripl2
inc dword [0x2d0000] ; inc dword [0x2d0000]
mov edi,[0x2d0000] ; mov edi,[0x2d0000]
shl edi,4 ; shl edi,4
mov [0x2d0000+edi+0],dword 1 ; mov [0x2d0000+edi+0],dword 1
mov [0x2d0000+edi+4],dword 0x2f0 ; mov [0x2d0000+edi+4],dword 0x2f0
mov [0x2d0000+edi+8],dword 0x2ff ; mov [0x2d0000+edi+8],dword 0x2ff
ripl2: ; ripl2:
popad popad
ret ret