forked from KolibriOS/kolibrios
kernel: initialize handle table
git-svn-id: svn://kolibrios.org@5202 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e6265b4399
commit
2f6c0cead9
@ -472,7 +472,7 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword
|
|||||||
mov [process], eax
|
mov [process], eax
|
||||||
|
|
||||||
lea edi, [eax+PROC.heap_lock]
|
lea edi, [eax+PROC.heap_lock]
|
||||||
mov ecx, (4096-PROC.heap_lock)/4
|
mov ecx, (PROC.ht_next-PROC.heap_lock)/4
|
||||||
|
|
||||||
list_init eax
|
list_init eax
|
||||||
add eax, PROC.thr_list
|
add eax, PROC.thr_list
|
||||||
@ -482,6 +482,14 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword
|
|||||||
cld
|
cld
|
||||||
rep stosd
|
rep stosd
|
||||||
|
|
||||||
|
mov ecx, (PROC.pdt_0 - PROC.htab)/4
|
||||||
|
@@:
|
||||||
|
stosd
|
||||||
|
inc eax
|
||||||
|
cmp eax, ecx
|
||||||
|
jbe @B
|
||||||
|
|
||||||
|
mov [edi-4096+PROC.ht_next], 3 ;reserve handles for stdin stdout and stderr
|
||||||
mov eax, edi
|
mov eax, edi
|
||||||
call get_pg_addr
|
call get_pg_addr
|
||||||
mov [edi-4096+PROC.pdt_0_phys], eax
|
mov [edi-4096+PROC.pdt_0_phys], eax
|
||||||
|
@ -111,7 +111,9 @@ struct PROC
|
|||||||
io_map_0 rd 1
|
io_map_0 rd 1
|
||||||
io_map_1 rd 1
|
io_map_1 rd 1
|
||||||
|
|
||||||
unused rb 4096-$
|
ht_lock rd 1 ;htab[0] stdin
|
||||||
|
ht_next rd 1 ;htab[1] stdout
|
||||||
|
htab rd (4096-$)/4 ;htab[2] stderr
|
||||||
pdt_0 rd 1024
|
pdt_0 rd 1024
|
||||||
ends
|
ends
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user