diff --git a/kernel/branches/flat_kernel/const.inc b/kernel/branches/flat_kernel/const.inc index f5e8567316..e593dc144b 100644 --- a/kernel/branches/flat_kernel/const.inc +++ b/kernel/branches/flat_kernel/const.inc @@ -321,11 +321,12 @@ sys_pgmap equ (OS_BASE+0x00052000) new_app_base equ 0; -twdw equ (CURRENT_TASK-window_data) +twdw equ 0x3000 ;(CURRENT_TASK-window_data) std_application_base_address equ new_app_base RING0_STACK_SIZE equ (0x2000 - 512) ;512 байт для контекста FPU +if 0 REG_SS equ (RING0_STACK_SIZE-4) REG_APP_ESP equ (RING0_STACK_SIZE-8) REG_EFLAGS equ (RING0_STACK_SIZE-12) @@ -341,6 +342,23 @@ REG_EBP equ (RING0_STACK_SIZE-48) REG_ESI equ (RING0_STACK_SIZE-52) REG_EDI equ (RING0_STACK_SIZE-56) REG_RET equ (RING0_STACK_SIZE-60) ;irq0.return +end if + +REG_SS equ (RING0_STACK_SIZE-4) +REG_APP_ESP equ (RING0_STACK_SIZE-8) +REG_EFLAGS equ (RING0_STACK_SIZE-12) +REG_CS equ (RING0_STACK_SIZE-16) +REG_EIP equ (RING0_STACK_SIZE-20) +REG_EAX equ (RING0_STACK_SIZE-24) +REG_ECX equ (RING0_STACK_SIZE-28) +REG_EDX equ (RING0_STACK_SIZE-32) +REG_EBX equ (RING0_STACK_SIZE-36) +REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20 +REG_EBP equ (RING0_STACK_SIZE-44) +REG_ESI equ (RING0_STACK_SIZE-48) +REG_EDI equ (RING0_STACK_SIZE-52) +REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return + PG_UNMAP equ 0x000 PG_MAP equ 0x001 diff --git a/kernel/branches/flat_kernel/core/heap.inc b/kernel/branches/flat_kernel/core/heap.inc index b1e121757b..a6768041c4 100644 --- a/kernel/branches/flat_kernel/core/heap.inc +++ b/kernel/branches/flat_kernel/core/heap.inc @@ -864,16 +864,15 @@ user_realloc: jnz .nofreeall mov eax, [page_tabs+ecx*4] and eax, not 0xFFF - mov edx, [CURRENT_TASK] - shl edx, 8 - mov ebx, [SLOT_BASE+APPDATA.mem_size+edx] + mov edx, [current_slot] + mov ebx, [APPDATA.mem_size+edx] sub ebx, eax add ebx, 0x1000 or al, FREE_BLOCK mov [page_tabs+ecx*4], eax push esi edi - mov esi, [SLOT_BASE+APPDATA.heap_base+edx] - mov edi, [SLOT_BASE+APPDATA.heap_top+edx] + mov esi, [APPDATA.heap_base+edx] + mov edi, [APPDATA.heap_top+edx] call update_mem_size call user_normalize pop edi esi @@ -886,10 +885,9 @@ user_realloc: shr ebx, 12 sub ebx, edx push ebx ecx edx - mov edx, [CURRENT_TASK] - shl edx, 8 + mov edx, [current_slot] shl ebx, 12 - sub ebx, [SLOT_BASE+APPDATA.mem_size+edx] + sub ebx, [APPDATA.mem_size+edx] neg ebx call update_mem_size pop edx ecx ebx @@ -901,9 +899,8 @@ user_realloc: shl ebx, 12 jz .ret push esi - mov esi, [CURRENT_TASK] - shl esi, 8 - mov esi, [SLOT_BASE+APPDATA.heap_top+esi] + mov esi, [current_slot] + mov esi, [APPDATA.heap_top+esi] shr esi, 12 @@: cmp edx, esi @@ -925,9 +922,8 @@ user_realloc: ret .realloc_add: ; get some additional memory - mov eax, [CURRENT_TASK] - shl eax, 8 - mov eax, [SLOT_BASE+APPDATA.heap_top+eax] + mov eax, [current_slot] + mov eax, [APPDATA.heap_top+eax] shr eax, 12 cmp edx, eax jae .cant_inplace @@ -958,19 +954,17 @@ user_realloc: cld rep stosd pop edi - mov edx, [CURRENT_TASK] - shl edx, 8 + mov edx, [current_slot] shl ebx, 12 - add ebx, [SLOT_BASE+APPDATA.mem_size+edx] + add ebx, [APPDATA.mem_size+edx] call update_mem_size pop eax edx ecx ret .cant_inplace: push esi edi - mov eax, [CURRENT_TASK] - shl eax, 8 - mov esi, [SLOT_BASE+APPDATA.heap_base+eax] - mov edi, [SLOT_BASE+APPDATA.heap_top+eax] + mov eax, [current_slot] + mov esi, [APPDATA.heap_base+eax] + mov edi, [APPDATA.heap_top+eax] shr esi, 12 shr edi, 12 sub ebx, ecx @@ -1009,7 +1003,6 @@ user_realloc: inc esi mov eax, esi shl eax, 12 - sub eax, new_app_base push eax mov eax, [page_tabs+ecx*4] and eax, not 0xFFF @@ -1030,10 +1023,9 @@ user_realloc: dec edx jnz @b push ebx - mov edx, [CURRENT_TASK] - shl edx, 8 + mov edx, [current_slot] shl ebx, 12 - add ebx, [SLOT_BASE+APPDATA.mem_size+edx] + add ebx, [APPDATA.mem_size+edx] call update_mem_size pop ebx @@: diff --git a/kernel/branches/flat_kernel/core/sched.inc b/kernel/branches/flat_kernel/core/sched.inc index f177507532..1fca2c503b 100644 --- a/kernel/branches/flat_kernel/core/sched.inc +++ b/kernel/branches/flat_kernel/core/sched.inc @@ -13,7 +13,7 @@ $Revision: 434 $ align 32 irq0: - pushfd + ; pushfd pushad mov ax, app_data ; mov ds, ax @@ -40,7 +40,7 @@ irq0: mov [DONT_SWITCH], byte 0 popad - popfd + ; popfd iretd .change_task: @@ -60,7 +60,7 @@ irq0: .return: popad - popfd + ; popfd iretd @@ -197,6 +197,7 @@ do_change_task: shl ebx, 8 add ebx, SLOT_BASE mov [current_slot], ebx + shl esi, 8 add esi, SLOT_BASE diff --git a/kernel/branches/flat_kernel/core/taskman.inc b/kernel/branches/flat_kernel/core/taskman.inc index 9e5be67d7a..efd41feb0a 100644 --- a/kernel/branches/flat_kernel/core/taskman.inc +++ b/kernel/branches/flat_kernel/core/taskman.inc @@ -1018,7 +1018,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\ mov [ebx+REG_ECX], eax mov [ebx+REG_EAX], eax - mov [ebx+REG_EFL_2], dword 0x1002 + ; mov [ebx+REG_EFL_2], dword 0x1002 mov eax, [esi+0x08] ;app_eip mov [ebx+REG_EIP], eax ;app_entry diff --git a/kernel/branches/flat_kernel/data32.inc b/kernel/branches/flat_kernel/data32.inc index 8c38913deb..00f0f00c4c 100644 --- a/kernel/branches/flat_kernel/data32.inc +++ b/kernel/branches/flat_kernel/data32.inc @@ -319,6 +319,8 @@ windowtypechanged rd 1 hd_entries rd 1 ;unused ? 0xfe10 ;* start code - Mario79 + +mouse_active rd 1 mouse_pause rd 1 MouseTickCounter rd 1 ps2_mouse_detected rb 1 diff --git a/kernel/branches/flat_kernel/gui/event.inc b/kernel/branches/flat_kernel/gui/event.inc index 57eed828a9..7cfc2661e6 100644 --- a/kernel/branches/flat_kernel/gui/event.inc +++ b/kernel/branches/flat_kernel/gui/event.inc @@ -572,22 +572,22 @@ get_event_for_app: xor eax, eax ret - no_eventoccur3: - +no_eventoccur3: ;mov edi,[TASK_BASE] ; mouse event test [edi+TASKDATA.event_mask],dword 00100000b jz no_mouse_event - mov eax,[current_slot] - test [eax+APPDATA.event_mask],dword 00100000b + + mov eax, [CURRENT_TASK] + shl eax, 8 + test [eax+SLOT_BASE+APPDATA.event_mask],dword 00100000b jz no_mouse_event - and [eax+APPDATA.event_mask],dword 0xffffffff-00100000b + and [eax+SLOT_BASE+APPDATA.event_mask],dword (not 00100000b) popad mov eax,6 ret no_mouse_event: - ;mov edi,[TASK_BASE] ; DESKTOP BACKGROUND REDRAW test [edi+TASKDATA.event_mask],dword 16 jz no_eventoccur5 diff --git a/kernel/branches/flat_kernel/kernel.asm b/kernel/branches/flat_kernel/kernel.asm index 05912e610c..ff3dbdc809 100644 --- a/kernel/branches/flat_kernel/kernel.asm +++ b/kernel/branches/flat_kernel/kernel.asm @@ -501,9 +501,9 @@ high_code: mov [graph_data_l+7],ah - mov [CURRENT_TASK],dword 1 - mov [TASK_COUNT],dword 1 - mov [TASK_BASE],dword TASK_DATA + mov [CURRENT_TASK],dword 1 + mov [TASK_COUNT],dword 1 + mov [TASK_BASE],dword TASK_DATA mov [current_slot], SLOT_BASE+256 ;!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -654,9 +654,10 @@ include 'vmodeld.inc' mov dword [SLOT_BASE+256+APPDATA.bk_obj], ebx ; task list - mov [CURRENT_TASK],dword 1 - mov [TASK_COUNT],dword 1 - mov [current_slot], SLOT_BASE+256 + mov [CURRENT_TASK],dword 1 + mov [TASK_COUNT],dword 1 + mov [current_slot], SLOT_BASE+256 + mov [TASK_BASE],dword TASK_DATA mov [TASK_DATA+TASKDATA.wnd_number], 1 ; on screen number mov [TASK_DATA+TASKDATA.pid], 1 ; process id number mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address @@ -3322,9 +3323,6 @@ checkpixel: pop edx eax ret -uglobal - mouse_active db 0 -endg iglobal cpustring db '/RD/1/CPU',0 endg @@ -3346,19 +3344,19 @@ checkmisc: xor edx,edx ; no flags call fs_RamdiskExecute.flags mov [ctrl_alt_del], 0 - nocpustart: + +nocpustart: cmp [mouse_active], 1 jne mouse_not_active mov [mouse_active], 0 xor edi, edi - mov ecx, [TASK_COUNT] - set_mouse_event: + mov ecx, [TASK_COUNT] +set_mouse_event: add edi, 256 - or [edi+SLOT_BASE+APPDATA.event_mask], dword 00100000b + or [edi+SLOT_BASE+APPDATA.event_mask], dword 100000b loop set_mouse_event - mouse_not_active: - +mouse_not_active: cmp [REDRAW_BACKGROUND],byte 0 ; background update ? jz nobackgr cmp [background_defined], 0