2007-03-21 23:58:33 +01:00
|
|
|
|
$Revision$
|
2007-03-26 14:18:08 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; MenuetOS process management, protected ring3 ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; Distributed under GPL. See file COPYING for details. ;;
|
|
|
|
|
;; Copyright 2003 Ville Turjanmaa ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-05 22:37:28 +01:00
|
|
|
|
align 4
|
2005-10-06 19:56:22 +02:00
|
|
|
|
idtreg:
|
|
|
|
|
dw 8*0x41-1
|
|
|
|
|
dd idts+8
|
|
|
|
|
|
|
|
|
|
build_interrupt_table:
|
|
|
|
|
|
2005-10-13 19:50:36 +02:00
|
|
|
|
mov edi, idts+8
|
|
|
|
|
mov esi, sys_int
|
2005-10-16 15:30:23 +02:00
|
|
|
|
mov ecx, 0x40
|
2005-10-13 19:50:36 +02:00
|
|
|
|
@@:
|
2007-03-28 16:51:04 +02:00
|
|
|
|
lodsd
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov [edi], ax ; lower part of offset
|
|
|
|
|
mov [edi+2], word os_code ; segment selector
|
2007-03-28 16:51:04 +02:00
|
|
|
|
mov ax, word 10001110b shl 8 ; type: interrupt gate
|
|
|
|
|
mov [edi+4], eax
|
2007-04-18 08:37:14 +02:00
|
|
|
|
add edi, 8
|
2007-03-28 16:51:04 +02:00
|
|
|
|
loop @b
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-16 15:30:23 +02:00
|
|
|
|
;mov edi,8*0x40+idts+8
|
2007-03-28 16:51:04 +02:00
|
|
|
|
mov dword [edi], (i40 and 0xFFFF) or (os_code shl 16)
|
|
|
|
|
mov dword [edi+4], (11101111b shl 8) or (i40 and 0xFFFF0000)
|
|
|
|
|
; type: trap gate
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
sys_int:
|
2006-10-06 08:09:41 +02:00
|
|
|
|
dd e0,debug_exc,e2,e3
|
|
|
|
|
dd e4,e5,e6,e7
|
|
|
|
|
dd e8,e9,e10,e11
|
|
|
|
|
dd e12,e13,page_fault_handler,e15
|
|
|
|
|
|
2006-10-07 11:47:03 +02:00
|
|
|
|
dd except_16, e17,e18, except_19
|
|
|
|
|
times 12 dd unknown_interrupt
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-11-27 11:07:51 +01:00
|
|
|
|
dd irq0 , irq_serv.irq_1, p_irq2 , p_irq3 ;irq_serv.irq_3
|
2007-05-02 14:06:10 +02:00
|
|
|
|
dd p_irq4 ,irq_serv.irq_5,p_irq6,irq_serv.irq_7
|
2006-10-06 08:09:41 +02:00
|
|
|
|
dd irq_serv.irq_8, irq_serv.irq_9, irq_serv.irq_10
|
|
|
|
|
dd irq_serv.irq_11,p_irq12,irqD ,p_irq14,p_irq15
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
times 16 dd unknown_interrupt
|
|
|
|
|
|
|
|
|
|
dd i40
|
|
|
|
|
endg
|
|
|
|
|
|
2006-01-25 14:19:21 +01:00
|
|
|
|
macro save_ring3_context
|
|
|
|
|
{
|
2006-03-11 19:10:47 +01:00
|
|
|
|
pushad
|
2006-01-25 14:19:21 +01:00
|
|
|
|
}
|
|
|
|
|
macro restore_ring3_context
|
|
|
|
|
{
|
2006-03-11 19:10:47 +01:00
|
|
|
|
popad
|
2006-01-25 14:19:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-10-16 15:30:23 +02:00
|
|
|
|
; simply return control to interrupted process
|
|
|
|
|
unknown_interrupt:
|
|
|
|
|
iret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2005-11-10 18:59:41 +01:00
|
|
|
|
macro exc_wo_code [num]
|
2005-10-16 15:30:23 +02:00
|
|
|
|
{
|
|
|
|
|
forward
|
|
|
|
|
e#num :
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2005-11-07 11:46:04 +01:00
|
|
|
|
mov bl, num
|
|
|
|
|
jmp exc_c
|
2005-10-16 15:30:23 +02:00
|
|
|
|
}
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2005-11-10 18:59:41 +01:00
|
|
|
|
macro exc_w_code [num]
|
|
|
|
|
{
|
|
|
|
|
forward
|
|
|
|
|
e#num :
|
|
|
|
|
add esp, 4
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2005-11-10 18:59:41 +01:00
|
|
|
|
mov bl, num
|
|
|
|
|
jmp exc_c
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-07 11:47:03 +02:00
|
|
|
|
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 18
|
2005-11-10 18:59:41 +01:00
|
|
|
|
exc_w_code 8, 10, 11, 12, 13, 14, 17
|
|
|
|
|
|
2005-10-16 15:30:23 +02:00
|
|
|
|
exc_c:
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ds, ax ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov es, ax ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-01-25 14:19:21 +01:00
|
|
|
|
; test if debugging
|
|
|
|
|
cli
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov eax, [current_slot]
|
|
|
|
|
mov eax, [eax+APPDATA.debugger_slot]
|
2006-01-25 14:19:21 +01:00
|
|
|
|
test eax, eax
|
|
|
|
|
jnz .debug
|
|
|
|
|
sti
|
|
|
|
|
; not debuggee => say error and terminate
|
2007-04-18 08:37:14 +02:00
|
|
|
|
add esp, 0x20 ;28h
|
2006-10-06 08:09:41 +02:00
|
|
|
|
movzx eax, bl
|
2005-10-16 15:30:23 +02:00
|
|
|
|
mov [error_interrupt], eax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call show_error_parameters
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov edx, [TASK_BASE]
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov [edx + TASKDATA.state], byte 4
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jmp change_task
|
|
|
|
|
|
2006-01-25 14:19:21 +01:00
|
|
|
|
.debug:
|
|
|
|
|
; we are debugged process, notify debugger and suspend ourself
|
|
|
|
|
; eax=debugger PID
|
2006-08-02 16:34:15 +02:00
|
|
|
|
cld
|
2006-01-25 14:19:21 +01:00
|
|
|
|
movzx ecx, bl
|
|
|
|
|
push ecx
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov ecx, [TASK_BASE]
|
2006-08-06 12:29:45 +02:00
|
|
|
|
push dword [ecx+TASKDATA.pid] ; PID of current process
|
2006-01-25 14:19:21 +01:00
|
|
|
|
push 12
|
|
|
|
|
pop ecx
|
2006-03-11 19:10:47 +01:00
|
|
|
|
push 1 ; 1=exception
|
2006-01-25 14:19:21 +01:00
|
|
|
|
call debugger_notify
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ecx
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov edx, [TASK_BASE]
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov byte [edx+TASKDATA.state], 1 ; suspended
|
2006-01-25 14:19:21 +01:00
|
|
|
|
call change_task
|
|
|
|
|
restore_ring3_context
|
|
|
|
|
iretd
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
writehex:
|
|
|
|
|
pusha
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-16 15:30:23 +02:00
|
|
|
|
mov edi, [write_error_to]
|
|
|
|
|
mov esi, 8
|
|
|
|
|
@@:
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
and ecx, 0xf
|
|
|
|
|
|
|
|
|
|
mov cl,[ecx+hexletters]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov [edi],cl
|
2005-10-16 15:30:23 +02:00
|
|
|
|
dec edi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2005-10-16 15:30:23 +02:00
|
|
|
|
shr eax,4
|
2005-10-06 19:56:22 +02:00
|
|
|
|
dec esi
|
2005-10-16 15:30:23 +02:00
|
|
|
|
jnz @b
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
hexletters db '0123456789ABCDEF'
|
|
|
|
|
|
|
|
|
|
error_interrupt dd -1
|
|
|
|
|
|
|
|
|
|
process_error db 'K : Process - forced terminate INT: 00000000',13,10,0
|
|
|
|
|
process_pid db 'K : Process - forced terminate PID: 00000000',13,10,0
|
|
|
|
|
process_eip db 'K : Process - forced terminate EIP: 00000000',13,10,0
|
|
|
|
|
system_error db 'K : Kernel error',13,10,0
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
write_error_to dd 0x0
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
show_error_parameters:
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov [write_error_to],process_pid+43
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov eax,[CURRENT_TASK]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
shl eax, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov eax,[CURRENT_TASK+TASKDATA.pid+eax]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call writehex
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov [write_error_to],process_error+43
|
|
|
|
|
mov eax,[error_interrupt]
|
|
|
|
|
call writehex
|
2005-10-28 18:37:38 +02:00
|
|
|
|
|
|
|
|
|
cmp dword [esp+4+4], os_code ; CS
|
|
|
|
|
jnz @f
|
2005-10-17 17:53:11 +02:00
|
|
|
|
mov esi,system_error
|
|
|
|
|
call sys_msg_board_str
|
|
|
|
|
@@:
|
2005-10-28 18:37:38 +02:00
|
|
|
|
mov eax, [esp+4] ; EIP
|
2005-10-17 17:53:11 +02:00
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov [write_error_to],process_eip+43
|
|
|
|
|
call writehex
|
|
|
|
|
|
|
|
|
|
mov esi,process_error
|
|
|
|
|
call sys_msg_board_str
|
|
|
|
|
|
|
|
|
|
mov esi,process_pid
|
|
|
|
|
call sys_msg_board_str
|
|
|
|
|
|
|
|
|
|
mov esi,process_eip
|
|
|
|
|
call sys_msg_board_str
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-13 19:50:36 +02:00
|
|
|
|
; irq1 -> hid/keyboard.inc
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
2005-10-17 17:53:11 +02:00
|
|
|
|
macro irqh [num]
|
2005-10-16 15:30:23 +02:00
|
|
|
|
{
|
|
|
|
|
forward
|
|
|
|
|
p_irq#num :
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2005-10-16 15:30:23 +02:00
|
|
|
|
mov edi, num
|
|
|
|
|
jmp irq_c
|
|
|
|
|
}
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-09-27 16:58:51 +02:00
|
|
|
|
irqh 2,5,7,8,9,10,11
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-04-18 08:37:14 +02:00
|
|
|
|
irq_c:
|
|
|
|
|
mov ax, app_data ;os_data
|
2005-10-16 15:30:23 +02:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call irqhandler
|
2006-01-25 14:19:21 +01:00
|
|
|
|
restore_ring3_context
|
2005-10-16 15:30:23 +02:00
|
|
|
|
iret
|
2005-10-24 19:14:59 +02:00
|
|
|
|
|
|
|
|
|
p_irq6:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2005-10-24 19:14:59 +02:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
|
|
|
|
call fdc_irq
|
2006-01-06 12:46:26 +01:00
|
|
|
|
call ready_for_next_irq
|
2006-01-25 14:19:21 +01:00
|
|
|
|
restore_ring3_context
|
2006-01-06 12:46:26 +01:00
|
|
|
|
iret
|
2005-10-28 18:16:47 +02:00
|
|
|
|
|
2006-01-06 12:46:26 +01:00
|
|
|
|
p_irq3:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2006-01-06 12:46:26 +01:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
2006-03-11 19:10:47 +01:00
|
|
|
|
cmp [com2_mouse_detected],0
|
|
|
|
|
je old_irq3_handler
|
2007-05-02 14:06:10 +02:00
|
|
|
|
mov esi, com2_mouse
|
|
|
|
|
mov dx, 2F8h ;[COMPortBaseAddr]
|
|
|
|
|
call check_mouse_data_com
|
2006-03-11 19:10:47 +01:00
|
|
|
|
jmp p_irq3_1
|
|
|
|
|
old_irq3_handler:
|
|
|
|
|
mov edi,3
|
|
|
|
|
call irqhandler
|
2006-10-06 08:09:41 +02:00
|
|
|
|
p_irq3_1:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
restore_ring3_context
|
2006-01-06 12:46:26 +01:00
|
|
|
|
iret
|
2005-10-28 18:16:47 +02:00
|
|
|
|
|
2006-01-06 12:46:26 +01:00
|
|
|
|
p_irq4:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2006-01-06 12:46:26 +01:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
2006-03-11 19:10:47 +01:00
|
|
|
|
cmp [com1_mouse_detected],0
|
|
|
|
|
je old_irq4_handler
|
2007-05-02 14:06:10 +02:00
|
|
|
|
mov esi, com1_mouse
|
|
|
|
|
mov dx, 3F8h ;[COMPortBaseAddr]
|
|
|
|
|
call check_mouse_data_com
|
2006-03-11 19:10:47 +01:00
|
|
|
|
jmp p_irq4_1
|
|
|
|
|
old_irq4_handler:
|
|
|
|
|
mov edi,4
|
|
|
|
|
call irqhandler
|
2006-10-06 08:09:41 +02:00
|
|
|
|
p_irq4_1:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
restore_ring3_context
|
2005-10-24 19:14:59 +02:00
|
|
|
|
iret
|
|
|
|
|
|
2006-01-06 12:46:26 +01:00
|
|
|
|
p_irq12:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2006-01-06 12:46:26 +01:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
|
|
|
|
call check_mouse_data_ps2
|
2006-01-25 14:19:21 +01:00
|
|
|
|
restore_ring3_context
|
2006-01-06 12:46:26 +01:00
|
|
|
|
iret
|
|
|
|
|
|
2006-09-27 16:58:51 +02:00
|
|
|
|
p_irq14:
|
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2006-09-27 16:58:51 +02:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
|
|
|
|
call [irq14_func]
|
|
|
|
|
call ready_for_next_irq_1
|
|
|
|
|
restore_ring3_context
|
|
|
|
|
iret
|
|
|
|
|
p_irq15:
|
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2006-09-27 16:58:51 +02:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
|
|
|
|
call [irq15_func]
|
|
|
|
|
call ready_for_next_irq_1
|
|
|
|
|
restore_ring3_context
|
|
|
|
|
iret
|
|
|
|
|
|
2006-01-06 12:46:26 +01:00
|
|
|
|
ready_for_next_irq:
|
|
|
|
|
mov [check_idle_semaphore],5
|
|
|
|
|
mov al, 0x20
|
|
|
|
|
out 0x20, al
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
ready_for_next_irq_1:
|
|
|
|
|
mov [check_idle_semaphore],5
|
|
|
|
|
mov al, 0x20
|
|
|
|
|
out 0xa0,al
|
|
|
|
|
out 0x20, al
|
|
|
|
|
ret
|
|
|
|
|
|
2005-10-13 19:50:36 +02:00
|
|
|
|
irqD:
|
2006-01-25 14:19:21 +01:00
|
|
|
|
save_ring3_context
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov ax, app_data ;os_data
|
2005-10-16 15:30:23 +02:00
|
|
|
|
mov ds, ax
|
|
|
|
|
mov es, ax
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-13 19:50:36 +02:00
|
|
|
|
mov dx,0xf0
|
|
|
|
|
mov al,0
|
|
|
|
|
out dx,al
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2005-10-13 19:50:36 +02:00
|
|
|
|
mov dx,0xa0
|
|
|
|
|
mov al,0x20
|
|
|
|
|
out dx,al
|
|
|
|
|
mov dx,0x20
|
2006-01-25 14:19:21 +01:00
|
|
|
|
out dx,al
|
|
|
|
|
|
|
|
|
|
restore_ring3_context
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2005-10-16 15:30:23 +02:00
|
|
|
|
iret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
irqhandler:
|
|
|
|
|
|
|
|
|
|
push edi
|
|
|
|
|
|
|
|
|
|
mov esi,edi ; 1
|
|
|
|
|
shl esi,6 ; 1
|
|
|
|
|
add esi,irq00read ; 1
|
|
|
|
|
shl edi,12 ; 1
|
2007-03-01 21:32:19 +01:00
|
|
|
|
add edi,IRQ_SAVE
|
2006-05-05 14:40:02 +02:00
|
|
|
|
mov ecx,16
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
mov [check_idle_semaphore],5
|
|
|
|
|
|
|
|
|
|
irqnewread:
|
2006-05-05 14:40:02 +02:00
|
|
|
|
dec ecx
|
|
|
|
|
js irqover
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
mov dx,[esi] ; 2+
|
|
|
|
|
|
|
|
|
|
cmp dx,0 ; 1
|
|
|
|
|
jz irqover
|
|
|
|
|
cmp [esi+3],byte 1 ; 2 ; byte read
|
|
|
|
|
jne noirqbyte ; 4-11
|
|
|
|
|
|
|
|
|
|
in al,dx
|
|
|
|
|
|
|
|
|
|
mov edx,[edi]
|
|
|
|
|
cmp edx,4000
|
|
|
|
|
je irqfull
|
|
|
|
|
mov ebx,edi
|
|
|
|
|
add ebx,0x10
|
|
|
|
|
add ebx,edx
|
|
|
|
|
mov [ebx],al
|
|
|
|
|
inc edx
|
|
|
|
|
mov [edi],edx
|
|
|
|
|
|
|
|
|
|
add esi,4
|
|
|
|
|
jmp irqnewread
|
|
|
|
|
|
|
|
|
|
noirqbyte:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmp [esi+3],byte 2 ; word read
|
|
|
|
|
jne noirqword
|
|
|
|
|
|
|
|
|
|
in ax,dx
|
|
|
|
|
|
|
|
|
|
mov edx,[edi]
|
|
|
|
|
cmp edx,4000
|
|
|
|
|
je irqfull
|
|
|
|
|
mov ebx,edi
|
|
|
|
|
add ebx,0x10
|
|
|
|
|
add ebx,edx
|
|
|
|
|
mov [ebx],ax
|
|
|
|
|
add edx,2
|
|
|
|
|
mov [edi],edx
|
|
|
|
|
add esi,4
|
|
|
|
|
jmp irqnewread
|
|
|
|
|
|
|
|
|
|
noirqword:
|
|
|
|
|
irqfull:
|
|
|
|
|
irqover:
|
|
|
|
|
|
|
|
|
|
mov al,0x20 ; ready for next irq
|
|
|
|
|
out 0x20,al
|
|
|
|
|
|
|
|
|
|
pop ebx
|
|
|
|
|
cmp ebx,7
|
|
|
|
|
jbe noa0
|
|
|
|
|
out 0xa0,al
|
|
|
|
|
noa0:
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_application_table_status:
|
|
|
|
|
push eax
|
|
|
|
|
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov eax,[CURRENT_TASK]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
shl eax, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
add eax,CURRENT_TASK+TASKDATA.pid
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov eax,[eax]
|
|
|
|
|
|
|
|
|
|
mov [application_table_status],eax
|
|
|
|
|
|
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clear_application_table_status:
|
|
|
|
|
push eax
|
|
|
|
|
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov eax,[CURRENT_TASK]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
shl eax, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
add eax,CURRENT_TASK+TASKDATA.pid
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov eax,[eax]
|
|
|
|
|
|
|
|
|
|
cmp eax,[application_table_status]
|
|
|
|
|
jne apptsl1
|
|
|
|
|
mov [application_table_status],0
|
|
|
|
|
apptsl1:
|
|
|
|
|
|
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
sys_resize_app_memory:
|
|
|
|
|
; eax = 1 - resize
|
|
|
|
|
; ebx = new amount of memory
|
|
|
|
|
|
|
|
|
|
cmp eax,1
|
2005-10-12 13:35:35 +02:00
|
|
|
|
jne .no_application_mem_resize
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-10-06 08:09:41 +02:00
|
|
|
|
stdcall new_mem_resize, ebx
|
|
|
|
|
mov [esp+36], eax
|
|
|
|
|
ret
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-10-06 08:09:41 +02:00
|
|
|
|
.no_application_mem_resize:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
sys_threads:
|
|
|
|
|
|
|
|
|
|
; eax=1 create thread
|
|
|
|
|
;
|
|
|
|
|
; ebx=thread start
|
|
|
|
|
; ecx=thread stack value
|
|
|
|
|
;
|
|
|
|
|
; on return : eax = pid
|
|
|
|
|
jmp new_sys_threads
|
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
process_terminating db 'K : Process - terminating',13,10,0
|
|
|
|
|
process_terminated db 'K : Process - done',13,10,0
|
2007-02-08 08:15:14 +01:00
|
|
|
|
msg_obj_destroy db 'K : destroy app object',13,10,0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
endg
|
|
|
|
|
|
2007-02-08 08:15:14 +01:00
|
|
|
|
; param
|
|
|
|
|
; esi= slot
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
terminate: ; terminate application
|
|
|
|
|
|
2007-02-08 08:15:14 +01:00
|
|
|
|
.slot equ esp ;locals
|
2006-10-06 08:09:41 +02:00
|
|
|
|
|
2007-02-08 08:15:14 +01:00
|
|
|
|
push esi ;save .slot
|
2007-02-09 18:48:56 +01:00
|
|
|
|
|
|
|
|
|
shl esi, 8
|
2007-02-28 11:51:05 +01:00
|
|
|
|
cmp [SLOT_BASE+esi+APPDATA.dir_table], 0
|
2007-02-09 18:48:56 +01:00
|
|
|
|
jne @F
|
|
|
|
|
add esp, 4
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
2007-02-08 08:15:14 +01:00
|
|
|
|
mov esi,process_terminating
|
|
|
|
|
call sys_msg_board_str
|
|
|
|
|
@@:
|
|
|
|
|
cli
|
|
|
|
|
cmp [application_table_status],0
|
|
|
|
|
je term9
|
|
|
|
|
sti
|
|
|
|
|
call change_task
|
|
|
|
|
jmp @b
|
|
|
|
|
term9:
|
|
|
|
|
call set_application_table_status
|
|
|
|
|
|
|
|
|
|
mov esi, [.slot]
|
|
|
|
|
shl esi,8
|
2007-02-28 11:51:05 +01:00
|
|
|
|
add esi, SLOT_BASE+APP_OBJ_OFFSET
|
2007-02-08 08:15:14 +01:00
|
|
|
|
@@:
|
|
|
|
|
mov eax, [esi+APPOBJ.fd]
|
2007-02-09 18:48:56 +01:00
|
|
|
|
test eax, eax
|
|
|
|
|
jz @F
|
|
|
|
|
|
2007-02-08 08:15:14 +01:00
|
|
|
|
cmp eax, esi
|
|
|
|
|
je @F
|
|
|
|
|
|
|
|
|
|
push esi
|
|
|
|
|
call [eax+APPOBJ.destroy]
|
|
|
|
|
mov esi, msg_obj_destroy
|
|
|
|
|
call sys_msg_board_str
|
|
|
|
|
pop esi
|
|
|
|
|
jmp @B
|
|
|
|
|
@@:
|
|
|
|
|
mov eax, [.slot]
|
|
|
|
|
shl eax, 8
|
2007-02-28 11:51:05 +01:00
|
|
|
|
mov eax,[SLOT_BASE+eax+APPDATA.dir_table]
|
2007-02-08 08:15:14 +01:00
|
|
|
|
stdcall destroy_app_space, eax
|
|
|
|
|
|
2007-02-17 11:09:23 +01:00
|
|
|
|
mov esi, [.slot]
|
2007-02-08 08:15:14 +01:00
|
|
|
|
cmp [fpu_owner],esi ; if user fpu last -> fpu user = 1
|
2007-02-17 11:09:23 +01:00
|
|
|
|
jne @F
|
2007-02-08 08:15:14 +01:00
|
|
|
|
|
|
|
|
|
mov [fpu_owner],1
|
2007-02-28 11:51:05 +01:00
|
|
|
|
mov eax, [256+SLOT_BASE+APPDATA.fpu_state]
|
2007-02-28 09:52:06 +01:00
|
|
|
|
clts
|
2007-02-08 08:15:14 +01:00
|
|
|
|
bt [cpu_caps], CAPS_SSE
|
|
|
|
|
jnc .no_SSE
|
|
|
|
|
fxrstor [eax]
|
2007-02-17 11:09:23 +01:00
|
|
|
|
jmp @F
|
2006-10-31 21:19:05 +01:00
|
|
|
|
.no_SSE:
|
2007-02-08 08:15:14 +01:00
|
|
|
|
fnclex
|
|
|
|
|
frstor [eax]
|
2007-02-17 11:09:23 +01:00
|
|
|
|
@@:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-03-01 21:32:19 +01:00
|
|
|
|
mov [KEY_COUNT],byte 0 ; empty keyboard buffer
|
|
|
|
|
mov [BTN_COUNT],byte 0 ; empty button buffer
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
|
2006-06-30 14:23:15 +02:00
|
|
|
|
; remove defined hotkeys
|
|
|
|
|
mov eax, hotkey_list
|
|
|
|
|
.loop:
|
|
|
|
|
cmp [eax+8], esi
|
|
|
|
|
jnz .cont
|
|
|
|
|
mov ecx, [eax]
|
|
|
|
|
jecxz @f
|
|
|
|
|
push dword [eax+12]
|
|
|
|
|
pop dword [ecx+12]
|
|
|
|
|
@@:
|
|
|
|
|
mov ecx, [eax+12]
|
|
|
|
|
push dword [eax]
|
|
|
|
|
pop dword [ecx]
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
mov [eax], ecx
|
|
|
|
|
mov [eax+4], ecx
|
|
|
|
|
mov [eax+8], ecx
|
|
|
|
|
mov [eax+12], ecx
|
|
|
|
|
.cont:
|
|
|
|
|
add eax, 16
|
|
|
|
|
cmp eax, hotkey_list+256*16
|
|
|
|
|
jb .loop
|
|
|
|
|
; remove hotkeys in buffer
|
|
|
|
|
mov eax, hotkey_buffer
|
|
|
|
|
.loop2:
|
|
|
|
|
cmp [eax], esi
|
|
|
|
|
jnz .cont2
|
|
|
|
|
and dword [eax+4], 0
|
|
|
|
|
and dword [eax], 0
|
|
|
|
|
.cont2:
|
|
|
|
|
add eax, 8
|
|
|
|
|
cmp eax, hotkey_buffer+120*8
|
|
|
|
|
jb .loop2
|
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov ecx,esi ; remove buttons
|
|
|
|
|
bnewba2:
|
2007-03-01 21:32:19 +01:00
|
|
|
|
mov edi,[BTN_ADDR]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov eax,edi
|
|
|
|
|
cld
|
|
|
|
|
movzx ebx,word [edi]
|
|
|
|
|
inc bx
|
|
|
|
|
bnewba:
|
|
|
|
|
dec bx
|
|
|
|
|
jz bnmba
|
|
|
|
|
add eax,0x10
|
|
|
|
|
cmp cx,[eax]
|
|
|
|
|
jnz bnewba
|
|
|
|
|
pusha
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
inc ecx
|
|
|
|
|
shl ecx,4
|
|
|
|
|
mov ebx,eax
|
|
|
|
|
add eax,0x10
|
|
|
|
|
call memmove
|
|
|
|
|
dec dword [edi]
|
|
|
|
|
popa
|
|
|
|
|
jmp bnewba2
|
|
|
|
|
bnmba:
|
|
|
|
|
|
|
|
|
|
pusha ; save window coordinates for window restoring
|
|
|
|
|
cld
|
|
|
|
|
shl esi,5
|
|
|
|
|
add esi,window_data
|
2006-08-03 21:30:32 +02:00
|
|
|
|
mov eax,[esi+WDATA.box.left]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
mov [dlx],eax
|
2006-08-03 21:30:32 +02:00
|
|
|
|
add eax,[esi+WDATA.box.width]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
mov [dlxe],eax
|
2006-08-03 21:30:32 +02:00
|
|
|
|
mov eax,[esi+WDATA.box.top]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
mov [dly],eax
|
2006-08-03 21:30:32 +02:00
|
|
|
|
add eax,[esi+WDATA.box.height]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
mov [dlye],eax
|
|
|
|
|
|
2005-10-06 19:56:22 +02:00
|
|
|
|
xor eax, eax
|
2006-08-29 14:52:52 +02:00
|
|
|
|
mov [esi+WDATA.box.left],eax
|
|
|
|
|
mov [esi+WDATA.box.width],eax
|
|
|
|
|
mov [esi+WDATA.box.top],eax
|
|
|
|
|
mov [esi+WDATA.box.height],eax
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov [esi+WDATA.cl_workarea],eax
|
|
|
|
|
mov [esi+WDATA.cl_titlebar],eax
|
|
|
|
|
mov [esi+WDATA.cl_frames],eax
|
|
|
|
|
mov dword [esi+WDATA.reserved],eax ; clear all flags: wstate, redraw, wdrawn
|
2006-07-23 16:47:32 +02:00
|
|
|
|
lea edi, [esi-window_data+draw_data]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov ecx,32/4
|
|
|
|
|
rep stosd
|
|
|
|
|
popa
|
|
|
|
|
|
2006-01-25 14:19:21 +01:00
|
|
|
|
; debuggee test
|
|
|
|
|
pushad
|
|
|
|
|
mov edi, esi
|
|
|
|
|
shl edi, 5
|
2007-02-28 11:51:05 +01:00
|
|
|
|
mov eax, [SLOT_BASE+edi*8+APPDATA.debugger_slot]
|
2006-01-25 14:19:21 +01:00
|
|
|
|
test eax, eax
|
|
|
|
|
jz .nodebug
|
|
|
|
|
push 8
|
|
|
|
|
pop ecx
|
2007-02-28 09:52:06 +01:00
|
|
|
|
push dword [CURRENT_TASK+edi+TASKDATA.pid] ; PID
|
2006-01-25 14:19:21 +01:00
|
|
|
|
push 2
|
|
|
|
|
call debugger_notify
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ecx
|
|
|
|
|
.nodebug:
|
|
|
|
|
popad
|
|
|
|
|
|
2007-02-17 11:09:23 +01:00
|
|
|
|
mov ebx, [.slot]
|
|
|
|
|
shl ebx, 8
|
2007-02-28 11:51:05 +01:00
|
|
|
|
mov ebx,[SLOT_BASE+ebx+APPDATA.pl0_stack]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-02-17 11:09:23 +01:00
|
|
|
|
stdcall kernel_free, ebx
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-02-17 11:09:23 +01:00
|
|
|
|
mov edi, [.slot]
|
|
|
|
|
shl edi,8
|
2007-02-28 11:51:05 +01:00
|
|
|
|
add edi,SLOT_BASE
|
2007-04-18 08:37:14 +02:00
|
|
|
|
|
|
|
|
|
mov eax, [edi+APPDATA.io_map]
|
|
|
|
|
cmp eax, (tss._io_map_0-OS_BASE+PG_MAP)
|
|
|
|
|
je @F
|
|
|
|
|
call free_page
|
|
|
|
|
@@:
|
|
|
|
|
mov eax, [edi+APPDATA.io_map+4]
|
|
|
|
|
cmp eax, (tss._io_map_1-OS_BASE+PG_MAP)
|
|
|
|
|
je @F
|
|
|
|
|
call free_page
|
|
|
|
|
@@:
|
2007-02-17 11:09:23 +01:00
|
|
|
|
mov eax, 0x20202020
|
|
|
|
|
stosd
|
|
|
|
|
stosd
|
|
|
|
|
stosd
|
|
|
|
|
mov ecx,244/4
|
|
|
|
|
xor eax, eax
|
|
|
|
|
rep stosd
|
2006-07-23 16:47:32 +02:00
|
|
|
|
|
|
|
|
|
; activate window
|
2007-02-28 11:51:05 +01:00
|
|
|
|
movzx eax, word [WIN_STACK + esi*2]
|
2007-02-28 09:52:06 +01:00
|
|
|
|
cmp eax, [TASK_COUNT]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
jne .dont_activate
|
|
|
|
|
pushad
|
|
|
|
|
.check_next_window:
|
|
|
|
|
dec eax
|
|
|
|
|
cmp eax, 1
|
|
|
|
|
jbe .nothing_to_activate
|
2007-02-28 11:51:05 +01:00
|
|
|
|
lea esi, [WIN_POS+eax*2]
|
2006-07-23 16:47:32 +02:00
|
|
|
|
movzx edi, word [esi] ; edi = process
|
|
|
|
|
shl edi, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
cmp [CURRENT_TASK + edi + TASKDATA.state], byte 9 ; skip dead slots
|
2006-07-23 16:47:32 +02:00
|
|
|
|
je .check_next_window
|
|
|
|
|
add edi, window_data
|
2006-09-19 15:16:31 +02:00
|
|
|
|
; \begin{diamond}[19.09.2006]
|
|
|
|
|
; skip minimized windows
|
2006-10-06 08:09:41 +02:00
|
|
|
|
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
|
|
|
|
|
jnz .check_next_window
|
2006-09-19 15:16:31 +02:00
|
|
|
|
; \end{diamond}
|
2006-07-23 16:47:32 +02:00
|
|
|
|
call waredraw
|
|
|
|
|
.nothing_to_activate:
|
|
|
|
|
popad
|
|
|
|
|
.dont_activate:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2006-06-30 14:23:15 +02:00
|
|
|
|
push esi ; remove hd1 & cd & flp reservation
|
|
|
|
|
shl esi, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov esi, [esi+CURRENT_TASK+TASKDATA.pid]
|
2006-06-30 14:23:15 +02:00
|
|
|
|
cmp [hd1_status], esi
|
|
|
|
|
jnz @f
|
2007-02-05 15:20:36 +01:00
|
|
|
|
call free_hd_channel
|
2006-06-30 14:23:15 +02:00
|
|
|
|
mov [hd1_status], 0
|
|
|
|
|
@@:
|
|
|
|
|
cmp [cd_status], esi
|
|
|
|
|
jnz @f
|
2007-02-05 15:20:36 +01:00
|
|
|
|
call free_cd_channel
|
2006-06-30 14:23:15 +02:00
|
|
|
|
mov [cd_status], 0
|
|
|
|
|
@@:
|
|
|
|
|
cmp [flp_status], esi
|
|
|
|
|
jnz @f
|
|
|
|
|
mov [flp_status], 0
|
|
|
|
|
@@:
|
|
|
|
|
pop esi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
pusha ; remove all irq reservations
|
2006-06-30 14:23:15 +02:00
|
|
|
|
mov eax,esi
|
2006-08-06 12:29:45 +02:00
|
|
|
|
shl eax, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov eax,[eax+CURRENT_TASK+TASKDATA.pid]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov edi,irq_owner
|
|
|
|
|
mov ecx,16
|
|
|
|
|
newirqfree:
|
2006-06-30 14:23:15 +02:00
|
|
|
|
scasd
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jne nofreeirq
|
2006-06-30 14:23:15 +02:00
|
|
|
|
mov [edi-4],dword 0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
nofreeirq:
|
|
|
|
|
loop newirqfree
|
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
pusha ; remove all port reservations
|
|
|
|
|
mov edx,esi
|
2006-08-06 12:29:45 +02:00
|
|
|
|
shl edx, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
add edx,CURRENT_TASK
|
2006-08-06 12:29:45 +02:00
|
|
|
|
mov edx,[edx+TASKDATA.pid]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
rmpr0:
|
|
|
|
|
|
2007-03-01 21:32:19 +01:00
|
|
|
|
mov esi,[RESERVED_PORTS]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
cmp esi,0
|
|
|
|
|
je rmpr9
|
|
|
|
|
|
|
|
|
|
rmpr3:
|
|
|
|
|
|
|
|
|
|
mov edi,esi
|
|
|
|
|
shl edi,4
|
2007-03-01 21:32:19 +01:00
|
|
|
|
add edi,RESERVED_PORTS
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
cmp edx,[edi]
|
|
|
|
|
je rmpr4
|
|
|
|
|
|
|
|
|
|
dec esi
|
|
|
|
|
jnz rmpr3
|
|
|
|
|
|
|
|
|
|
jmp rmpr9
|
|
|
|
|
|
|
|
|
|
rmpr4:
|
|
|
|
|
|
|
|
|
|
mov ecx,256
|
|
|
|
|
sub ecx,esi
|
|
|
|
|
shl ecx,4
|
|
|
|
|
|
|
|
|
|
mov esi,edi
|
|
|
|
|
add esi,16
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
|
2007-03-01 21:32:19 +01:00
|
|
|
|
dec dword [RESERVED_PORTS]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
jmp rmpr0
|
|
|
|
|
|
|
|
|
|
rmpr9:
|
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
mov edi,esi ; do not run this process slot
|
2005-10-13 19:50:36 +02:00
|
|
|
|
shl edi, 5
|
2007-02-28 09:52:06 +01:00
|
|
|
|
mov [edi+CURRENT_TASK + TASKDATA.state],byte 9
|
2006-01-25 14:19:21 +01:00
|
|
|
|
; debugger test - terminate all debuggees
|
|
|
|
|
mov eax, 2
|
2007-02-28 11:51:05 +01:00
|
|
|
|
mov ecx, SLOT_BASE+2*0x100+APPDATA.debugger_slot
|
2006-01-25 14:19:21 +01:00
|
|
|
|
.xd0:
|
2007-02-28 09:52:06 +01:00
|
|
|
|
cmp eax, [TASK_COUNT]
|
2006-01-25 14:19:21 +01:00
|
|
|
|
ja .xd1
|
|
|
|
|
cmp dword [ecx], esi
|
|
|
|
|
jnz @f
|
|
|
|
|
and dword [ecx], 0
|
|
|
|
|
pushad
|
|
|
|
|
xchg eax, ebx
|
|
|
|
|
mov eax, 2
|
|
|
|
|
call sys_system
|
|
|
|
|
popad
|
|
|
|
|
@@:
|
|
|
|
|
inc eax
|
|
|
|
|
add ecx, 0x100
|
|
|
|
|
jmp .xd0
|
|
|
|
|
.xd1:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; call systest
|
|
|
|
|
sti ; .. and life goes on
|
|
|
|
|
|
2006-08-01 16:09:42 +02:00
|
|
|
|
mov eax, [dlx]
|
|
|
|
|
mov ebx, [dly]
|
|
|
|
|
mov ecx, [dlxe]
|
|
|
|
|
mov edx, [dlye]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call calculatescreen
|
|
|
|
|
xor eax, eax
|
|
|
|
|
xor esi, esi
|
|
|
|
|
call redrawscreen
|
|
|
|
|
|
2007-03-01 21:32:19 +01:00
|
|
|
|
mov [MOUSE_BACKGROUND],byte 0 ; no mouse background
|
|
|
|
|
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
mov [application_table_status],0
|
|
|
|
|
mov esi,process_terminated
|
|
|
|
|
call sys_msg_board_str
|
2007-02-17 11:09:23 +01:00
|
|
|
|
add esp, 4
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
2007-02-14 02:16:07 +01:00
|
|
|
|
restore .slot
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
boot_sched_1 db 'Building gdt tss pointer',0
|
2005-10-16 15:30:23 +02:00
|
|
|
|
boot_sched_2 db 'Building IDT table',0
|
2005-10-06 19:56:22 +02:00
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build_scheduler:
|
|
|
|
|
|
2007-04-18 08:37:14 +02:00
|
|
|
|
mov esi,boot_sched_1
|
|
|
|
|
call boot_log
|
|
|
|
|
; call build_process_gdt_tss_pointer
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
2007-04-18 08:37:14 +02:00
|
|
|
|
; mov esi,boot_sched_2
|
|
|
|
|
; call boot_log
|
2005-10-06 19:56:22 +02:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|