diff --git a/kernel/branches/flat_kernel/const.inc b/kernel/branches/flat_kernel/const.inc index cd914c3e20..f7aab4c2a1 100644 --- a/kernel/branches/flat_kernel/const.inc +++ b/kernel/branches/flat_kernel/const.inc @@ -280,7 +280,6 @@ IMG_BACKGROUND equ (OS_BASE+0x0300000) WinMapAddress equ (OS_BASE+0x0460000) display_data equ (OS_BASE+0x0460000) -;unused ? HD_CACHE equ (OS_BASE+0x0600000) stack_data_start equ (OS_BASE+0x0700000) @@ -387,10 +386,11 @@ struc THR_DATA rb (8192-512) .pl0_stack: .fpu_state rb 512 + .tls_page rb 4096 .pdbr rb 4096 } -THR_DATA_SIZE equ 4096*3 +THR_DATA_SIZE equ 4096*4 virtual at (OS_BASE-THR_DATA_SIZE) thr_data THR_DATA diff --git a/kernel/branches/flat_kernel/core/dll.inc b/kernel/branches/flat_kernel/core/dll.inc index c12724c7a1..632669e595 100644 --- a/kernel/branches/flat_kernel/core/dll.inc +++ b/kernel/branches/flat_kernel/core/dll.inc @@ -246,9 +246,8 @@ endp align 4 srv_handlerEx: - test ebx, ebx - jz .fail - ; add ebx, new_app_base + cmp ebx, OS_BASE + jae .fail mov eax, [ebx+handle] cmp [eax+SRV.magic], ' SRV' @@ -257,9 +256,6 @@ srv_handlerEx: cmp [eax+SRV.size], SRV_SIZE jne .fail - ; add [ebx+input], new_app_base - ; add [ebx+output], new_app_base - stdcall [eax+SRV.srv_proc], ebx ret .fail: @@ -437,8 +433,6 @@ proc read_file stdcall,file_name:dword, buffer:dword, off:dword,\ mov ecx, [off] mov edx, [bytes] mov esi, [buffer] - ; sub ebx, new_app_base - ; sub esi, new_app_base mov [cmd], eax mov [offset], ecx @@ -448,10 +442,12 @@ proc read_file stdcall,file_name:dword, buffer:dword, off:dword,\ mov byte [buff+4], al mov [name], ebx - mov eax, 70 - lea ebx, [cmd] - ; sub ebx, new_app_base - int 0x40 + pushad + push eax + lea eax, [cmd] + call file_system_lfn + pop eax + popad ret endp diff --git a/kernel/branches/flat_kernel/core/memory.inc b/kernel/branches/flat_kernel/core/memory.inc index 698179436f..90b2165c3d 100644 --- a/kernel/branches/flat_kernel/core/memory.inc +++ b/kernel/branches/flat_kernel/core/memory.inc @@ -593,31 +593,6 @@ align 4 mov bl, 14 jmp exc_c iretd - -;.kernel_space: -; shr ebx, 12 -; mov eax, [page_tabs+ebx*4] -; shr ebx, 10 -; mov eax, [master_tab+ebx*4] - jmp .exit -;.old_addr: -; shr ebx, 12 -; mov eax, [page_tabs+ebx*4] -; shr ebx, 10 -; mov eax, [master_tab+ebx*4] - jmp .exit -;.lfb_addr: -; shr ebx, 22 -; ;mov ecx, [sys_page_dir] -; mov eax, [master_tab+ebx*4] - jmp .exit -;.tab_space: -; shr ebx, 12 -; mov eax, [page_tabs+ebx*4] -; shr ebx, 10 -; ;mov ecx, [sys_page_dir] -; mov eax, [master_tab+ebx*4] -; jmp .exit endp align 4 diff --git a/kernel/branches/flat_kernel/core/sched.inc b/kernel/branches/flat_kernel/core/sched.inc index 0a74e08069..c529466d73 100644 --- a/kernel/branches/flat_kernel/core/sched.inc +++ b/kernel/branches/flat_kernel/core/sched.inc @@ -214,16 +214,6 @@ do_change_task: ret -; -; shl ebx, 3 -; xor eax, eax -; add ebx, tss0 -; mov [far_jump.sel], bx ; selector -; mov [far_jump.offs], eax ; offset -; jmp pword [far_jump] -; inc [context_counter] ;noname & halyavin -;ret - align 4 updatecputimes: @@ -244,6 +234,23 @@ updatecputimes: if 0 + +struc TIMER +{ + .next dd ? + .exp_time dd ? + .func 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) diff --git a/kernel/branches/flat_kernel/core/sys32.inc b/kernel/branches/flat_kernel/core/sys32.inc index cbb6868272..5dae855baa 100644 --- a/kernel/branches/flat_kernel/core/sys32.inc +++ b/kernel/branches/flat_kernel/core/sys32.inc @@ -652,6 +652,17 @@ term9: mov edi, [.slot] shl edi,8 add edi,SLOT_BASE + + 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_0-OS_BASE+PG_MAP) + je @F + call free_page +@@: mov eax, 0x20202020 stosd stosd diff --git a/kernel/branches/flat_kernel/core/taskman.inc b/kernel/branches/flat_kernel/core/taskman.inc index 7c96409a8e..080ff6897e 100644 --- a/kernel/branches/flat_kernel/core/taskman.inc +++ b/kernel/branches/flat_kernel/core/taskman.inc @@ -959,19 +959,17 @@ proc set_app_params stdcall,slot:dword, params:dword,\ cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] ja @f - ; add edx, new_app_base stdcall k_strncpy, edx, [cmd_line], 256 @@: mov edx,[params] mov edx, [edx+4] ;app_path test edx,edx jz @F ;application don't need path of file - mov eax, edx - add eax, 1024 - jc @f - cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] - ja @f - ; add edx, new_app_base + mov eax, edx + add eax, 1024 + jc @f + cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] + ja @f stdcall k_strncpy, edx, [app_path], 1024 @@: mov ebx,[slot] diff --git a/kernel/branches/flat_kernel/fs/fs_lfn.inc b/kernel/branches/flat_kernel/fs/fs_lfn.inc index 302e5fd9f0..4729208b4c 100644 --- a/kernel/branches/flat_kernel/fs/fs_lfn.inc +++ b/kernel/branches/flat_kernel/fs/fs_lfn.inc @@ -427,7 +427,7 @@ fs_OnHd: mov [hdpos], eax cmp ecx, 0x100 jae .nf - cmp cl, [DRIVE_DATA+eax] + cmp cl, [DRIVE_DATA+1+eax] jbe @f .nf: call free_hd_channel diff --git a/kernel/branches/flat_kernel/init.inc b/kernel/branches/flat_kernel/init.inc index b00a90dcc6..f6ab9654d3 100644 --- a/kernel/branches/flat_kernel/init.inc +++ b/kernel/branches/flat_kernel/init.inc @@ -120,8 +120,6 @@ proc init_mem ret endp - - align 4 proc init_page_map