forked from KolibriOS/kolibrios
* A bug with floppy IRQ has been finally fixed (EOI added)
* optimised i40 handler git-svn-id: svn://kolibrios.org@15 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
905bbcc1fa
commit
d927fb6877
@ -280,15 +280,12 @@ show_error_parameters:
|
|||||||
call writehex
|
call writehex
|
||||||
|
|
||||||
mov eax,[0x3000]
|
mov eax,[0x3000]
|
||||||
shl eax,8
|
imul eax,tss_step
|
||||||
cmp [0x80000+eax+0xB0],byte 0
|
cmp [eax+tss_data+l.cs-tss_sceleton], os_code
|
||||||
jz @f
|
jz @f
|
||||||
mov esi,system_error
|
mov esi,system_error
|
||||||
call sys_msg_board_str
|
call sys_msg_board_str
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
mov eax,[0x3000]
|
|
||||||
imul eax,tss_step
|
|
||||||
mov eax,[eax+tss_data+l.eip-tss_sceleton]
|
mov eax,[eax+tss_data+l.eip-tss_sceleton]
|
||||||
|
|
||||||
mov [write_error_to],process_eip+43
|
mov [write_error_to],process_eip+43
|
||||||
@ -338,6 +335,10 @@ p_irq6:
|
|||||||
mov ds, ax
|
mov ds, ax
|
||||||
mov es, ax
|
mov es, ax
|
||||||
call fdc_irq
|
call fdc_irq
|
||||||
|
|
||||||
|
mov al,0x20 ; ready for next irq
|
||||||
|
out 0x20,al
|
||||||
|
|
||||||
pop es ds
|
pop es ds
|
||||||
popad
|
popad
|
||||||
iret
|
iret
|
||||||
|
@ -3,83 +3,44 @@
|
|||||||
;; SYSTEM CALL ENTRY ;;
|
;; SYSTEM CALL ENTRY ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
uglobal
|
|
||||||
pushed_regs rd 1
|
|
||||||
endg
|
|
||||||
|
|
||||||
align 32
|
align 32
|
||||||
i40:
|
i40:
|
||||||
|
push ds es
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
push ds
|
|
||||||
mov ax,word os_data
|
mov ax,word os_data
|
||||||
mov ds,ax
|
mov ds,ax
|
||||||
mov es,ax
|
mov es,ax
|
||||||
mov [pushed_regs],esp
|
|
||||||
add dword [pushed_regs],4
|
|
||||||
cli
|
|
||||||
|
|
||||||
mov eax, [0x3000]
|
|
||||||
mov edi, eax
|
|
||||||
shl edi, 8
|
|
||||||
mov [edi+0x80000+0xB0],eax ; used i40 handler
|
|
||||||
|
|
||||||
; for syscall trace function
|
; for syscall trace function
|
||||||
call save_registers
|
call save_registers
|
||||||
|
|
||||||
mov esi,[pushed_regs]
|
; load all registers in crossed order
|
||||||
|
mov edi,[esp+28] ; eax
|
||||||
; load first 3 registers
|
mov eax,[esp+16] ; ebx
|
||||||
mov eax,[esi+28]
|
mov ebx,[esp+24] ; ecx
|
||||||
mov ebx,[esi+16]
|
mov ecx,[esp+20] ; edx
|
||||||
mov ecx,[esi+24]
|
mov edx,[esp+4] ; esi
|
||||||
|
mov esi,[esp+0] ; edi
|
||||||
; save current registers
|
|
||||||
; stack may be modified by a system function to return some value to caller!
|
|
||||||
pushad
|
|
||||||
|
|
||||||
; load all registers from TSS of the application, in crossed order (why?)
|
|
||||||
mov edi,[esi+28]
|
|
||||||
mov eax,[esi+16]
|
|
||||||
mov ebx,[esi+24]
|
|
||||||
mov ecx,[esi+20]
|
|
||||||
mov edx,[esi+4]
|
|
||||||
mov esi,[esi+0]
|
|
||||||
|
|
||||||
; enable interupts - a task switch or an IRQ _CAN_ interrupt i40 handler
|
; enable interupts - a task switch or an IRQ _CAN_ interrupt i40 handler
|
||||||
sti
|
sti
|
||||||
; eax doesn't need to be saved, but...
|
|
||||||
push eax
|
push eax
|
||||||
and edi,0xff
|
and edi,0xff
|
||||||
call dword [servetable+edi*4]
|
call dword [servetable+edi*4]
|
||||||
pop eax
|
pop eax
|
||||||
cli
|
cli
|
||||||
|
|
||||||
; return saved and probably even changed regs
|
|
||||||
popad
|
|
||||||
|
|
||||||
; modify 3 program's registers (in its TSS)
|
|
||||||
mov [esi+28],eax
|
|
||||||
mov [esi+16],ebx
|
|
||||||
mov [esi+24],ecx
|
|
||||||
|
|
||||||
xor eax, eax
|
|
||||||
mov edi, [0x3000] ; no syscall interrupt in use anymore
|
|
||||||
shl edi, 8
|
|
||||||
mov [edi+0x80000+0xB0],eax
|
|
||||||
|
|
||||||
pop eax
|
|
||||||
mov ds,ax
|
|
||||||
mov es,ax
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
|
pop es ds
|
||||||
iretd
|
iretd
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
save_registers:
|
save_registers:
|
||||||
mov esi, [0x3010]
|
mov esi, [0x3010]
|
||||||
mov eax, [esi+0x4] ; load PID
|
mov eax, [esi+0x4] ; load PID
|
||||||
mov esi, [pushed_regs]
|
lea esi, [esp+4]
|
||||||
inc [save_syscall_count]
|
inc [save_syscall_count]
|
||||||
mov edi,[save_syscall_count]
|
mov edi,[save_syscall_count]
|
||||||
and edi,0xF
|
and edi,0xF
|
||||||
|
@ -832,9 +832,7 @@ osloop:
|
|||||||
call checkidle
|
call checkidle
|
||||||
call check_fdd_motor_status
|
call check_fdd_motor_status
|
||||||
jmp osloop
|
jmp osloop
|
||||||
;temp_pointers:
|
|
||||||
; rd 32
|
|
||||||
; seed dd 0x12345678
|
|
||||||
|
|
||||||
checkidle:
|
checkidle:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user