Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 9 → Rev 8

/kernel/trunk/core/sched.inc
40,7 → 40,6
 
mov ebx,[0x3000]
 
xor esi,esi ;esi - should we change task?
cmp [0xffff], byte 1
je .do_not_change_task
 
68,7 → 67,7
 
jmp @f
.do_not_change_task:
inc esi ;set don't change task flag
mov [noct], 1
@@:
 
call _rdtsc
90,14 → 89,14
mov dx,0x20
out dx,al
 
test esi,esi ; skip jmp to TSS if we aren't going to switch tasks
jnz @f
cmp [noct], 1
je @f
.switch:
inc [context_counter] ;noname & halyavin
jmp pword [0xB000]
 
inc [context_counter] ;noname & halyavin
@@:
mov [noct], 0
pop es ds
popad
iret
106,6 → 105,7
 
uglobal
context_counter dd 0 ;noname & halyavin
noct db 0
endg
 
 
/kernel/trunk/core/sys32.inc
144,7 → 144,7
mov [edi + 0], word (i40 and ((1 shl 16)-1))
mov [edi + 2], word os_code
mov [edi + 4], word 11101110b*256
mov [edi + 6], word (i40 shr 16)
mov [edi + 6], word (i40 shr 16)
 
ret
 
232,6 → 232,9
endg
 
 
 
 
 
writehex:
pusha
360,6 → 363,10
 
 
 
uglobal
irqh dd 0x0
endg
 
irqhandler:
 
push edi
592,6 → 599,11
mov esi,process_terminating
call sys_msg_board_str
pop esi
;start memory manager code
; mov eax,esi
; call MEM_Heap_Clean
;end memory manager code
 
cli
cmp [application_table_status],0
/kernel/trunk/core/newproce.inc
151,7 → 151,7
mov edx,eax
call mem_alloc_specified_region ;allocate memory for application
test eax,eax
jz .cleanfailed_mem1
jz .cleanfailed_mem
mov eax,[edx+(std_application_base_address shr 20)]
and eax,not (4096-1) ;eax - physical address of first (for application memory) page table
195,21 → 195,10
mov [esp+28],eax
popad
ret
.cleanfailed_mem1:
;there is mem for directory entry, but there is no mem for pages
;so free directory entry
mov eax,[new_process_place]
shl eax,8
mov eax,[0x80000+eax+0xB8]
call MEM_Free_Page
.cleanfailed_mem:
;there is no mem for directory entry, display message.
mov esi,start_not_enough_memory
call sys_msg_board_str
.cleanfailed: ;clean process name
;can't read file, clean process name.
;this avoid problems with panel application.
mov edi,[new_process_place]
shl edi,8
add edi,0x80000
218,7 → 207,6
cld
rep stosb
.failed:
;no more slots
add esp,8+4
mov [application_table_status],0
popad
308,7 → 296,7
mov edx,eax
call mem_alloc_specified_region ;allocate memory for application
test eax,eax
jz .cleanfailed_mem1
jz .cleanfailed_mem
mov eax,[edx+(std_application_base_address shr 20)]
and eax,not (4096-1) ;eax - physical address of first (for application memory) page table
352,20 → 340,10
popad
ret
.cleanfailed_mem1:
;there is mem for directory entry, but there is no mem for pages
;so free directory entry
mov eax,[new_process_place]
shl eax,8
mov eax,[0x80000+eax+0xB8]
call MEM_Free_Page
.cleanfailed_mem:
;there is no mem for directory entry, display message.
mov esi,start_not_enough_memory
call sys_msg_board_str
.cleanfailed: ;clean process name
;can't read file, clean process name.
;this avoid problems with panel application.
mov edi,[new_process_place]
shl edi,8
add edi,0x80000
374,7 → 352,6
cld
rep stosb
.failed:
;no more slots
add esp,8
mov [application_table_status],0
popad
473,6 → 450,10
mov eax,[0x800B8+ecx]
add eax,8+16 ;add flags
mov [l.cr3],eax
;write cr3 in TSS of System Call Handler
mov ecx,[new_process_place]
shl ecx,7
mov [0x298000+ecx+l.cr3-tss_sceleton],eax ;write directy to TSS
mov eax,[app_start]
mov [l.eip],eax ;set eip in TSS
1250,7 → 1231,7
mov edx,eax ;edx - linear address of page directory
call mem_alloc_specified_region ;allocate memory for application
test eax,eax
jz .cleanfailed_mem1
jz .cleanfailed_mem
add edx,(std_application_base_address shr 20)
mov eax,[edx]
1325,20 → 1306,10
popad
ret
.cleanfailed_mem1:
;there is mem for directory entry, but there is no mem for pages
;so free directory entry
mov eax,[new_process_place]
shl eax,8
mov eax,[0x80000+eax+0xB8]
call MEM_Free_Page
.cleanfailed_mem:
;there is no mem for directory entry, display message.
mov esi,start_not_enough_memory
call sys_msg_board_str
.cleanfailed: ;clean process name
;can't read file, clean process name.
;this avoid problems with panel application.
mov edi,[new_process_place]
shl edi,8
add edi,0x80000
1347,7 → 1318,6
cld
rep stosb
.failed:
;no more slots
add esp,16
popad
mov eax,-1