Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 14 → Rev 15

/kernel/trunk/core/sys32.inc
280,15 → 280,12
call writehex
mov eax,[0x3000]
shl eax,8
cmp [0x80000+eax+0xB0],byte 0
imul eax,tss_step
cmp [eax+tss_data+l.cs-tss_sceleton], os_code
jz @f
mov esi,system_error
call sys_msg_board_str
@@:
mov eax,[0x3000]
imul eax,tss_step
mov eax,[eax+tss_data+l.eip-tss_sceleton]
 
mov [write_error_to],process_eip+43
338,6 → 335,10
mov ds, ax
mov es, ax
call fdc_irq
 
mov al,0x20 ; ready for next irq
out 0x20,al
 
pop es ds
popad
iret
/kernel/trunk/core/syscall.inc
3,52 → 3,29
;; SYSTEM CALL ENTRY ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
uglobal
pushed_regs rd 1
endg
 
align 32
i40:
push ds es
pushad
 
push ds
mov ax,word os_data
mov ds,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
call save_registers
 
mov esi,[pushed_regs]
; load all registers in crossed order
mov edi,[esp+28] ; eax
mov eax,[esp+16] ; ebx
mov ebx,[esp+24] ; ecx
mov ecx,[esp+20] ; edx
mov edx,[esp+4] ; esi
mov esi,[esp+0] ; edi
 
; load first 3 registers
mov eax,[esi+28]
mov ebx,[esi+16]
mov ecx,[esi+24]
 
; 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
sti
; eax doesn't need to be saved, but...
push eax
and edi,0xff
call dword [servetable+edi*4]
55,24 → 32,8
pop eax
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
pop es ds
iretd
 
align 4
79,7 → 40,7
save_registers:
mov esi, [0x3010]
mov eax, [esi+0x4] ; load PID
mov esi, [pushed_regs]
lea esi, [esp+4]
inc [save_syscall_count]
mov edi,[save_syscall_count]
and edi,0xF
/kernel/trunk/kernel.asm
832,10 → 832,8
call checkidle
call check_fdd_motor_status
jmp osloop
;temp_pointers:
; rd 32
; seed dd 0x12345678
 
 
checkidle:
 
pushad