forked from KolibriOS/kolibrios
refractoring of EVENT, and so on
git-svn-id: svn://kolibrios.org@1055 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
361dc65fd3
commit
3be0aa5c21
@ -95,11 +95,11 @@ CAPS_SVM equ 73 ;secure virual machine
|
||||
CAPS_ALTMOVCR8 equ 74 ;
|
||||
|
||||
; CPU MSR names
|
||||
MSR_SYSENTER_CS equ 0x174
|
||||
MSR_SYSENTER_ESP equ 0x175
|
||||
MSR_SYSENTER_EIP equ 0x176
|
||||
MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register
|
||||
MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register
|
||||
MSR_SYSENTER_CS equ 0x174
|
||||
MSR_SYSENTER_ESP equ 0x175
|
||||
MSR_SYSENTER_EIP equ 0x176
|
||||
MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register
|
||||
MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register
|
||||
|
||||
CR0_PE equ 0x00000001 ;protected mode
|
||||
CR0_MP equ 0x00000002 ;monitor fpu
|
||||
@ -468,9 +468,10 @@ struc EVENT
|
||||
.id dd ? ;event uid
|
||||
.state dd ? ;internal flags
|
||||
.code dd ?
|
||||
rd 5
|
||||
rd 6
|
||||
.size = $ - .magic
|
||||
.codesize = $ - .code
|
||||
}
|
||||
EVENT_SIZE equ 52
|
||||
|
||||
virtual at 0
|
||||
EVENT EVENT
|
||||
@ -687,4 +688,3 @@ end virtual
|
||||
virtual at 0
|
||||
CSYM COFF_SYM
|
||||
end virtual
|
||||
|
||||
|
@ -9,57 +9,57 @@ $Revision$
|
||||
|
||||
|
||||
iglobal
|
||||
szKernel db 'KERNEL', 0
|
||||
szVersion db 'version',0
|
||||
szKernel db 'KERNEL', 0
|
||||
szVersion db 'version',0
|
||||
|
||||
szRegService db 'RegService',0
|
||||
szGetService db 'GetService',0
|
||||
szRegService db 'RegService',0
|
||||
szGetService db 'GetService',0
|
||||
szServiceHandler db 'ServiceHandler',0
|
||||
szAttachIntHandler db 'AttachIntHandler',0
|
||||
szGetIntHandler db 'GetIntHandler', 0
|
||||
szFpuSave db 'FpuSave',0
|
||||
szFpuRestore db 'FpuRestore',0
|
||||
szFpuSave db 'FpuSave',0
|
||||
szFpuRestore db 'FpuRestore',0
|
||||
szReservePortArea db 'ReservePortArea',0
|
||||
szBoot_Log db 'Boot_Log',0
|
||||
szBoot_Log db 'Boot_Log',0
|
||||
|
||||
szPciApi db 'PciApi', 0
|
||||
szPciRead32 db 'PciRead32', 0
|
||||
szPciRead16 db 'PciRead16', 0
|
||||
szPciRead8 db 'PciRead8', 0
|
||||
szPciWrite8 db 'PciWrite8',0
|
||||
szPciWrite16 db 'PciWrite16',0
|
||||
szPciWrite32 db 'PciWrite32',0
|
||||
szPciApi db 'PciApi', 0
|
||||
szPciRead32 db 'PciRead32', 0
|
||||
szPciRead16 db 'PciRead16', 0
|
||||
szPciRead8 db 'PciRead8', 0
|
||||
szPciWrite8 db 'PciWrite8',0
|
||||
szPciWrite16 db 'PciWrite16',0
|
||||
szPciWrite32 db 'PciWrite32',0
|
||||
|
||||
szAllocPage db 'AllocPage',0
|
||||
szAllocPages db 'AllocPages',0
|
||||
szFreePage db 'FreePage',0
|
||||
szGetPgAddr db 'GetPgAddr',0
|
||||
szMapPage db 'MapPage',0
|
||||
szMapSpace db 'MapSpace',0
|
||||
szMapIoMem db 'MapIoMem',0
|
||||
szAllocPage db 'AllocPage',0
|
||||
szAllocPages db 'AllocPages',0
|
||||
szFreePage db 'FreePage',0
|
||||
szGetPgAddr db 'GetPgAddr',0
|
||||
szMapPage db 'MapPage',0
|
||||
szMapSpace db 'MapSpace',0
|
||||
szMapIoMem db 'MapIoMem',0
|
||||
szCommitPages db 'CommitPages',0
|
||||
szReleasePages db 'ReleasePages',0
|
||||
|
||||
szAllocKernelSpace db 'AllocKernelSpace',0
|
||||
szFreeKernelSpace db 'FreeKernelSpace',0
|
||||
szKernelAlloc db 'KernelAlloc',0
|
||||
szKernelFree db 'KernelFree',0
|
||||
szUserAlloc db 'UserAlloc',0
|
||||
szUserFree db 'UserFree',0
|
||||
szKmalloc db 'Kmalloc',0
|
||||
szKfree db 'Kfree',0
|
||||
szKernelFree db 'KernelFree',0
|
||||
szUserAlloc db 'UserAlloc',0
|
||||
szUserFree db 'UserFree',0
|
||||
szKmalloc db 'Kmalloc',0
|
||||
szKfree db 'Kfree',0
|
||||
szCreateRingBuffer db 'CreateRingBuffer',0
|
||||
|
||||
szGetPid db 'GetPid',0
|
||||
szGetPid db 'GetPid',0
|
||||
szCreateObject db 'CreateObject',0
|
||||
szDestroyObject db 'DestroyObject',0
|
||||
szCreateEvent db 'CreateEvent',0
|
||||
szRaiseEvent db 'RaiseEvent',0
|
||||
szWaitEvent db 'WaitEvent',0
|
||||
szRaiseEvent db 'RaiseEvent',0
|
||||
szWaitEvent db 'WaitEvent',0
|
||||
szDestroyEvent db 'DestroyEvent',0
|
||||
szClearEvent db 'ClearEvent',0
|
||||
szClearEvent db 'ClearEvent',0
|
||||
|
||||
szLoadCursor db 'LoadCursor',0
|
||||
szLoadCursor db 'LoadCursor',0
|
||||
szSelectHwCursor db 'SelectHwCursor',0
|
||||
szSetHwCursor db 'SetHwCursor',0
|
||||
szHwCursorRestore db 'HwCursorRestore', 0
|
||||
@ -68,19 +68,19 @@ iglobal
|
||||
szSysMsgBoardStr db 'SysMsgBoardStr', 0
|
||||
szSysMsgBoardChar db 'SysMsgBoardChar', 0
|
||||
szGetCurrentTask db 'GetCurrentTask',0
|
||||
szLFBAddress db 'LFBAddress',0
|
||||
szLoadFile db 'LoadFile',0
|
||||
szSendEvent db 'SendEvent',0
|
||||
szLFBAddress db 'LFBAddress',0
|
||||
szLoadFile db 'LoadFile',0
|
||||
szSendEvent db 'SendEvent',0
|
||||
szSetMouseData db 'SetMouseData',0
|
||||
szSleep db 'Sleep',0
|
||||
szGetTimerTicks db 'GetTimerTicks',0
|
||||
|
||||
szStrncat db 'strncat',0
|
||||
szStrncpy db 'strncpy',0
|
||||
szstrncmp db 'strncmp',0
|
||||
szStrnlen db 'strnlen',0
|
||||
szStrchr db 'strchr',0
|
||||
szStrrchr db 'strrchr',0
|
||||
szStrncat db 'strncat',0
|
||||
szStrncpy db 'strncpy',0
|
||||
szstrncmp db 'strncmp',0
|
||||
szStrnlen db 'strnlen',0
|
||||
szStrchr db 'strchr',0
|
||||
szStrrchr db 'strrchr',0
|
||||
|
||||
|
||||
align 16
|
||||
@ -90,12 +90,12 @@ kernel_export:
|
||||
dd szServiceHandler , srv_handler
|
||||
dd szAttachIntHandler, attach_int_handler
|
||||
dd szGetIntHandler , get_int_handler
|
||||
dd szFpuSave , fpu_save
|
||||
dd szFpuSave , fpu_save
|
||||
dd szFpuRestore , fpu_restore
|
||||
dd szReservePortArea , r_f_port_area
|
||||
dd szBoot_Log , boot_log
|
||||
|
||||
dd szPciApi , pci_api
|
||||
dd szPciApi , pci_api
|
||||
dd szPciRead32 , pci_read32
|
||||
dd szPciRead16 , pci_read16
|
||||
dd szPciRead8 , pci_read8
|
||||
@ -126,11 +126,11 @@ kernel_export:
|
||||
dd szGetPid , get_pid
|
||||
dd szCreateObject , create_kernel_object
|
||||
dd szDestroyObject , destroy_kernel_object
|
||||
dd szCreateEvent , create_event
|
||||
dd szRaiseEvent , raise_event
|
||||
dd szWaitEvent , wait_event
|
||||
dd szDestroyEvent , destroy_event
|
||||
dd szClearEvent , clear_event
|
||||
dd szCreateEvent , create_event ;see EVENT.inc for specification
|
||||
dd szRaiseEvent , raise_event ;see EVENT.inc for specification
|
||||
dd szWaitEvent , wait_event ;see EVENT.inc for specification
|
||||
dd szDestroyEvent , destroy_event ;see EVENT.inc for specification
|
||||
dd szClearEvent , clear_event ;see EVENT.inc for specification
|
||||
|
||||
dd szLoadCursor , load_cursor ;stdcall
|
||||
|
||||
@ -143,21 +143,20 @@ kernel_export:
|
||||
dd szSysMsgBoardChar , sys_msg_board
|
||||
dd szGetCurrentTask , get_curr_task
|
||||
dd szLoadFile , load_file ;retval eax, ebx
|
||||
dd szSendEvent , send_event
|
||||
dd szSendEvent , send_event ;see EVENT.inc for specification
|
||||
dd szSetMouseData , set_mouse_data ;stdcall
|
||||
dd szSleep , delay_ms
|
||||
dd szSleep , delay_ms
|
||||
dd szGetTimerTicks , get_timer_ticks
|
||||
|
||||
dd szStrncat , strncat
|
||||
dd szStrncpy , strncpy
|
||||
dd szstrncmp , strncmp
|
||||
dd szStrnlen , strnlen
|
||||
dd szStrchr , strchr
|
||||
dd szStrrchr , strrchr
|
||||
dd szStrncat , strncat
|
||||
dd szStrncpy , strncpy
|
||||
dd szstrncmp , strncmp
|
||||
dd szStrnlen , strnlen
|
||||
dd szStrchr , strchr
|
||||
dd szStrrchr , strrchr
|
||||
|
||||
exp_lfb:
|
||||
dd szLFBAddress , 0
|
||||
dd 0 ;terminator, must be zero
|
||||
dd 0 ;terminator, must be zero
|
||||
|
||||
endg
|
||||
|
||||
|
@ -1051,7 +1051,8 @@ f68:
|
||||
.14:
|
||||
cmp ebx, OS_BASE
|
||||
jae .fail
|
||||
stdcall get_event_ex, ebx, ecx
|
||||
mov edi,ebx
|
||||
call get_event_ex
|
||||
mov [esp+36], eax
|
||||
ret
|
||||
.15:
|
||||
|
@ -15,321 +15,229 @@ $Revision$
|
||||
|
||||
align 32
|
||||
irq0:
|
||||
pushad
|
||||
mov ax, app_data ;
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
; cmp dword[CURRENT_TASK], 1
|
||||
; jnz @f
|
||||
; mov eax, [esp + 32]
|
||||
; cmp eax, idle_loop + 1
|
||||
; jz @f
|
||||
; DEBUGF 1, "K : OOOPS! EAX = 0x%x\n", eax
|
||||
; @@:
|
||||
|
||||
inc dword [timer_ticks]
|
||||
|
||||
mov eax, [timer_ticks]
|
||||
call playNote ; <<<--- Speaker driver
|
||||
|
||||
cmp eax,[next_usage_update]
|
||||
jb .nocounter
|
||||
add eax,100
|
||||
mov [next_usage_update],eax
|
||||
call updatecputimes
|
||||
.nocounter:
|
||||
cmp [DONT_SWITCH], byte 1
|
||||
jne .change_task
|
||||
|
||||
mov al,0x20 ; send End Of Interrupt signal
|
||||
mov dx,0x20
|
||||
out dx,al
|
||||
|
||||
mov [DONT_SWITCH], byte 0
|
||||
|
||||
popad
|
||||
iretd
|
||||
|
||||
.change_task:
|
||||
call update_counters
|
||||
|
||||
call find_next_task
|
||||
mov ecx, eax
|
||||
|
||||
mov al,0x20 ; send End Of Interrupt signal
|
||||
mov dx,0x20
|
||||
out dx,al
|
||||
|
||||
test ecx, ecx ; if there is only one running process
|
||||
jnz .return
|
||||
|
||||
call do_change_task
|
||||
|
||||
.return:
|
||||
popad
|
||||
; popfd
|
||||
iretd
|
||||
|
||||
pushad
|
||||
Mov ds, ax, app_data
|
||||
mov es, ax
|
||||
inc [timer_ticks]
|
||||
mov eax, [timer_ticks]
|
||||
call playNote ; <<<--- Speaker driver
|
||||
sub eax,[next_usage_update]
|
||||
cmp eax,100
|
||||
jb .nocounter
|
||||
add [next_usage_update],100
|
||||
call updatecputimes
|
||||
.nocounter:
|
||||
mov al,0x20 ; send End Of Interrupt signal
|
||||
out 0x20,al
|
||||
btr dword[DONT_SWITCH], 0
|
||||
jc .return
|
||||
call find_next_task
|
||||
jz .return ; if there is only one running process
|
||||
call do_change_task
|
||||
.return:
|
||||
popad
|
||||
iretd
|
||||
|
||||
align 4
|
||||
change_task:
|
||||
|
||||
pushfd
|
||||
cli
|
||||
pushad
|
||||
|
||||
call update_counters
|
||||
|
||||
pushfd
|
||||
cli
|
||||
pushad
|
||||
if 0
|
||||
|
||||
; \begin{Mario79}
|
||||
cmp [dma_task_switched], 1
|
||||
jne .find_next_task
|
||||
mov [dma_task_switched], 0
|
||||
mov ebx, [dma_process]
|
||||
cmp [CURRENT_TASK], ebx
|
||||
je .return
|
||||
mov edi, [dma_slot_ptr]
|
||||
mov [CURRENT_TASK], ebx
|
||||
mov [TASK_BASE], edi
|
||||
jmp @f
|
||||
; \begin{Mario79} ; <- must be refractoried, if used...
|
||||
cmp [dma_task_switched], 1
|
||||
jne .find_next_task
|
||||
mov [dma_task_switched], 0
|
||||
mov ebx, [dma_process]
|
||||
cmp [CURRENT_TASK], ebx
|
||||
je .return
|
||||
mov edi, [dma_slot_ptr]
|
||||
mov [CURRENT_TASK], ebx
|
||||
mov [TASK_BASE], edi
|
||||
jmp @f
|
||||
.find_next_task:
|
||||
; \end{Mario79}
|
||||
|
||||
end if
|
||||
|
||||
call find_next_task
|
||||
test eax, eax ; the same task -> skip switch
|
||||
jnz .return
|
||||
@@:
|
||||
mov [DONT_SWITCH],byte 1
|
||||
call do_change_task
|
||||
|
||||
.return:
|
||||
popad
|
||||
popfd
|
||||
ret
|
||||
|
||||
call find_next_task
|
||||
jz .return ; the same task -> skip switch
|
||||
@@: mov byte[DONT_SWITCH], 1
|
||||
call do_change_task
|
||||
.return:
|
||||
popad
|
||||
popfd
|
||||
ret
|
||||
|
||||
uglobal
|
||||
align 4
|
||||
far_jump:
|
||||
.offs dd ?
|
||||
.sel dw ?
|
||||
context_counter dd ? ;noname & halyavin
|
||||
next_usage_update dd ?
|
||||
timer_ticks dd ?
|
||||
prev_slot dd ?
|
||||
event_sched dd ?
|
||||
align 4
|
||||
; far_jump:
|
||||
; .offs dd ?
|
||||
; .sel dw ?
|
||||
context_counter dd 0 ;noname & halyavin
|
||||
next_usage_update dd 0
|
||||
timer_ticks dd 0
|
||||
; prev_slot dd ?
|
||||
; event_sched dd ?
|
||||
endg
|
||||
|
||||
|
||||
align 4
|
||||
update_counters:
|
||||
mov edi, [TASK_BASE]
|
||||
mov ebx, [edi+TASKDATA.counter_add] ; time stamp counter add
|
||||
rdtsc
|
||||
sub eax, ebx
|
||||
add eax, [edi+TASKDATA.counter_sum] ; counter sum
|
||||
mov [edi+TASKDATA.counter_sum], eax
|
||||
ret
|
||||
|
||||
|
||||
; Find next task to execute
|
||||
; result: ebx = number of the selected task
|
||||
; eax = 1 if the task is the same
|
||||
; edi = address of the data for the task in ebx
|
||||
; [0x3000] = ebx and [0x3010] = edi
|
||||
; corrupts other regs
|
||||
find_next_task:
|
||||
mov ebx, [CURRENT_TASK]
|
||||
mov edi, [TASK_BASE]
|
||||
mov [prev_slot], ebx
|
||||
|
||||
.waiting_for_termination:
|
||||
.waiting_for_reuse:
|
||||
.waiting_for_event:
|
||||
.suspended:
|
||||
cmp ebx, [TASK_COUNT]
|
||||
jb @f
|
||||
mov edi, CURRENT_TASK
|
||||
xor ebx, ebx
|
||||
@@:
|
||||
|
||||
add edi,0x20
|
||||
inc ebx
|
||||
|
||||
mov al, byte [edi+TASKDATA.state]
|
||||
test al, al
|
||||
jz .found
|
||||
cmp al, 1
|
||||
jz .suspended
|
||||
cmp al, 2
|
||||
jz .suspended
|
||||
cmp al, 3
|
||||
je .waiting_for_termination
|
||||
cmp al, 4
|
||||
je .waiting_for_termination
|
||||
cmp al, 9
|
||||
je .waiting_for_reuse
|
||||
|
||||
mov [CURRENT_TASK],ebx
|
||||
mov [TASK_BASE],edi
|
||||
|
||||
cmp al, 5
|
||||
jne .noevents
|
||||
call get_event_for_app
|
||||
test eax, eax
|
||||
jnz @f
|
||||
mov eax, ebx
|
||||
shl eax, 8
|
||||
mov eax, [SLOT_BASE + APPDATA.wait_timeout + eax]
|
||||
cmp eax, [timer_ticks]
|
||||
jae .waiting_for_event
|
||||
xor eax, eax
|
||||
@@:
|
||||
mov [event_sched], eax
|
||||
mov [edi+TASKDATA.state], byte 0
|
||||
.noevents:
|
||||
.found:
|
||||
mov [CURRENT_TASK],ebx
|
||||
mov [TASK_BASE],edi
|
||||
rdtsc ;call _rdtsc
|
||||
mov [edi+TASKDATA.counter_add],eax
|
||||
|
||||
mov esi, [prev_slot]
|
||||
xor eax, eax
|
||||
cmp ebx, esi
|
||||
sete al
|
||||
ret
|
||||
|
||||
; param
|
||||
; ebx = incoming task
|
||||
; esi = outcomig task
|
||||
|
||||
do_change_task:
|
||||
|
||||
shl ebx, 8
|
||||
add ebx, SLOT_BASE
|
||||
mov [current_slot], ebx
|
||||
|
||||
shl esi, 8
|
||||
add esi, SLOT_BASE
|
||||
|
||||
mov [esi+APPDATA.saved_esp], esp
|
||||
mov esp, [ebx+APPDATA.saved_esp]
|
||||
|
||||
; set thread io map
|
||||
|
||||
mov ecx, [ebx+APPDATA.io_map]
|
||||
mov edx, [ebx+APPDATA.io_map+4]
|
||||
mov dword [page_tabs+((tss._io_map_0 and -4096) shr 10)], ecx
|
||||
mov dword [page_tabs+((tss._io_map_1 and -4096) shr 10)], edx
|
||||
|
||||
mov eax, [ebx+APPDATA.dir_table]
|
||||
cmp eax, [esi+APPDATA.dir_table]
|
||||
je @F
|
||||
mov cr3, eax
|
||||
@@:
|
||||
mov eax, [ebx+APPDATA.saved_esp0]
|
||||
mov [tss._esp0], eax
|
||||
mov ax, graph_data
|
||||
mov gs, ax
|
||||
|
||||
mov eax, [CURRENT_TASK]
|
||||
cmp eax, [fpu_owner]
|
||||
clts ;clear a task switch flag
|
||||
je @F
|
||||
;and set it again if the owner
|
||||
mov ecx, cr0 ;of a fpu has changed
|
||||
or ecx, CR0_TS
|
||||
mov cr0, ecx
|
||||
@@:
|
||||
inc [context_counter] ;noname & halyavin
|
||||
test [ebx+APPDATA.dbg_state], 1
|
||||
jnz @F
|
||||
ret
|
||||
@@:
|
||||
mov eax, [ebx+APPDATA.dbg_regs.dr0]
|
||||
mov dr0, eax
|
||||
mov eax, [ebx+APPDATA.dbg_regs.dr1]
|
||||
mov dr1, eax
|
||||
mov eax, [ebx+APPDATA.dbg_regs.dr2]
|
||||
mov dr2, eax
|
||||
mov eax, [ebx+APPDATA.dbg_regs.dr3]
|
||||
mov dr3, eax
|
||||
xor eax, eax
|
||||
mov dr6, eax
|
||||
mov eax, [ebx+APPDATA.dbg_regs.dr7]
|
||||
mov dr7, eax
|
||||
ret
|
||||
|
||||
mov edi, [TASK_BASE]
|
||||
rdtsc
|
||||
sub eax, [edi+TASKDATA.counter_add] ; time stamp counter add
|
||||
add [edi+TASKDATA.counter_sum], eax ; counter sum
|
||||
ret
|
||||
align 4
|
||||
updatecputimes:
|
||||
xor eax,eax
|
||||
xchg eax,[idleuse]
|
||||
mov [idleusesec],eax
|
||||
mov ecx, [TASK_COUNT]
|
||||
mov edi, TASK_DATA
|
||||
.newupdate:
|
||||
xor eax,eax
|
||||
xchg eax,[edi+TASKDATA.counter_sum]
|
||||
mov [edi+TASKDATA.cpu_usage],eax
|
||||
add edi,0x20
|
||||
loop .newupdate
|
||||
ret
|
||||
|
||||
mov eax,[idleuse]
|
||||
mov [idleusesec],eax
|
||||
mov [idleuse],dword 0
|
||||
mov ecx, [TASK_COUNT]
|
||||
mov edi, TASK_DATA
|
||||
.newupdate:
|
||||
mov ebx,[edi+TASKDATA.counter_sum]
|
||||
mov [edi+TASKDATA.cpu_usage],ebx
|
||||
mov [edi+TASKDATA.counter_sum],dword 0
|
||||
add edi,0x20
|
||||
dec ecx
|
||||
jnz .newupdate
|
||||
align 4
|
||||
find_next_task:
|
||||
;info:
|
||||
; Find next task to execute
|
||||
;retval:
|
||||
; ebx = address of the APPDATA for the selected task (slot-base)
|
||||
; esi = previous slot-base ([current_slot] at the begin)
|
||||
; edi = address of the TASKDATA for the selected task
|
||||
; ZF = 1 if the task is the same
|
||||
;warning:
|
||||
; [CURRENT_TASK] = bh , [TASK_BASE] = edi -- as result
|
||||
; [current_slot] is not set to new value (ebx)!!!
|
||||
;scratched: eax,ecx
|
||||
call update_counters ; edi := [TASK_BASE]
|
||||
Mov esi, ebx, [current_slot]
|
||||
.loop:
|
||||
cmp bh,[TASK_COUNT]
|
||||
jb @f
|
||||
xor bh, bh
|
||||
mov edi,CURRENT_TASK
|
||||
@@: inc bh ; ebx += APPDATA.size
|
||||
add edi,0x20 ; edi += TASKDATA.size
|
||||
mov al, [edi+TASKDATA.state]
|
||||
test al, al
|
||||
jz .found ; state == 0
|
||||
cmp al, 5
|
||||
jne .loop ; state == 1,2,3,4,9
|
||||
; state == 5
|
||||
pushad ; more freedom for [APPDATA.wait_test]
|
||||
call [ebx+APPDATA.wait_test]
|
||||
mov [esp+28],eax
|
||||
popad
|
||||
or eax,eax
|
||||
jnz @f
|
||||
; testing for timeout
|
||||
mov ecx, [timer_ticks]
|
||||
sub ecx, [ebx+APPDATA.wait_begin]
|
||||
cmp ecx, [ebx+APPDATA.wait_timeout]
|
||||
jb .loop
|
||||
@@: mov [ebx+APPDATA.wait_param], eax ; retval for wait
|
||||
mov [edi+TASKDATA.state], 0
|
||||
.found:
|
||||
mov [CURRENT_TASK],bh
|
||||
mov [TASK_BASE],edi
|
||||
rdtsc ;call _rdtsc
|
||||
mov [edi+TASKDATA.counter_add],eax ; for next using update_counters
|
||||
cmp ebx, esi ;esi - previous slot-base
|
||||
ret
|
||||
;TODO: Íàäî áû óáðàòü èñïîëüçîâàíèå do_change_task èç V86...
|
||||
; è ïîñëå ýòîãî ïåðåíåñòè îáðàáîòêó TASKDATA.counter_add/sum â do_change_task
|
||||
|
||||
ret
|
||||
align 4
|
||||
do_change_task:
|
||||
;param:
|
||||
; ebx = address of the APPDATA for incoming task (new)
|
||||
;warning:
|
||||
; [CURRENT_TASK] and [TASK_BASE] must be changed before (e.g. in find_next_task)
|
||||
; [current_slot] is the outcoming (old), and set here to a new value (ebx)
|
||||
;scratched: eax,ecx,esi
|
||||
mov esi,ebx
|
||||
xchg esi,[current_slot]
|
||||
; set new stack after saving old
|
||||
mov [esi+APPDATA.saved_esp], esp
|
||||
mov esp, [ebx+APPDATA.saved_esp]
|
||||
; set new thread io-map
|
||||
Mov dword [page_tabs+((tss._io_map_0 and -4096) shr 10)],eax,[ebx+APPDATA.io_map]
|
||||
Mov dword [page_tabs+((tss._io_map_1 and -4096) shr 10)],eax,[ebx+APPDATA.io_map+4]
|
||||
; set new thread memory-map
|
||||
mov ecx, APPDATA.dir_table
|
||||
mov eax, [ebx+ecx] ;offset>0x7F
|
||||
cmp eax, [esi+ecx] ;offset>0x7F
|
||||
je @f
|
||||
mov cr3, eax
|
||||
@@: ; set tss.esp0
|
||||
Mov [tss._esp0],eax,[ebx+APPDATA.saved_esp0]
|
||||
; set gs selector unconditionally
|
||||
Mov gs,ax,graph_data
|
||||
; set CR0.TS
|
||||
cmp bh, byte[fpu_owner] ;bh == incoming task (new)
|
||||
clts ;clear a task switch flag
|
||||
je @f
|
||||
mov eax, cr0 ;and set it again if the owner
|
||||
or eax, CR0_TS ;of a fpu has changed
|
||||
mov cr0, eax
|
||||
@@: ; set context_counter (only for user pleasure ???)
|
||||
inc [context_counter] ;noname & halyavin
|
||||
; set debug-registers, if it's necessary
|
||||
test byte[ebx+APPDATA.dbg_state], 1
|
||||
jz @f
|
||||
xor eax, eax
|
||||
mov dr6, eax
|
||||
lea esi,[ebx+ecx+APPDATA.dbg_regs-APPDATA.dir_table] ;offset>0x7F
|
||||
cld
|
||||
macro lodsReg [reg] {
|
||||
lodsd
|
||||
mov reg,eax
|
||||
} lodsReg dr0, dr1, dr2, dr3, dr7
|
||||
purge lodsReg
|
||||
@@: ret
|
||||
;end.
|
||||
|
||||
if 0
|
||||
|
||||
|
||||
struc TIMER
|
||||
{
|
||||
.next dd ?
|
||||
.exp_time dd ?
|
||||
.func dd ?
|
||||
.arg dd ?
|
||||
.arg dd ?
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MAX_PROIRITY 0 ; highest, used for kernel tasks
|
||||
MAX_USER_PRIORITY 0 ; highest priority for user processes
|
||||
USER_PRIORITY 7 ; default (should correspond to nice 0)
|
||||
MIN_USER_PRIORITY 14 ; minimum priority for user processes
|
||||
IDLE_PRIORITY 15 ; lowest, only IDLE process goes here
|
||||
NR_SCHED_QUEUES 16 ; MUST equal IDLE_PRIORYTY + 1
|
||||
MAX_PROIRITY 0 ; highest, used for kernel tasks
|
||||
MAX_USER_PRIORITY 0 ; highest priority for user processes
|
||||
USER_PRIORITY 7 ; default (should correspond to nice 0)
|
||||
MIN_USER_PRIORITY 14 ; minimum priority for user processes
|
||||
IDLE_PRIORITY 15 ; lowest, only IDLE process goes here
|
||||
NR_SCHED_QUEUES 16 ; MUST equal IDLE_PRIORYTY + 1
|
||||
|
||||
rdy_head rd 16
|
||||
|
||||
|
||||
align 4
|
||||
pick_task:
|
||||
|
||||
xor eax, eax
|
||||
.pick:
|
||||
mov ebx, [rdy_head+eax*4]
|
||||
test ebx, ebx
|
||||
jz .next
|
||||
|
||||
mov [next_task], ebx
|
||||
test [ebx+flags.billable]
|
||||
jz @F
|
||||
mov [bill_task], ebx
|
||||
@@:
|
||||
ret
|
||||
.next:
|
||||
inc eax
|
||||
jmp .pick
|
||||
xor eax, eax
|
||||
.pick:
|
||||
mov ebx, [rdy_head+eax*4]
|
||||
test ebx, ebx
|
||||
jz .next
|
||||
|
||||
mov [next_task], ebx
|
||||
test [ebx+flags.billable]
|
||||
jz @F
|
||||
mov [bill_task], ebx
|
||||
@@:
|
||||
ret
|
||||
.next:
|
||||
inc eax
|
||||
jmp .pick
|
||||
|
||||
; param
|
||||
; eax= task
|
||||
@ -338,51 +246,48 @@ pick_task:
|
||||
; eax= task
|
||||
; ebx= queue
|
||||
; ecx= front if 1 or back if 0
|
||||
|
||||
align 4
|
||||
shed:
|
||||
cmp [eax+.tics_left], 0 ;signed compare
|
||||
mov ebx, [eax+.priority]
|
||||
setg ecx
|
||||
jg @F
|
||||
cmp [eax+.tics_left], 0 ;signed compare
|
||||
mov ebx, [eax+.priority]
|
||||
setg ecx
|
||||
jg @F
|
||||
|
||||
mov edx, [eax+.tics_quantum]
|
||||
mov [eax+.ticks_left], edx
|
||||
cmp ebx, (IDLE_PRIORITY-1)
|
||||
je @F
|
||||
inc ebx
|
||||
@@:
|
||||
ret
|
||||
mov edx, [eax+.tics_quantum]
|
||||
mov [eax+.ticks_left], edx
|
||||
cmp ebx, (IDLE_PRIORITY-1)
|
||||
je @F
|
||||
inc ebx
|
||||
@@:
|
||||
ret
|
||||
|
||||
; param
|
||||
; eax= task
|
||||
|
||||
align 4
|
||||
enqueue:
|
||||
call shed ;eax
|
||||
cmp [rdy_head+ebx*4],0
|
||||
jnz @F
|
||||
call shed ;eax
|
||||
cmp [rdy_head+ebx*4],0
|
||||
jnz @F
|
||||
|
||||
mov [rdy_head+ebx*4], eax
|
||||
mov [rdy_tail+ebx*4], eax
|
||||
mov [eax+.next_ready], 0
|
||||
jmp .pick
|
||||
@@:
|
||||
test ecx, ecx
|
||||
jz .back
|
||||
mov [rdy_head+ebx*4], eax
|
||||
mov [rdy_tail+ebx*4], eax
|
||||
mov [eax+.next_ready], 0
|
||||
jmp .pick
|
||||
@@:
|
||||
test ecx, ecx
|
||||
jz .back
|
||||
|
||||
mov ecx, [rdy_head+ebx*4]
|
||||
mov [eax+.next_ready], ecx
|
||||
mov [rdy_head+ebx*4], eax
|
||||
jmp .pick
|
||||
.back:
|
||||
mov ecx, [rdy_tail+ebx*4]
|
||||
mov [ecx+.next_ready], eax
|
||||
mov [rdy_tail+ebx*4], eax
|
||||
mov [eax+.next_ready], 0
|
||||
.pick:
|
||||
call pick_proc ;select next task
|
||||
ret
|
||||
mov ecx, [rdy_head+ebx*4]
|
||||
mov [eax+.next_ready], ecx
|
||||
mov [rdy_head+ebx*4], eax
|
||||
jmp .pick
|
||||
.back:
|
||||
mov ecx, [rdy_tail+ebx*4]
|
||||
mov [ecx+.next_ready], eax
|
||||
mov [rdy_tail+ebx*4], eax
|
||||
mov [eax+.next_ready], 0
|
||||
.pick:
|
||||
call pick_proc ;select next task
|
||||
ret
|
||||
|
||||
end if
|
||||
|
||||
|
@ -10,33 +10,17 @@ $Revision$
|
||||
; Old style system call converter
|
||||
align 16
|
||||
cross_order:
|
||||
; load all registers in crossed order
|
||||
mov eax, ebx
|
||||
mov ebx, ecx
|
||||
mov ecx, edx
|
||||
mov edx, esi
|
||||
mov esi, edi
|
||||
mov edi, [esp+28 + 4]
|
||||
and edi,0xff
|
||||
call dword [servetable+edi*4]
|
||||
ret
|
||||
; load all registers in crossed order
|
||||
mov eax, ebx
|
||||
mov ebx, ecx
|
||||
mov ecx, edx
|
||||
mov edx, esi
|
||||
mov esi, edi
|
||||
movzx edi, byte[esp+28 + 4]
|
||||
call dword [servetable+edi*4]
|
||||
ret
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SYSTEM CALL ENTRY ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
align 16
|
||||
i40:
|
||||
pushad
|
||||
cld
|
||||
movzx eax, al
|
||||
call dword [servetable2 + eax * 4]
|
||||
popad
|
||||
iretd
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SYSENTER ENTRY ;;
|
||||
@ -45,28 +29,43 @@ i40:
|
||||
|
||||
align 32
|
||||
sysenter_entry:
|
||||
; Íàñòðàèâàåì ñòåê
|
||||
mov esp, [ss:tss._esp0]
|
||||
sti
|
||||
push ebp ; save app esp + 4
|
||||
mov ebp, [ebp] ; ebp - original ebp
|
||||
;------------------
|
||||
pushad
|
||||
cld
|
||||
; Íàñòðàèâàåì ñòåê
|
||||
mov esp, [ss:tss._esp0]
|
||||
sti
|
||||
push ebp ; save app esp + 4
|
||||
mov ebp, [ebp] ; ebp - original ebp
|
||||
;------------------
|
||||
pushad
|
||||
cld
|
||||
|
||||
movzx eax, al
|
||||
call dword [servetable2 + eax * 4]
|
||||
movzx eax, al
|
||||
call dword [servetable2 + eax * 4]
|
||||
|
||||
popad
|
||||
;------------------
|
||||
xchg ecx, [ss:esp] ; â âåðøèí ñòåêà - app ecx, ecx - app esp + 4
|
||||
sub ecx, 4
|
||||
xchg edx, [ecx] ; edx - return point, & save original edx
|
||||
push edx
|
||||
mov edx, [ss:esp + 4]
|
||||
mov [ecx + 4], edx ; save original ecx
|
||||
pop edx
|
||||
sysexit
|
||||
popad
|
||||
;------------------
|
||||
xchg ecx, [ss:esp] ; â âåðøèí ñòåêà - app ecx, ecx - app esp + 4
|
||||
sub ecx, 4
|
||||
xchg edx, [ecx] ; edx - return point, & save original edx
|
||||
push edx
|
||||
mov edx, [ss:esp + 4]
|
||||
mov [ecx + 4], edx ; save original ecx
|
||||
pop edx
|
||||
sysexit
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; SYSTEM CALL ENTRY ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
align 16
|
||||
i40:
|
||||
pushad
|
||||
cld
|
||||
movzx eax, al
|
||||
call dword [servetable2 + eax * 4]
|
||||
popad
|
||||
iretd
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
@ -76,25 +75,26 @@ sysenter_entry:
|
||||
align 32
|
||||
syscall_entry:
|
||||
; cli syscall clear IF
|
||||
xchg esp, [ss:tss._esp0]
|
||||
push ecx
|
||||
lea ecx, [esp+4]
|
||||
xchg ecx, [ss:tss._esp0]
|
||||
sti
|
||||
push ecx
|
||||
mov ecx, [ecx]
|
||||
;------------------
|
||||
pushad
|
||||
cld
|
||||
xchg esp, [ss:tss._esp0]
|
||||
push ecx
|
||||
lea ecx, [esp+4]
|
||||
xchg ecx, [ss:tss._esp0]
|
||||
sti
|
||||
push ecx
|
||||
mov ecx, [ecx]
|
||||
;------------------
|
||||
pushad
|
||||
cld
|
||||
|
||||
movzx eax, al
|
||||
call dword [servetable2 + eax * 4]
|
||||
movzx eax, al
|
||||
call dword [servetable2 + eax * 4]
|
||||
|
||||
popad
|
||||
;------------------
|
||||
mov ecx, [ss:esp+4]
|
||||
pop esp
|
||||
sysret
|
||||
|
||||
popad
|
||||
;------------------
|
||||
mov ecx, [ss:esp+4]
|
||||
pop esp
|
||||
sysret
|
||||
iglobal
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SYSTEM FUNCTIONS TABLE ;;
|
||||
@ -133,7 +133,7 @@ iglobal
|
||||
dd 0
|
||||
dd 0 ;
|
||||
dd 0
|
||||
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
||||
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
@ -153,7 +153,7 @@ iglobal
|
||||
dd display_number ; 47-WriteNum
|
||||
dd display_settings ; 48-SetRedrawType and SetButtonType
|
||||
dd sys_apm ; 49-Advanced Power Management (APM)
|
||||
dd random_shaped_window ; 50-Window shape & scale
|
||||
dd random_shaped_window ; 50-Window shape & scale
|
||||
dd syscall_threads ; 51-Threads
|
||||
dd stack_driver_stat ; 52-Stack driver status
|
||||
dd socket ; 53-Socket interface
|
||||
@ -167,7 +167,7 @@ iglobal
|
||||
dd sys_gs ; 61-Direct graphics access
|
||||
dd sys_pci ; 62-PCI functions
|
||||
dd sys_msg_board ; 63-System message board
|
||||
dd sys_resize_app_memory ; 64-Resize application memory usage
|
||||
dd sys_resize_app_memory ; 64-Resize application memory usage
|
||||
dd syscall_putimage_palette; 65-PutImagePalette
|
||||
dd sys_process_def ; 66-Process definitions - keyboard
|
||||
dd sys_window_move ; 67-Window move or resize
|
||||
@ -175,7 +175,6 @@ iglobal
|
||||
dd sys_debug_services ; 69-Debug
|
||||
dd file_system_lfn ; 70-Common file system interface, version 2
|
||||
dd syscall_windowsettings ; 71-Window settings
|
||||
dd sys_sendwindowmsg ; 72-Send window message
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; NEW SYSTEM FUNCTIONS TABLE ;;
|
||||
@ -197,9 +196,9 @@ iglobal
|
||||
dd sys_getevent ; 11-CheckForEvent
|
||||
dd sys_redrawstat ; 12-BeginDraw and EndDraw
|
||||
dd syscall_drawrect ; 13-DrawRect
|
||||
dd syscall_getscreensize ; 14-GetScreenSize
|
||||
dd syscall_getscreensize ; 14-GetScreenSize
|
||||
dd sys_background ; 15-bgr
|
||||
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
||||
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
||||
dd sys_getbutton ; 17-GetButton
|
||||
dd sys_system ; 18-System Services
|
||||
dd paleholder ; 19-reserved
|
||||
@ -224,7 +223,7 @@ iglobal
|
||||
dd syscall_drawline ; 38-DrawLine
|
||||
dd cross_order ; 39-GetBackgroundSize,ReadBgrData,.
|
||||
dd set_app_param ; 40-WantEvents
|
||||
dd syscall_getirqowner ; 41-GetIrqOwner
|
||||
dd syscall_getirqowner ; 41-GetIrqOwner
|
||||
dd get_irq_data ; 42-ReadIrqData
|
||||
dd cross_order ; 43-SendDeviceData
|
||||
dd sys_programirq ; 44-ProgramIrqs
|
||||
@ -255,8 +254,8 @@ iglobal
|
||||
dd cross_order ; 69-Debug
|
||||
dd cross_order ; 70-Common file system interface, version 2
|
||||
dd cross_order ; 71-Window settings
|
||||
dd cross_order ; 72-Send window message
|
||||
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
||||
dd sys_end ; -1-end application
|
||||
dd sys_sendwindowmsg ; 72-Send window message
|
||||
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
||||
dd sys_end ; -1-end application
|
||||
|
||||
endg
|
||||
|
@ -945,12 +945,12 @@ v86_irq2:
|
||||
mov cx, [eax*4+2]
|
||||
mov word [esi-v86_regs.size+v86_regs.cs], cx
|
||||
and byte [esi-v86_regs.size+v86_regs.eflags+1], not 3
|
||||
push ebx
|
||||
; push ebx
|
||||
call update_counters
|
||||
pop ebx
|
||||
sub ebx, SLOT_BASE
|
||||
shr ebx, 8
|
||||
mov esi, [CURRENT_TASK]
|
||||
; pop ebx
|
||||
; sub ebx, SLOT_BASE
|
||||
; shr ebx, 8
|
||||
; mov esi, [CURRENT_TASK]
|
||||
call do_change_task
|
||||
popad
|
||||
iretd
|
||||
|
@ -48,28 +48,28 @@ keymap_alt:
|
||||
|
||||
|
||||
|
||||
boot_memdetect db 'Determining amount of memory',0
|
||||
boot_fonts db 'Fonts loaded',0
|
||||
boot_tss db 'Setting TSSs',0
|
||||
boot_cpuid db 'Reading CPUIDs',0
|
||||
boot_devices db 'Detecting devices',0
|
||||
boot_timer db 'Setting timer',0
|
||||
boot_irqs db 'Reprogramming IRQs',0
|
||||
boot_setmouse db 'Setting mouse',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
boot_resirqports db 'Reserving IRQs & ports',0
|
||||
boot_setrports db 'Setting addresses for IRQs',0
|
||||
boot_setostask db 'Setting OS task',0
|
||||
boot_allirqs db 'Unmasking all IRQs',0
|
||||
boot_tsc db 'Reading TSC',0
|
||||
boot_memdetect db 'Determining amount of memory',0
|
||||
boot_fonts db 'Fonts loaded',0
|
||||
boot_tss db 'Setting TSSs',0
|
||||
boot_cpuid db 'Reading CPUIDs',0
|
||||
boot_devices db 'Detecting devices',0
|
||||
boot_timer db 'Setting timer',0
|
||||
boot_irqs db 'Reprogramming IRQs',0
|
||||
boot_setmouse db 'Setting mouse',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
boot_resirqports db 'Reserving IRQs & ports',0
|
||||
boot_setrports db 'Setting addresses for IRQs',0
|
||||
boot_setostask db 'Setting OS task',0
|
||||
boot_allirqs db 'Unmasking all IRQs',0
|
||||
boot_tsc db 'Reading TSC',0
|
||||
boot_cpufreq db 'CPU frequency is ',' ',' MHz',0
|
||||
boot_pal_ega db 'Setting EGA/CGA 320x200 palette',0
|
||||
boot_pal_vga db 'Setting VGA 640x480 palette',0
|
||||
boot_failed db 'Failed to start first app',0
|
||||
boot_mtrr db 'Setting MTRR',0
|
||||
boot_pal_ega db 'Setting EGA/CGA 320x200 palette',0
|
||||
boot_pal_vga db 'Setting VGA 640x480 palette',0
|
||||
boot_failed db 'Failed to start first app',0
|
||||
boot_mtrr db 'Setting MTRR',0
|
||||
if preboot_blogesc
|
||||
boot_tasking db 'All set - press ESC to start',0
|
||||
boot_tasking db 'All set - press ESC to start',0
|
||||
end if
|
||||
|
||||
;new_process_loading db 'K : New Process - loading',13,10,0
|
||||
@ -80,7 +80,7 @@ msg_unresolved db 'unresolved ',0
|
||||
msg_module db 'in module ',0
|
||||
msg_version db 'incompatible driver version',13,10,0
|
||||
msg_www db 'please visit www.kolibrios.org',13,10,0
|
||||
msg_CR db 13,10,0
|
||||
msg_CR db 13,10,0
|
||||
aSis db 'SIS',0
|
||||
|
||||
intel_str db "GenuineIntel",0
|
||||
@ -88,11 +88,11 @@ AMD_str db "AuthenticAMD",0
|
||||
|
||||
;szSound db 'SOUND',0
|
||||
;szInfinity db 'INFINITY',0
|
||||
szHwMouse db 'ATI2D',0
|
||||
szPS2MDriver db 'PS2MOUSE',0
|
||||
szCOM_MDriver db 'COM_MOUSE',0
|
||||
szUSB db 'USB',0
|
||||
szAtiHW db '/rd/1/drivers/ati2d.drv',0
|
||||
szHwMouse db 'ATI2D',0
|
||||
szPS2MDriver db 'PS2MOUSE',0
|
||||
szCOM_MDriver db 'COM_MOUSE',0
|
||||
szUSB db 'USB',0
|
||||
szAtiHW db '/rd/1/drivers/ati2d.drv',0
|
||||
|
||||
szSTART db 'START',0
|
||||
szEXPORTS db 'EXPORTS',0
|
||||
@ -103,13 +103,13 @@ szIMPORTS db 'IMPORTS',0
|
||||
read_firstapp db '/sys/'
|
||||
firstapp db 'LAUNCHER',0
|
||||
|
||||
char db '/sys/FONTS/CHAR.MT',0
|
||||
char2 db '/sys/FONTS/CHAR2.MT',0
|
||||
char db '/sys/FONTS/CHAR.MT',0
|
||||
char2 db '/sys/FONTS/CHAR2.MT',0
|
||||
|
||||
bootpath db '/KOLIBRI '
|
||||
bootpath2 db 0
|
||||
vmode db '/sys/drivers/VMODE.MDR',0
|
||||
vrr_m db 'VRR_M',0
|
||||
vmode db '/sys/drivers/VMODE.MDR',0
|
||||
vrr_m db 'VRR_M',0
|
||||
kernel_file db 'KERNEL MNT'
|
||||
|
||||
|
||||
@ -145,14 +145,14 @@ mode_320_240_8:
|
||||
; mike.dld {
|
||||
db 0
|
||||
dd servetable-0x10000
|
||||
draw_line dd __sys_draw_line
|
||||
disable_mouse dd __sys_disable_mouse
|
||||
draw_pointer dd __sys_draw_pointer
|
||||
draw_line dd __sys_draw_line
|
||||
disable_mouse dd __sys_disable_mouse
|
||||
draw_pointer dd __sys_draw_pointer
|
||||
;//mike.dld, 2006-08-02 [
|
||||
;drawbar dd __sys_drawbar
|
||||
drawbar dd __sys_drawbar.forced
|
||||
drawbar dd __sys_drawbar.forced
|
||||
;//mike.dld, 2006-08-02 ]
|
||||
putpixel dd __sys_putpixel
|
||||
putpixel dd __sys_putpixel
|
||||
; } mike.dld
|
||||
|
||||
|
||||
@ -160,10 +160,10 @@ align 4
|
||||
keyboard dd 1
|
||||
syslang dd 1
|
||||
|
||||
boot_y dd 10
|
||||
boot_y dd 10
|
||||
|
||||
pci_bios_entry dd 0
|
||||
dw pci_code_sel
|
||||
pci_bios_entry dd 0
|
||||
dw pci_code_sel
|
||||
|
||||
if __DEBUG__ eq 1
|
||||
include_debug_strings
|
||||
@ -174,136 +174,135 @@ IncludeIGlobals
|
||||
align 16
|
||||
gdts:
|
||||
|
||||
dw gdte-$-1
|
||||
dd gdts
|
||||
dw 0
|
||||
dw gdte-$-1
|
||||
dd gdts
|
||||
dw 0
|
||||
|
||||
; Attention! Do not change the order of the first four selectors. They are used in Fast System Call
|
||||
; must be : os_code, os_data, app_code, app_data, ....
|
||||
|
||||
int_code_l:
|
||||
os_code_l:
|
||||
dw 0xffff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11011111b *256 +10011010b
|
||||
db 0x00
|
||||
dw 0xffff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11011111b *256 +10011010b
|
||||
db 0x00
|
||||
|
||||
int_data_l:
|
||||
os_data_l:
|
||||
dw 0xffff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11011111b *256 +10010010b
|
||||
db 0x00
|
||||
dw 0xffff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11011111b *256 +10010010b
|
||||
db 0x00
|
||||
|
||||
app_code_l:
|
||||
dw 0xFFFF
|
||||
dw 0
|
||||
db 0
|
||||
db cpl3
|
||||
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||
dw 0xFFFF
|
||||
dw 0
|
||||
db 0
|
||||
db cpl3
|
||||
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||
|
||||
app_data_l:
|
||||
dw 0xFFFF
|
||||
dw 0
|
||||
db 0
|
||||
db drw3
|
||||
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||
dw 0xFFFF
|
||||
dw 0
|
||||
db 0
|
||||
db drw3
|
||||
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||
|
||||
; ------------- PCI BIOS ------------------
|
||||
|
||||
pci_code_32:
|
||||
dw 0 ;lim 0-15
|
||||
dw 0 ;base 0-15
|
||||
db 0 ;base 16-23
|
||||
db cpl0 ;type
|
||||
db D32 ;lim 16-19+props
|
||||
db 0 ;base 24-31
|
||||
dw 0 ;lim 0-15
|
||||
dw 0 ;base 0-15
|
||||
db 0 ;base 16-23
|
||||
db cpl0 ;type
|
||||
db D32 ;lim 16-19+props
|
||||
db 0 ;base 24-31
|
||||
|
||||
pci_data_32:
|
||||
dw 0 ;lim 0-15
|
||||
dw 0 ;base 0-15
|
||||
db 0 ;base 16-23
|
||||
db dpl0 ;type
|
||||
db D32 ;lim 16-19+props
|
||||
db 0 ;base 24-31
|
||||
dw 0 ;lim 0-15
|
||||
dw 0 ;base 0-15
|
||||
db 0 ;base 16-23
|
||||
db dpl0 ;type
|
||||
db D32 ;lim 16-19+props
|
||||
db 0 ;base 24-31
|
||||
|
||||
; --------------- APM ---------------------
|
||||
apm_code_32:
|
||||
dw 0x0f ; limit 64kb
|
||||
db 0, 0, 0
|
||||
dw 11010000b *256 +10011010b
|
||||
db 0x00
|
||||
dw 0x0f ; limit 64kb
|
||||
db 0, 0, 0
|
||||
dw 11010000b *256 +10011010b
|
||||
db 0x00
|
||||
apm_code_16:
|
||||
dw 0x0f
|
||||
db 0, 0, 0
|
||||
dw 10010000b *256 +10011010b
|
||||
db 0x00
|
||||
dw 0x0f
|
||||
db 0, 0, 0
|
||||
dw 10010000b *256 +10011010b
|
||||
db 0x00
|
||||
apm_data_16:
|
||||
dw 0x0f
|
||||
db 0, 0, 0
|
||||
dw 10010000b *256 +10010010b
|
||||
db 0x00
|
||||
dw 0x0f
|
||||
db 0, 0, 0
|
||||
dw 10010000b *256 +10010010b
|
||||
db 0x00
|
||||
; -----------------------------------------
|
||||
|
||||
graph_data_l:
|
||||
|
||||
dw 0x7ff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11010000b *256 +11110010b
|
||||
db 0x00
|
||||
dw 0x7ff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11010000b *256 +11110010b
|
||||
db 0x00
|
||||
tss0_l:
|
||||
dw TSS_SIZE-1
|
||||
dw tss and 0xFFFF
|
||||
db (tss shr 16) and 0xFF
|
||||
db 10001001b
|
||||
dw (tss shr 16) and 0xFF00
|
||||
dw TSS_SIZE-1
|
||||
dw tss and 0xFFFF
|
||||
db (tss shr 16) and 0xFF
|
||||
db 10001001b
|
||||
dw (tss shr 16) and 0xFF00
|
||||
endofcode:
|
||||
gdte:
|
||||
|
||||
align 16
|
||||
cur_saved_data rb 4096
|
||||
fpu_data: rb 512
|
||||
cur_saved_data rb 4096
|
||||
fpu_data: rb 512
|
||||
|
||||
; device irq owners
|
||||
irq_owner rd 16 ; process id
|
||||
irq_owner rd 16 ; process id
|
||||
|
||||
; on irq read ports
|
||||
|
||||
irq00read rd 16
|
||||
irq01read rd 16
|
||||
irq02read rd 16
|
||||
irq03read rd 16
|
||||
irq04read rd 16
|
||||
irq05read rd 16
|
||||
irq06read rd 16
|
||||
irq07read rd 16
|
||||
irq08read rd 16
|
||||
irq09read rd 16
|
||||
irq10read rd 16
|
||||
irq11read rd 16
|
||||
irq12read rd 16
|
||||
irq13read rd 16
|
||||
irq14read rd 16
|
||||
irq15read rd 16
|
||||
irq00read rd 16
|
||||
irq01read rd 16
|
||||
irq02read rd 16
|
||||
irq03read rd 16
|
||||
irq04read rd 16
|
||||
irq05read rd 16
|
||||
irq06read rd 16
|
||||
irq07read rd 16
|
||||
irq08read rd 16
|
||||
irq09read rd 16
|
||||
irq10read rd 16
|
||||
irq11read rd 16
|
||||
irq12read rd 16
|
||||
irq13read rd 16
|
||||
irq14read rd 16
|
||||
irq15read rd 16
|
||||
|
||||
irq_tab rd 16
|
||||
irq_tab rd 16
|
||||
|
||||
mem_block_map rb 512
|
||||
event_map rb 64
|
||||
mem_block_list rd 64
|
||||
mem_block_map rb 512
|
||||
mem_block_list rd 64
|
||||
large_block_list rd 31
|
||||
mem_block_mask rd 2
|
||||
mem_block_mask rd 2
|
||||
large_block_mask rd 1
|
||||
|
||||
mem_used.fd rd 1
|
||||
mem_used.bk rd 1
|
||||
|
||||
mem_block_arr rd 1
|
||||
mem_block_arr rd 1
|
||||
mem_block_start rd 1
|
||||
mem_block_end rd 1
|
||||
mem_block_end rd 1
|
||||
|
||||
heap_mutex rd 1
|
||||
heap_size rd 1
|
||||
@ -315,143 +314,139 @@ mst MEM_STATE
|
||||
|
||||
page_start rd 1
|
||||
page_end rd 1
|
||||
events rd 1
|
||||
event_start rd 1
|
||||
event_end rd 1
|
||||
event_uid rd 1
|
||||
sys_page_map rd 1
|
||||
os_stack_seg rd 1
|
||||
sys_page_map rd 1
|
||||
os_stack_seg rd 1
|
||||
|
||||
|
||||
srv.fd rd 1
|
||||
srv.bk rd 1
|
||||
srv.fd rd 1
|
||||
srv.bk rd 1
|
||||
|
||||
scr_width rd 1
|
||||
scr_height rd 1
|
||||
scr_width rd 1
|
||||
scr_height rd 1
|
||||
|
||||
create_cursor rd 1
|
||||
create_cursor rd 1
|
||||
select_hw_cursor rd 1
|
||||
set_hw_cursor rd 1
|
||||
hw_restore rd 1
|
||||
set_hw_cursor rd 1
|
||||
hw_restore rd 1
|
||||
|
||||
def_cursor rd 1
|
||||
current_cursor rd 1
|
||||
hw_cursor rd 1
|
||||
cur_def_interl rd 1
|
||||
cur_saved_base rd 1
|
||||
def_cursor rd 1
|
||||
current_cursor rd 1
|
||||
hw_cursor rd 1
|
||||
cur_def_interl rd 1
|
||||
cur_saved_base rd 1
|
||||
cur_saved_interl rd 1
|
||||
cur_saved_w rd 1
|
||||
cur_saved_h rd 1
|
||||
cur_saved_w rd 1
|
||||
cur_saved_h rd 1
|
||||
|
||||
ipc_tmp rd 1
|
||||
ipc_pdir rd 1
|
||||
ipc_ptab rd 1
|
||||
ipc_tmp rd 1
|
||||
ipc_pdir rd 1
|
||||
ipc_ptab rd 1
|
||||
|
||||
proc_mem_map rd 1
|
||||
proc_mem_pdir rd 1
|
||||
proc_mem_tab rd 1
|
||||
proc_mem_map rd 1
|
||||
proc_mem_pdir rd 1
|
||||
proc_mem_tab rd 1
|
||||
|
||||
tmp_task_pdir rd 1
|
||||
tmp_task_ptab rd 1
|
||||
tmp_task_pdir rd 1
|
||||
tmp_task_ptab rd 1
|
||||
|
||||
default_io_map rd 1
|
||||
default_io_map rd 1
|
||||
|
||||
LFBSize rd 1
|
||||
LFBSize rd 1
|
||||
|
||||
stall_mcs rd 1
|
||||
current_slot rd 1
|
||||
stall_mcs rd 1
|
||||
current_slot rd 1
|
||||
|
||||
; status
|
||||
hd1_status rd 1 ; 0 - free : other - pid
|
||||
hd1_status rd 1 ; 0 - free : other - pid
|
||||
application_table_status rd 1 ; 0 - free : other - pid
|
||||
|
||||
; device addresses
|
||||
mididp rd 1
|
||||
midisp rd 1
|
||||
mididp rd 1
|
||||
midisp rd 1
|
||||
|
||||
cdbase rd 1
|
||||
cdid rd 1
|
||||
cdbase rd 1
|
||||
cdid rd 1
|
||||
|
||||
hdbase rd 1 ; for boot 0x1f0
|
||||
hdid rd 1
|
||||
hdpos rd 1 ; for boot 0x1
|
||||
fat32part rd 1 ; for boot 0x1
|
||||
cdpos rd 1
|
||||
hdbase rd 1 ; for boot 0x1f0
|
||||
hdid rd 1
|
||||
hdpos rd 1 ; for boot 0x1
|
||||
fat32part rd 1 ; for boot 0x1
|
||||
cdpos rd 1
|
||||
|
||||
;CPUID information
|
||||
cpu_vendor rd 3
|
||||
cpu_sign rd 1
|
||||
cpu_info rd 1
|
||||
cpu_caps rd 4
|
||||
cpu_vendor rd 3
|
||||
cpu_sign rd 1
|
||||
cpu_info rd 1
|
||||
cpu_caps rd 4
|
||||
|
||||
|
||||
pg_data PG_DATA
|
||||
heap_test rd 1
|
||||
pg_data PG_DATA
|
||||
heap_test rd 1
|
||||
|
||||
buttontype rd 1
|
||||
buttontype rd 1
|
||||
windowtypechanged rd 1
|
||||
|
||||
hd_entries rd 1 ;unused ? 0xfe10
|
||||
hd_entries rd 1 ;unused ? 0xfe10
|
||||
|
||||
;* start code - Mario79
|
||||
|
||||
mouse_active rd 1
|
||||
mouse_pause rd 1
|
||||
mouse_active rd 1
|
||||
mouse_pause rd 1
|
||||
MouseTickCounter rd 1
|
||||
|
||||
;* end code - Mario79
|
||||
|
||||
img_background rd 1
|
||||
mem_BACKGROUND rd 1
|
||||
img_background rd 1
|
||||
mem_BACKGROUND rd 1
|
||||
wraw_bacground_select rb 1
|
||||
|
||||
cache_ide0:
|
||||
cache_ide0_pointer rd 1
|
||||
cache_ide0_size rd 1 ; not use
|
||||
cache_ide0_pointer rd 1
|
||||
cache_ide0_size rd 1 ; not use
|
||||
cache_ide0_data_pointer rd 1
|
||||
cache_ide0_system_data_size rd 1 ; not use
|
||||
cache_ide0_appl_data_size rd 1 ; not use
|
||||
cache_ide0_system_data rd 1
|
||||
cache_ide0_appl_data rd 1
|
||||
cache_ide0_system_data rd 1
|
||||
cache_ide0_appl_data rd 1
|
||||
cache_ide0_system_sad_size rd 1
|
||||
cache_ide0_appl_sad_size rd 1
|
||||
cache_ide0_search_start rd 1
|
||||
cache_ide0_appl_search_start rd 1
|
||||
|
||||
cache_ide1:
|
||||
cache_ide1_pointer rd 1
|
||||
cache_ide1_size rd 1 ; not use
|
||||
cache_ide1_pointer rd 1
|
||||
cache_ide1_size rd 1 ; not use
|
||||
cache_ide1_data_pointer rd 1
|
||||
cache_ide1_system_data_size rd 1 ; not use
|
||||
cache_ide1_appl_data_size rd 1 ; not use
|
||||
cache_ide1_system_data rd 1
|
||||
cache_ide1_appl_data rd 1
|
||||
cache_ide1_system_data rd 1
|
||||
cache_ide1_appl_data rd 1
|
||||
cache_ide1_system_sad_size rd 1
|
||||
cache_ide1_appl_sad_size rd 1
|
||||
cache_ide1_search_start rd 1
|
||||
cache_ide1_appl_search_start rd 1
|
||||
|
||||
cache_ide2:
|
||||
cache_ide2_pointer rd 1
|
||||
cache_ide2_size rd 1 ; not use
|
||||
cache_ide2_pointer rd 1
|
||||
cache_ide2_size rd 1 ; not use
|
||||
cache_ide2_data_pointer rd 1
|
||||
cache_ide2_system_data_size rd 1 ; not use
|
||||
cache_ide2_appl_data_size rd 1 ; not use
|
||||
cache_ide2_system_data rd 1
|
||||
cache_ide2_appl_data rd 1
|
||||
cache_ide2_system_data rd 1
|
||||
cache_ide2_appl_data rd 1
|
||||
cache_ide2_system_sad_size rd 1
|
||||
cache_ide2_appl_sad_size rd 1
|
||||
cache_ide2_search_start rd 1
|
||||
cache_ide2_appl_search_start rd 1
|
||||
|
||||
cache_ide3:
|
||||
cache_ide3_pointer rd 1
|
||||
cache_ide3_size rd 1 ; not use
|
||||
cache_ide3_pointer rd 1
|
||||
cache_ide3_size rd 1 ; not use
|
||||
cache_ide3_data_pointer rd 1
|
||||
cache_ide3_system_data_size rd 1 ; not use
|
||||
cache_ide3_appl_data_size rd 1 ; not use
|
||||
cache_ide3_system_data rd 1
|
||||
cache_ide3_appl_data rd 1
|
||||
cache_ide3_system_data rd 1
|
||||
cache_ide3_appl_data rd 1
|
||||
cache_ide3_system_sad_size rd 1
|
||||
cache_ide3_appl_sad_size rd 1
|
||||
cache_ide3_search_start rd 1
|
||||
@ -463,12 +458,11 @@ cd_appl_data rb 1 ; 0 = system cache, 1 - application cache
|
||||
|
||||
lba_read_enabled rd 1 ; 0 = disabled , 1 = enabled
|
||||
pci_access_enabled rd 1 ; 0 = disabled , 1 = enabled
|
||||
timer_ticks_enable rb 1 ; for cd driver
|
||||
timer_ticks_enable rb 1 ; for cd driver
|
||||
|
||||
NumBiosDisks rd 1
|
||||
BiosDisksData rb 200h
|
||||
BiosDiskCaches rb 80h*(cache_ide1-cache_ide0)
|
||||
NumBiosDisks rd 1
|
||||
BiosDisksData rb 200h
|
||||
BiosDiskCaches rb 80h*(cache_ide1-cache_ide0)
|
||||
BiosDiskPartitions rd 80h
|
||||
|
||||
IncludeUGlobals
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -74,7 +74,7 @@ WSTATE_MAXIMIZED = 00000001b
|
||||
WSTATE_MINIMIZED = 00000010b
|
||||
WSTATE_ROLLEDUP = 00000100b
|
||||
|
||||
WSTATE_REDRAW = 00000001b
|
||||
WSTATE_REDRAW = 00000001b
|
||||
WSTATE_WNDDRAWN = 00000010b
|
||||
|
||||
WSTYLE_HASCAPTION = 00010000b
|
||||
@ -83,13 +83,13 @@ WSTYLE_CLIENTRELATIVE = 00100000b
|
||||
struc TASKDATA
|
||||
{
|
||||
.event_mask dd ?
|
||||
.pid dd ?
|
||||
dw ?
|
||||
.pid dd ?
|
||||
dw ?
|
||||
.state db ?
|
||||
db ?
|
||||
dw ?
|
||||
dw ?
|
||||
.wnd_number db ?
|
||||
db ?
|
||||
db ?
|
||||
.mem_start dd ?
|
||||
.counter_sum dd ?
|
||||
.counter_add dd ?
|
||||
@ -101,14 +101,14 @@ end virtual
|
||||
|
||||
; structures definition
|
||||
struc WDATA {
|
||||
.box BOX
|
||||
.cl_workarea dd ?
|
||||
.cl_titlebar dd ?
|
||||
.cl_frames dd ?
|
||||
.reserved db ?
|
||||
.fl_wstate db ?
|
||||
.fl_wdrawn db ?
|
||||
.fl_redraw db ?
|
||||
.box BOX
|
||||
.cl_workarea dd ?
|
||||
.cl_titlebar dd ?
|
||||
.cl_frames dd ?
|
||||
.reserved db ?
|
||||
.fl_wstate db ?
|
||||
.fl_wdrawn db ?
|
||||
.fl_redraw db ?
|
||||
}
|
||||
virtual at 0
|
||||
WDATA WDATA
|
||||
@ -117,11 +117,11 @@ label WDATA.fl_wstyle byte at 0x13
|
||||
|
||||
struc APPDATA
|
||||
{
|
||||
.app_name db 11 dup(?)
|
||||
db 5 dup(?)
|
||||
.app_name db 11 dup(?)
|
||||
db 5 dup(?)
|
||||
|
||||
.fpu_state dd ? ;+16
|
||||
.ev_count dd ? ;+20
|
||||
.ev_count_ dd ? ;unused ;+20
|
||||
.fpu_handler dd ? ;+24
|
||||
.sse_handler dd ? ;+28
|
||||
.pl0_stack dd ? ;unused ;+32
|
||||
@ -138,22 +138,24 @@ struc APPDATA
|
||||
.cur_dir dd ? ;+80
|
||||
.wait_timeout dd ? ;+84
|
||||
.saved_esp0 dd ? ;+88
|
||||
|
||||
db 36 dup(?) ;+92
|
||||
.wait_begin dd ? ;+92 +++
|
||||
.wait_test dd ? ;+96 +++
|
||||
.wait_param dd ? ;+100 +++
|
||||
db 24 dup(?) ;+104
|
||||
|
||||
.wnd_shape dd ? ;+128
|
||||
.wnd_shape_scale dd ? ;+132
|
||||
dd ? ;+136
|
||||
.mem_size dd ? ;+140
|
||||
.saved_box BOX
|
||||
.ipc_start dd ?
|
||||
.ipc_size dd ?
|
||||
.event_mask dd ?
|
||||
.saved_box BOX
|
||||
.ipc_start dd ?
|
||||
.ipc_size dd ?
|
||||
.event_mask dd ?
|
||||
.debugger_slot dd ?
|
||||
dd ?
|
||||
dd ?
|
||||
.keyboard_mode db ?
|
||||
db 3 dup(?)
|
||||
.dir_table dd ?
|
||||
db 3 dup(?)
|
||||
.dir_table dd ?
|
||||
.dbg_event_mem dd ?
|
||||
.dbg_regs:
|
||||
.dbg_regs.dr0 dd ?
|
||||
@ -161,7 +163,7 @@ struc APPDATA
|
||||
.dbg_regs.dr2 dd ?
|
||||
.dbg_regs.dr3 dd ?
|
||||
.dbg_regs.dr7 dd ?
|
||||
.wnd_caption dd ?
|
||||
.wnd_caption dd ?
|
||||
.wnd_clientbox BOX
|
||||
}
|
||||
virtual at 0
|
||||
|
@ -98,3 +98,9 @@ if ~ f eq
|
||||
end if
|
||||
}
|
||||
; \end{diamond}[29.09.2006]
|
||||
|
||||
macro Mov op1,op2,op3 ; op1 = op2 = op3
|
||||
{
|
||||
mov op2,op3
|
||||
mov op1,op2
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user