memory layout

git-svn-id: svn://kolibrios.org@418 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-03-15 18:07:22 +00:00
parent ef977fdf26
commit 4c9dc158c8
3 changed files with 23 additions and 19 deletions

View File

@ -259,11 +259,13 @@ tmp_page_tab equ 0x98B000; draw_data+sizeof(drw_data)
HEAP_BASE equ (OS_BASE+tmp_page_tab) HEAP_BASE equ (OS_BASE+tmp_page_tab)
LFB_BASE equ 0xFE000000
page_tabs equ 0x7FC00000 page_tabs equ 0xFDC00000
master_tab equ 0x7FDFF000 app_page_tabs equ 0xFDC00000
app_page_tabs equ 0x7FC00000 ;0x7FE00000 kernel_tabs equ (page_tabs+ (OS_BASE shr 10)) ;0xFDE00000
master_tab equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000
LFB_BASE equ 0xFE000000
sys_pgdir equ (OS_BASE+0x00050000) sys_pgdir equ (OS_BASE+0x00050000)
sys_pgmap equ (OS_BASE+0x00052000) sys_pgmap equ (OS_BASE+0x00052000)

View File

@ -448,8 +448,13 @@ get_pg_addr:
and eax, 0xFFFFF000 and eax, 0xFFFFF000
ret ret
align 4 align 4
proc page_fault_handler proc page_fault_handler
.err_code equ ebp+32
.err_addr equ ebp-4
pushad pushad
push eax push eax
@ -472,7 +477,7 @@ proc page_fault_handler
inc [pg_data.pages_faults] inc [pg_data.pages_faults]
mov ebx, [ebp-4] mov ebx, [.err_addr]
cmp ebx, 0x80000000 cmp ebx, 0x80000000
jae .kernel_space jae .kernel_space

View File

@ -147,9 +147,6 @@ proc fs_execute
cmp eax, 0 cmp eax, 0
jne .wait_lock jne .wait_lock
; pushfd
; cli
call set_application_table_status call set_application_table_status
call get_new_process_place call get_new_process_place
@ -389,20 +386,20 @@ proc create_app_space stdcall, app_size:dword,img_base:dword,img_size:dword
stdcall map_page,[tmp_task_pdir],eax,dword PG_SW stdcall map_page,[tmp_task_pdir],eax,dword PG_SW
mov edi, [tmp_task_pdir] mov edi, [tmp_task_pdir]
mov ecx, (page_tabs shr 20)/4 mov ecx, (OS_BASE shr 20)/4
xor eax, eax xor eax, eax
cld
rep stosd rep stosd
mov eax, [dir_addr]
or eax, PG_SW
stosd
mov esi, sys_pgdir+(OS_BASE shr 20)
mov ecx, (OS_BASE shr 20)/4 mov ecx, (OS_BASE shr 20)/4
cld mov esi, sys_pgdir+(OS_BASE shr 20)
rep movsd rep movsd
mov eax, [dir_addr] mov eax, [dir_addr]
or eax, PG_SW
mov [edi-4096+(page_tabs shr 20)], eax
and eax, -4096
call set_cr3 call set_cr3
mov edx, [app_tabs] mov edx, [app_tabs]
@ -551,7 +548,7 @@ proc destroy_app_space stdcall, pg_dir:dword
and eax, not 0xFFF and eax, not 0xFFF
stdcall map_page,[tmp_task_pdir],eax,dword PG_SW stdcall map_page,[tmp_task_pdir],eax,dword PG_SW
mov esi, [tmp_task_pdir] mov esi, [tmp_task_pdir]
mov edi, (page_tabs shr 20)/4 mov edi, (OS_BASE shr 20)/4
.destroy: .destroy:
mov eax, [esi] mov eax, [esi]
test eax, 1 test eax, 1
@ -942,10 +939,10 @@ proc set_app_params stdcall,slot:dword, params:dword,\
pl0_stack dd ? pl0_stack dd ?
endl endl
stdcall kernel_alloc, 0x2000 stdcall kernel_alloc, RING0_STACK_SIZE+512
mov [pl0_stack], eax mov [pl0_stack], eax
lea edi, [eax+0x2000-512] lea edi, [eax+RING0_STACK_SIZE]
mov eax, [slot] mov eax, [slot]
mov ebx, eax mov ebx, eax
@ -1070,7 +1067,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
mov [edi+TSS._io],word 128 mov [edi+TSS._io],word 128
mov [edi+TSS._ss0], os_data mov [edi+TSS._ss0], os_data
mov ebx, [pl0_stack] mov ebx, [pl0_stack]
add ebx, 0x2000-512 add ebx, RING0_STACK_SIZE
mov [edi+TSS._esp0],ebx mov [edi+TSS._esp0],ebx
mov ecx, edi ;ecx - address of application TSS mov ecx, edi ;ecx - address of application TSS