/kernel/branches/Kolibri-acpi/core/dll.inc |
---|
437,10 → 437,19 |
jz .cleanup |
mov [file2], eax |
pushfd |
cli |
pushad |
mov ecx, unpack_mutex |
call mutex_lock |
popad |
stdcall unpack, [file], eax |
popfd |
pushad |
mov ecx, unpack_mutex |
call mutex_unlock |
popad |
stdcall kernel_free, [file] |
mov eax, [file2] |
mov ebx, [file_size] |
470,7 → 479,12 |
ret |
endp |
uglobal |
align 4 |
unpack_mutex MUTEX |
endg |
align 4 |
proc get_proc_ex stdcall, proc_name:dword, imports:dword |
.look_up: |
/kernel/branches/Kolibri-acpi/core/exports.inc |
---|
72,6 → 72,9 |
szLoadFile db 'LoadFile',0 |
szSendEvent db 'SendEvent',0 |
szSetMouseData db 'SetMouseData',0 |
szSetKeyboardData db 'SetKeyboardData',0 |
szRegKeyboard db 'RegKeyboard',0 |
szDelKeyboard db 'DelKeyboard',0 |
szSleep db 'Sleep',0 |
szGetTimerTicks db 'GetTimerTicks',0 |
154,6 → 157,9 |
dd szLoadFile , load_file ;retval eax, ebx |
dd szSendEvent , send_event ;see EVENT.inc for specification |
dd szSetMouseData , set_mouse_data ;stdcall |
dd szSetKeyboardData , set_keyboard_data |
dd szRegKeyboard , register_keyboard |
dd szDelKeyboard , delete_keyboard |
dd szSleep , delay_ms |
dd szGetTimerTicks , get_timer_ticks |
/kernel/branches/Kolibri-acpi/core/memory.inc |
---|
442,72 → 442,83 |
align 4 |
proc new_mem_resize stdcall, new_size:dword |
mov ecx, pg_data.mutex |
call mutex_lock |
push ebx |
push esi |
push edi |
mov edx, [current_slot] |
cmp [edx+APPDATA.heap_base], 0 |
jne .exit |
mov edi, [new_size] |
add edi, 4095 |
and edi, not 4095 |
mov [new_size], edi |
mov edx, [current_slot] |
cmp [edx+APPDATA.heap_base], 0 |
jne .exit |
mov esi, [edx+APPDATA.mem_size] |
add esi, 4095 |
and esi, not 4095 |
cmp edi, esi |
jae .expand |
ja .expand |
je .exit |
mov ebx, edi |
shr edi, 12 |
shr esi, 12 |
mov ecx, pg_data.mutex |
call mutex_lock |
@@: |
mov eax, [app_page_tabs+edi*4] |
test eax, 1 |
jz .next |
mov dword [app_page_tabs+edi*4], 2 |
mov ebx, edi |
shl ebx, 12 |
push eax |
mov dword [app_page_tabs+edi*4], 0 |
invlpg [ebx] |
pop eax |
call free_page |
.next: |
add edi, 1 |
inc edi |
add ebx, 0x1000 |
cmp edi, esi |
jb @B |
mov ecx, pg_data.mutex |
call mutex_unlock |
.update_size: |
mov edx, [current_slot] |
mov ebx, [new_size] |
call update_mem_size |
mov ecx, pg_data.mutex |
call mutex_unlock |
.exit: |
pop edi |
pop esi |
pop ebx |
xor eax, eax |
ret |
.expand: |
push esi |
push edi |
mov ecx, pg_data.mutex |
call mutex_lock |
xchg esi, edi |
push esi ;new size |
push edi ;old size |
add edi, 0x3FFFFF |
and edi, not(0x3FFFFF) |
add esi, 0x3FFFFF |
and esi, not(0x3FFFFF) |
cmp esi, edi |
cmp edi, esi |
jae .grow |
xchg esi, edi |
@@: |
call alloc_page |
test eax, eax |
jz .exit_pop |
jz .exit_fail |
stdcall map_page_table, edi, eax |
524,51 → 535,38 |
cmp edi, esi |
jb @B |
.grow: |
;//- |
pop edi |
push edi |
mov esi, [pg_data.pages_free] |
sub esi, 1 |
shr edi, 12 |
cmp esi, edi |
jle .out_of_memory |
;//- |
pop edi |
pop esi |
@@: |
call alloc_page |
test eax, eax |
jz .exit |
stdcall map_page, esi, eax, dword PG_UW |
pop edi ;old size |
pop ecx ;new size |
push edi |
mov edi, esi |
xor eax, eax |
mov ecx, 1024 |
cld |
shr edi, 10 |
shr ecx, 10 |
sub ecx, edi |
shr ecx, 2 ;pages count |
mov eax, 2 |
add edi, app_page_tabs |
rep stosd |
pop edi |
add esi, 0x1000 |
cmp esi, edi |
jb @B |
mov ecx, pg_data.mutex |
call mutex_unlock |
jmp .update_size |
;//- |
.exit_pop: |
.out_of_memory: |
;//- |
pop edi |
pop esi |
.exit: |
.exit_fail: |
mov ecx, pg_data.mutex |
call mutex_unlock |
add esp, 8 |
pop edi |
pop esi |
pop ebx |
xor eax, eax |
inc eax |
ret |
endp |
align 4 |
update_mem_size: |
; in: edx = slot base |
; ebx = new memory size |
1253,7 → 1251,7 |
cmp ecx, OS_BASE |
jae .fail |
cmp ebx, OS_BASE |
cmp edx, OS_BASE |
jae .fail |
mov edi, edx |
1459,7 → 1457,7 |
mov ebx, [size] |
dec ebx |
mov eax, 0xFFFFFFFF |
mov edx, 0x00000000 |
mov edx, 0x0000000F |
sub eax, ebx |
sbb edx, 0 |
or eax, 0x800 |
/kernel/branches/Kolibri-acpi/core/sys32.inc |
---|
425,6 → 425,17 |
add eax, 16 |
cmp eax, hotkey_list+256*16 |
jb .loop |
; get process PID |
mov eax, esi |
shl eax, 5 |
mov eax, [eax+CURRENT_TASK+TASKDATA.pid] |
; compare current lock input with process PID |
cmp eax, [PID_lock_input] |
jne @f |
xor eax, eax |
mov [PID_lock_input], eax |
@@: |
; remove hotkeys in buffer |
mov eax, hotkey_buffer |
.loop2: |
677,24 → 688,22 |
ret |
restore .slot |
iglobal |
if lang eq ru |
boot_sched_1 db '®§¤ ¨¥ GDT TSS 㪠§ ⥫ï',0 |
boot_sched_2 db '®§¤ ¨¥ IDT â ¡«¨æë',0 |
else |
boot_sched_1 db 'Building gdt tss pointer',0 |
boot_sched_2 db 'Building IDT table',0 |
end if |
endg |
;iglobal |
;if lang eq ru |
; boot_sched_1 db '®§¤ ¨¥ GDT TSS 㪠§ ⥫ï',0 |
; boot_sched_2 db '®§¤ ¨¥ IDT â ¡«¨æë',0 |
;else |
; boot_sched_1 db 'Building gdt tss pointer',0 |
; boot_sched_2 db 'Building IDT table',0 |
;end if |
;endg |
build_scheduler: |
mov esi, boot_sched_1 |
call boot_log |
;build_scheduler: |
; mov esi, boot_sched_1 |
; call boot_log |
; call build_process_gdt_tss_pointer |
; mov esi,boot_sched_2 |
; call boot_log |
ret |
; ret |
/kernel/branches/Kolibri-acpi/core/syscall.inc |
---|
145,7 → 145,7 |
dd sys_settime ; 22-setting date,time,clock and alarm-clock |
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent |
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist |
dd undefined_syscall ; 25-reserved |
dd syscall_putarea_backgr ; 25-Put Area to background |
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,. |
dd undefined_syscall ; 27-reserved |
dd undefined_syscall ; 28-reserved |
154,7 → 154,7 |
dd undefined_syscall ; 31-reserved |
dd undefined_syscall ; 32-reserved |
dd undefined_syscall ; 33-reserved |
dd undefined_syscall ; 34-reserved |
dd syscall_getpixel_WinMap ; 34-GetPixel WinMap |
dd syscall_getpixel ; 35-GetPixel |
dd syscall_getarea ; 36-GetArea |
dd readmousepos ; 37-GetMousePosition_ScreenRelative,. |
/kernel/branches/Kolibri-acpi/core/taskman.inc |
---|
72,6 → 72,7 |
slot_base dd ? |
file_base dd ? |
file_size dd ? |
handle dd ? ;temp. for default cursor handle for curr. thread |
;app header data |
hdr_cmdline dd ? ;0x00 |
hdr_path dd ? ;0x04 |
83,6 → 84,15 |
pushad |
cmp [SCR_MODE], word 0x13 |
jbe @f |
pushad |
stdcall set_cursor, [def_cursor_clock] |
mov [handle], eax |
mov [redrawmouse_unconditional], 1 |
call __sys_draw_pointer |
popad |
@@: |
mov [flags], edx |
; [ebp] pointer to filename |
113,8 → 123,9 |
.bigfilename: |
popad |
mov eax, -ERROR_FILE_NOT_FOUND |
ret |
jmp .final |
.namecopied: |
mov [cmdline], ebx |
127,6 → 138,7 |
@@: |
lea eax, [filename] |
stdcall load_file, eax |
mov esi, -ERROR_FILE_NOT_FOUND |
test eax, eax |
jz .err_file |
175,7 → 187,7 |
jnz @F |
lea esi, [filename] |
@@: |
mov ecx, 8; 8 chars for name |
mov ecx, 11 ; 11 chars for name! 8 - is old value! |
mov edi, [slot_base] |
.copy_process_name_loop: |
lodsb |
237,7 → 249,9 |
xor ebx, ebx |
mov [application_table_status], ebx;unlock application_table_status mutex |
mov eax, [process_number];set result |
ret |
jmp .final |
.failed: |
mov eax, [save_cr3] |
call set_cr3 |
248,6 → 262,15 |
xor eax, eax |
mov [application_table_status], eax |
mov eax, esi |
.final: |
cmp [SCR_MODE], word 0x13 |
jbe @f |
pushad |
stdcall set_cursor, [handle] |
mov [redrawmouse_unconditional], 1 |
call __sys_draw_pointer |
popad |
@@: |
ret |
endp |