/kernel/trunk/const.inc |
---|
226,11 → 226,10 |
;skin_data equ OS_BASE+0x0778000 |
draw_data equ OS_BASE+0x0800000 |
sysint_stack_data equ OS_BASE+0x0803000 |
tss_data equ 0x0803000 ;OS_BASE+0x0920000 |
tss_data equ OS_BASE+0x0920000 |
HEAP_BASE equ 0xA0B000 ;x00C00000 |
pages_tab equ 0x60000000 |
master_tab equ 0x60180000 |
current_pgdir equ 0x60180000 |
239,7 → 238,11 |
sys_master_tab equ OS_BASE+0x00051000 |
sys_pgmap equ OS_BASE+0x00052000 |
;lfb_start equ 0x00800000 |
;new_app_pdir equ OS_BASE+0x01000000 |
;new_app_master_table equ OS_BASE+0x01001000 |
;new_app_ptable equ OS_BASE+0x01002000 |
new_app_base equ 0x60400000 |
/kernel/trunk/core/memory.inc |
---|
1,5 → 1,5 |
tmp_page_tab equ HEAP_BASE |
tmp_page_tab equ 0x00C00000 |
align 4 |
proc mem_test |
18,7 → 18,6 |
cmp dword [edi], 'TEST' |
xchg ebx, dword [edi] |
je @b |
mov [MEM_AMOUNT], edi |
and eax, not (CR0_CD+CR0_NW) ;enable caching |
mov cr0, eax |
28,35 → 27,12 |
endp |
align 4 |
proc init_mem |
mov eax, [MEM_AMOUNT] |
mov [pg_data.mem_amount], eax |
mov [pg_data.kernel_max], eax |
shr eax, 12 |
mov edx, eax |
mov [pg_data.pages_count], eax |
mov [pg_data.kernel_pages], eax |
shr eax, 3 |
mov [pg_data.pagemap_size], eax |
shr edx, 10 |
cmp edx, 3 |
ja @f |
inc edx ;at least 4Mb for kernel heap |
@@: |
mov [pg_data.kernel_tables], edx |
proc init_memEx |
xor eax, eax |
mov edi, sys_pgdir |
mov ecx, 2048 |
cld |
rep stosd |
mov edx, sys_pgdir |
bt [cpu_caps], CAPS_PSE |
jnc .no_PSE |
69,53 → 45,71 |
or ebx, CR4_PGE |
@@: |
mov cr4, ebx |
sub [pg_data.kernel_tables], 2 |
mov [edx], eax |
mov dword [sys_pgdir], eax |
add eax, 0x00400000 |
mov [edx+4], eax |
add edx, 8 |
mov dword [sys_pgdir+4], eax |
add eax, 0x00400000 |
mov dword [sys_pgdir+8], eax |
mov eax, 0x800000+PG_SW |
mov ecx, (HEAP_BASE-0x800000)/4096 |
jmp .map_low |
mov dword [sys_pgdir+0x600], sys_pgdir+PG_SW |
mov ecx, [pg_data.kernel_tables] |
sub ecx, 3 ;4 |
mov eax, tmp_page_tab+PG_SW |
mov edi, sys_pgdir+12 ;16 |
jmp .map_kernel_tabs |
.no_PSE: |
mov eax, PG_SW |
mov ecx, HEAP_BASE/4096 |
mov esi, tmp_page_tab |
mov ecx, 3072/4; 4096/4 ;0x0 - 0x00FFFFFF |
.map_low: |
mov edi, tmp_page_tab |
@@: ; |
stosd |
mov [esi], eax |
add eax, 0x1000 |
mov [esi+4], eax |
add eax, 0x1000 |
mov [esi+8], eax |
add eax, 0x1000 |
mov [esi+12], eax |
add eax, 0x1000 |
add esi, 16 |
dec ecx |
jnz @B |
jnz .map_low ;ÿäðî |
mov ecx, [pg_data.kernel_tables] |
shl ecx, 10 |
xor eax, eax |
rep stosd |
mov ecx, [pg_data.kernel_tables] |
mov eax, tmp_page_tab+PG_SW |
mov edi, edx |
mov edi, sys_pgdir |
.map_kernel_tabs: |
stosd |
mov [edi], eax |
add eax, 0x1000 |
add edi, 4 |
dec ecx |
jnz .map_kernel_tabs |
mov edi, tmp_page_tab |
bt [cpu_caps], CAPS_PSE |
jc @F |
add edi, 3072*4 ;4096*4 ;skip low kernel memory |
@@: |
mov ecx, [pg_data.kernel_tables] |
sub ecx, 3 |
shl ecx, 10 |
xor eax, eax |
cld |
rep stosd |
mov dword [sys_pgdir+0x600], sys_pgdir+PG_SW |
ret |
endp |
align 4 |
proc init_page_map |
mov edi, sys_pgmap |
mov ecx, (HEAP_BASE/4096)/32 ;384/4 |
mov ebx, ecx |
mov ecx, 384/4 |
xor eax,eax |
cld |
rep stosd |
122,15 → 116,18 |
not eax |
mov ecx, [pg_data.pagemap_size] |
sub ecx, ebx |
sub ecx, 384 |
shr ecx, 2 |
rep stosd |
lea edi, [sys_pgmap+ebx*4] ;+384 |
mov edi, sys_pgmap+384 |
mov edx, [pg_data.pages_count] |
mov ecx, [pg_data.kernel_tables] |
add ecx, (HEAP_BASE/4096) and 31 |
sub edx, HEAP_BASE/4096 |
bt [cpu_caps], CAPS_PSE |
jnc @f |
sub ecx, 3 |
@@: |
sub edx, 3072 |
sub edx, ecx |
mov [pg_data.pages_free], edx |
143,9 → 140,9 |
mov ecx, ebx |
and ecx, 31 |
shl eax, cl |
mov [page_start], edi; sys_pgmap+384 |
stosd |
mov [page_start], sys_pgmap+384 |
mov ebx, sys_pgmap |
add ebx, [pg_data.pagemap_size] |
mov [page_end], ebx |
1351,6 → 1348,7 |
align 16 |
irq_tab rd 16 |
MEM_FreeSpace rd 1 |
ipc_tmp rd 1 |
1365,6 → 1363,7 |
tmp_task_ptab rd 1 |
tmp_task_data rd 1 |
fpu_data rd 1 |
fdd_buff rd 1 |
LFBSize rd 1 |
1396,8 → 1395,6 |
uglobal |
align 16 |
fpu_data: |
rb 512 |
mst MEM_STATE |
1409,9 → 1406,7 |
srv.fd rd 1 |
srv.bk rd 1 |
mem_used.fd rd 1 |
mem_used.bk rd 1 |
mem_used_list rd 1 |
mem_block_arr rd 1 |
mem_block_start rd 1 |
mem_block_end rd 1 |
1429,7 → 1424,6 |
event_end rd 1 |
event_uid rd 1 |
sys_page_map rd 1 |
os_stack rd 1 |
endg |
if 0 |
/kernel/trunk/core/taskman.inc |
---|
168,8 → 168,7 |
mov eax,[app_mem] |
mov [ebx+APPDATA.mem_size],eax |
if GREEDY_KERNEL |
else |
if not GREEDY_KERNEL |
mov ecx, [app_mem] |
mov edi, [file_size] |
add edi, 4095 |
302,6 → 301,7 |
ret |
endp |
align 4 |
proc create_app_space stdcall, app_size:dword,img_base:dword,img_size:dword |
locals |
449,7 → 449,7 |
.fail: |
dec [pg_data.pg_mutex] |
cmp [dir_addr], 0 |
je @f |
jz @f |
stdcall destroy_app_space, [dir_addr] |
@@: |
xor eax, eax |
968,27 → 968,35 |
proc set_app_params stdcall,slot:dword, params:dword,\ |
cmd_line:dword, app_path:dword, flags:dword |
locals |
pl0_stack dd ? |
endl |
mov edi, [slot] |
mov esi, [fpu_data] |
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
stdcall kernel_alloc, 0x2000 |
mov [pl0_stack], eax |
lea edi, [eax+0x2000-512] |
mov eax, [slot] |
mov ebx, eax |
shl edi, 8 |
mov eax, edi |
lea edi, [esi+edi*2] |
mov [eax+PROC_BASE+APPDATA.fpu_state], edi |
mov [eax+PROC_BASE+APPDATA.fpu_handler], 0 |
mov [eax+PROC_BASE+APPDATA.sse_handler], 0 |
mov ecx, 512/4 |
jmp @F |
.no_SSE: |
mov eax, edi |
shl eax, 8 |
mov ebx, edi |
shl edi, 7 |
shl ebx, 4 |
sub edi, ebx ;edi*=112 |
add edi, esi |
mov [eax+PROC_BASE+APPDATA.fpu_state], edi |
mov [eax+PROC_BASE+APPDATA.fpu_handler], 0 |
mov [eax+PROC_BASE+APPDATA.sse_handler], 0 |
mov esi, fpu_data |
mov ecx, 512/4 |
mov ecx, 112/4 |
@@: |
rep movsd |
mov ebx,[slot] |
cmp ebx,[TASK_COUNT] |
jle .noinc |
inc dword [TASK_COUNT] ;update number of processes |
1004,8 → 1012,6 |
mov ecx, [def_cursor] |
mov [PROC_BASE+APPDATA.cursor+ebx],ecx |
mov eax, [pl0_stack] |
mov [PROC_BASE+APPDATA.pl0_stack+ebx],eax |
shr ebx,3 |
mov eax, new_app_base |
1099,8 → 1105,9 |
mov [edi+TSS._gs],graph_data ;selector of graphic segment |
mov [edi+TSS._io],word 128 |
mov [edi+TSS._ss0], os_data |
mov ebx, [pl0_stack] |
add ebx, 0x2000-512 |
mov ebx,[slot] |
shl ebx,12 |
add ebx,sysint_stack_data+4096 |
mov [edi+TSS._esp0],ebx |
mov ecx, edi ;ecx - address of application TSS |
/kernel/trunk/core/dll.inc |
---|
512,13 → 512,13 |
.exit: |
push eax |
lea edi, [eax+ebx] ;cleanup remain space |
mov ecx, 4096 ;from file end |
and ebx, 4095 |
mov ecx, ebx ;from file end |
add ecx, 4095 |
and ecx, not 4095 |
sub ecx, ebx |
xor eax, eax |
cld |
rep stosb |
mov ebx, [file_size] |
pop eax |
ret |
.cleanup: |
/kernel/trunk/core/sys32.inc |
---|
31,6 → 31,7 |
ret |
build_interrupt_table: |
mov edi, idts+8 |
622,9 → 623,10 |
mov eax,[PROC_BASE+eax+APPDATA.dir_table] |
stdcall destroy_app_space, eax |
mov esi, [.slot] |
;; mov esi, [.slot] |
pop esi ;restore stack |
cmp [fpu_owner],esi ; if user fpu last -> fpu user = 1 |
jne @F |
jne fpu_ok_1 |
mov [fpu_owner],1 |
mov eax, [256+PROC_BASE+APPDATA.fpu_state] |
632,11 → 634,11 |
clts |
jnc .no_SSE |
fxrstor [eax] |
jmp @F |
jmp fpu_ok_1 |
.no_SSE: |
fnclex |
frstor [eax] |
@@: |
fpu_ok_1: |
mov [0xf400],byte 0 ; empty keyboard buffer |
mov [0xf500],byte 0 ; empty button buffer |
745,23 → 747,25 |
.nodebug: |
popad |
mov ebx, [.slot] |
shl ebx, 8 |
mov ebx,[PROC_BASE+ebx+APPDATA.pl0_stack] |
stdcall kernel_free, ebx |
mov edi, [.slot] |
pusha ; at 0x80000+ |
mov edi,esi |
shl edi,8 |
add edi,0x80000 |
mov eax, 0x20202020 |
stosd |
stosd |
stosd |
mov ecx,244/4 |
mov ecx,256/4 |
xor eax, eax |
rep stosd |
popa |
pusha ; name to spaces |
mov edi,esi |
shl edi,8 |
add edi,0x80000+APPDATA.app_name |
mov ecx,11 |
mov eax,' ' |
rep stosb |
popa |
; activate window |
movzx eax, word [0xC000 + esi*2] |
cmp eax, [0x3004] |
820,6 → 824,7 |
loop newirqfree |
popa |
pusha ; remove all port reservations |
mov edx,esi |
shl edx, 5 |
905,7 → 910,6 |
mov [application_table_status],0 |
mov esi,process_terminated |
call sys_msg_board_str |
add esp, 4 |
ret |
restore .slot |
/kernel/trunk/core/heap.inc |
---|
1,9 → 1,12 |
HEAP_BASE equ 0x00C00000 |
;HEAP_SIZE equ 0x01000000 |
struc MEM_BLOCK |
{ .next_block dd ? |
.prev_block dd ? ;+4 |
.list_fd dd ? ;+8 |
.list_bk dd ? ;+12 |
.list_next dd ? ;+8 |
.list_prev dd ? ;+12 |
.base dd ? ;+16 |
.size dd ? ;+20 |
.flags dd ? ;+24 |
10,7 → 13,6 |
.handle dd ? ;+28 |
} |
MEM_LIST_OFFSET equ 8 |
FREE_BLOCK equ 4 |
USED_BLOCK equ 8 |
22,8 → 24,8 |
block_next equ MEM_BLOCK.next_block |
block_prev equ MEM_BLOCK.prev_block |
list_fd equ MEM_BLOCK.list_fd |
list_bk equ MEM_BLOCK.list_bk |
list_next equ MEM_BLOCK.list_next |
list_prev equ MEM_BLOCK.list_prev |
block_base equ MEM_BLOCK.base |
block_size equ MEM_BLOCK.size |
block_flags equ MEM_BLOCK.flags |
38,18 → 40,18 |
} |
macro remove_from_list op |
{ mov edx, [op+list_fd] |
mov ecx, [op+list_bk] |
{ mov edx, [op+list_next] |
mov ecx, [op+list_prev] |
test edx, edx |
jz @f |
mov [edx+list_bk], ecx |
mov [edx+list_prev], ecx |
@@: |
test ecx, ecx |
jz @f |
mov [ecx+list_fd], edx |
mov [ecx+list_next], edx |
@@: |
mov [op+list_fd],0 |
mov [op+list_bk],0 |
mov [op+list_next],0 |
mov [op+list_prev],0 |
} |
macro remove_from_free op |
70,12 → 72,11 |
macro remove_from_used op |
{ |
mov edx, [op+list_fd] |
mov ecx, [op+list_bk] |
mov [edx+list_bk], ecx |
mov [ecx+list_fd], edx |
mov [op+list_fd], 0 |
mov [op+list_bk], 0 |
remove_from_list op |
cmp [mem_used_list], op |
jne @f |
mov [mem_used_list], edx |
@@: |
} |
align 4 |
96,10 → 97,6 |
mov [mem_block_end], mem_block_map+512 |
mov [mem_block_arr], HEAP_BASE |
mov eax, mem_used.fd-MEM_LIST_OFFSET |
mov [mem_used.fd], eax |
mov [mem_used.bk], eax |
stdcall alloc_pages, dword 32 |
mov ecx, 32 |
mov edx, eax |
112,12 → 109,13 |
jnz .l1 |
mov edi, HEAP_BASE |
mov ebx, HEAP_BASE+MEM_BLOCK_SIZE |
mov ebx, edi |
add ebx, MEM_BLOCK_SIZE |
xor eax, eax |
mov [edi+block_next], ebx |
mov [edi+block_prev], eax |
mov [edi+list_fd], eax |
mov [edi+list_bk], eax |
mov [edi+list_next], eax |
mov [edi+list_prev], eax |
mov [edi+block_base], HEAP_BASE |
mov [edi+block_size], 4096*MEM_BLOCK_SIZE |
mov [edi+block_flags], USED_BLOCK |
124,8 → 122,7 |
mov [ebx+block_next], eax |
mov [ebx+block_prev], eax |
mov [ebx+list_fd], eax |
mov [ebx+list_bk], eax |
mov [ebx+list_next], eax |
mov [ebx+block_base], HEAP_BASE+4096*MEM_BLOCK_SIZE |
mov ecx, [MEM_AMOUNT] |
138,6 → 135,7 |
mov [mem_block_mask], eax |
mov [mem_block_mask+4],0x80000000 |
mov [mem_used_list], eax |
mov [mem_block_list+63*4], ebx |
mov byte [mem_block_map], 0xFC |
and [heap_mutex], 0 |
222,15 → 220,6 |
endp |
proc free_mem_block |
mov dword [eax], 0 |
mov dword [eax+4], 0 |
mov dword [eax+8], 0 |
mov dword [eax+12], 0 |
mov dword [eax+16], 0 |
; mov dword [eax+20], 0 |
mov dword [eax+24], 0 |
mov dword [eax+28], 0 |
sub eax, [mem_block_arr] |
shr eax, 5 |
296,8 → 285,8 |
mov eax, [edi+block_prev] |
mov [esi+block_prev], eax |
mov [edi+block_prev], esi |
mov [esi+list_fd], 0 |
mov [esi+list_bk], 0 |
mov [esi+list_next], 0 |
mov [esi+list_prev], 0 |
and eax, eax |
jz @f |
mov [eax+block_next], esi |
329,22 → 318,22 |
btr [mem_block_mask], ecx |
@@: |
mov edx, [mem_block_list+eax*4] |
mov [edi+list_fd], edx |
mov [edi+list_next], edx |
test edx, edx |
jz @f |
mov [edx+list_bk], edi |
mov [edx+list_prev], edi |
@@: |
mov [mem_block_list+eax*4], edi |
bts [mem_block_mask], eax |
.m_eq_ind: |
mov ecx, mem_used.fd-MEM_LIST_OFFSET |
mov edx, [ecx+list_fd] |
mov [esi+list_fd], edx |
mov [esi+list_bk], ecx |
mov [ecx+list_fd], esi |
mov [edx+list_bk], esi |
mov ebx, [mem_used_list] |
mov [esi+list_next], ebx |
test ebx, ebx |
jz @f |
mov [ebx+list_prev], esi |
@@: |
mov [esi+block_flags], USED_BLOCK |
mov [mem_used_list], esi |
mov eax, [esi+block_base] |
mov ebx, [size] |
sub [heap_free], ebx |
357,13 → 346,13 |
jnz @f |
btr [mem_block_mask], ebx |
@@: |
mov ecx, mem_used.fd-MEM_LIST_OFFSET |
mov edx, [ecx+list_fd] |
mov [edi+list_fd], edx |
mov [edi+list_bk], ecx |
mov [ecx+list_fd], edi |
mov [edx+list_bk], edi |
mov ecx, [mem_used_list] |
mov [edi+list_next], ecx |
test ecx, ecx |
jnz @f |
mov [ecx+list_prev], edi |
@@: |
mov [mem_used_list], edi |
mov [edi+block_flags], USED_BLOCK |
mov eax, [edi+block_base] |
mov ebx, [size] |
383,14 → 372,14 |
call wait_mutex ;ebx |
mov eax, [base] |
mov esi, [mem_used.fd] |
mov esi, [mem_used_list] |
@@: |
cmp esi, mem_used.fd-MEM_LIST_OFFSET |
je .fail |
test esi, esi |
jz .fail |
cmp [esi+block_base], eax |
je .found |
mov esi, [esi+list_fd] |
mov esi, [esi+list_next] |
jmp @b |
.found: |
cmp [esi+block_flags], USED_BLOCK |
463,10 → 452,10 |
@@: |
mov esi, [mem_block_list+eax*4] |
mov [mem_block_list+eax*4], edi |
mov [edi+list_fd], esi |
mov [edi+list_next], esi |
test esi, esi |
jz @f |
mov [esi+list_bk], edi |
mov [esi+list_prev], edi |
@@: |
bts [mem_block_mask], eax |
.m_eq: |
482,10 → 471,10 |
mov edi, [mem_block_list+eax*4] |
mov [mem_block_list+eax*4], esi |
mov [esi+list_fd], edi |
mov [esi+list_next], edi |
test edi, edi |
jz @f |
mov [edi+list_bk], esi |
mov [edi+list_prev], esi |
@@: |
bts [mem_block_mask], eax |
mov [esi+block_flags],FREE_BLOCK |
511,14 → 500,14 |
and eax, not 4095; |
mov [size], eax |
and eax, eax |
jz .err |
jz .error |
mov ebx, eax |
shr ebx, 12 |
mov [pages_count], ebx |
stdcall alloc_kernel_space, eax |
test eax, eax |
jz .err |
and eax, eax |
jz .error |
mov [lin_addr], eax |
mov ecx, [pages_count] |
533,7 → 522,7 |
stdcall alloc_pages, ebx |
pop ecx ; yes ecx!!! |
and eax, eax |
jz .err |
jz .error |
mov edi, eax |
mov edx, [lin_addr] |
547,12 → 536,12 |
mov ecx, [pages_count] |
and ecx, 7 |
jz .end |
@@: |
push ecx |
@@: push ecx |
call alloc_page |
pop ecx |
test eax, eax |
jz .err |
jz .error |
stdcall map_page,edx,eax,dword PG_SW |
add edx, 0x1000 |
561,7 → 550,7 |
.end: |
mov eax, [lin_addr] |
ret |
.err: |
.error: |
xor eax, eax |
ret |
endp |
574,14 → 563,14 |
call wait_mutex ;ebx |
mov eax, [base] |
mov esi, [mem_used.fd] |
mov esi, [mem_used_list] |
@@: |
cmp esi, mem_used.fd-MEM_LIST_OFFSET |
je .fail |
test esi, esi |
jz .fail |
cmp [esi+block_base], eax |
je .found |
mov esi, [esi+list_fd] |
mov esi, [esi+list_next] |
jmp @b |
.found: |
cmp [esi+block_flags], USED_BLOCK |
/kernel/trunk/core/fpu.inc |
---|
6,6 → 6,9 |
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
stdcall kernel_alloc, 512*256 |
mov [fpu_data], eax |
mov ebx, cr4 |
mov ecx, cr0 |
or ebx, CR4_OSFXSR+CR4_OSXMMEXPT |
26,14 → 29,16 |
xorps xmm5, xmm5 |
xorps xmm6, xmm6 |
xorps xmm7, xmm7 |
fxsave [fpu_data] ;[eax] |
fxsave [eax] |
ret |
.no_SSE: |
stdcall kernel_alloc, 112*256 |
mov [fpu_data], eax |
mov ecx, cr0 |
and ecx, not CR0_EM |
or ecx, CR0_MP+CR0_NE |
mov cr0, ecx |
fnsave [fpu_data] |
fnsave [eax] |
ret |
align 4 |
113,6 → 118,8 |
fpu_owner dd 1 |
endg |
reg_eip equ ebp+4 |
reg_cs equ ebp+8 |
reg_eflags equ ebp+12 |
/kernel/trunk/kernel32.inc |
---|
176,7 → 176,7 |
.ev_count dd ? ;+20 |
.fpu_handler dd ? ;+24 |
.sse_handler dd ? ;+28 |
.pl0_stack dd ? ;unused ;+32 |
dd ? ;unused ;+32 |
.heap_base dd ? ;+36 |
.heap_top dd ? ;+40 |
.cursor dd ? ;+44 |
/kernel/trunk/kernel.asm |
---|
356,6 → 356,32 |
mov [0xe024],dword Vesa20_getpixel32 |
no_mode_0x12: |
; MEMORY MODEL |
call mem_test |
mov [MEM_AMOUNT], eax |
mov [pg_data.mem_amount], eax |
mov [pg_data.kernel_max], eax |
shr eax, 12 |
mov edx, eax |
mov [pg_data.pages_count], eax |
mov [pg_data.kernel_pages], eax |
shr eax, 3 |
mov [pg_data.pagemap_size], eax |
shr edx, 10 |
cmp edx, 3 |
ja @f |
inc edx ;at least 4Mb for kernel heap |
@@: |
mov [pg_data.kernel_tables], edx |
; ENABLE PAGING |
call test_cpu |
; btr [cpu_caps], CAPS_SSE ;test: dont't use sse code |
; btr [cpu_caps], CAPS_SSE2 ;test: don't use sse2 |
367,12 → 393,9 |
; btr [cpu_caps], CAPS_MTRR ;test: don't use MTRR |
bts [cpu_caps], CAPS_TSC ;force use rdtsc |
; MEMORY MODEL |
call mem_test |
call init_mem |
call init_memEx |
call init_page_map |
; ENABLE PAGING |
mov eax, sys_pgdir |
mov cr3, eax |
381,8 → 404,6 |
mov cr0,eax |
call init_kernel_heap |
stdcall kernel_alloc, 0x2000 |
mov [os_stack], eax |
call init_LFB |
call init_mtrr |
call init_fpu |
559,7 → 580,7 |
mov esi,boot_setostask |
call boot_log |
mov eax, fpu_data |
mov eax, [fpu_data] |
mov dword [0x80000+APPDATA.fpu_state], eax |
mov dword [0x80000+APPDATA.fpu_handler], 0 |
mov dword [0x80000+APPDATA.sse_handler], 0 |
568,26 → 589,32 |
mov dword [0x80000+256+APPDATA.app_name], dword 'OS/I' |
mov dword [0x80000+256+APPDATA.app_name+4], dword 'DLE ' |
mov edi, [os_stack] |
mov dword [0x80000+256+APPDATA.pl0_stack], edi |
add edi, 0x2000-512 |
mov dword [0x80000+256+APPDATA.fpu_state], edi |
mov esi, fpu_data |
mov ecx, 512/4 |
cld |
rep movsd |
mov ebx, [def_cursor] |
mov dword [0x80000+256+APPDATA.cursor], ebx |
mov dword [0x80000+256+APPDATA.fpu_handler], 0 |
mov dword [0x80000+256+APPDATA.sse_handler], 0 |
mov ebx, [def_cursor] |
mov dword [0x80000+256+APPDATA.cursor], ebx |
mov ebx, PROC_BASE+256+APP_OBJ_OFFSET |
mov dword [0x80000+256+APPDATA.fd_obj], ebx |
mov dword [0x80000+256+APPDATA.bk_obj], ebx |
;set fpu save area |
mov esi, eax |
bt [cpu_caps], CAPS_SSE |
jnc .no_sse |
lea edi, [eax+512] |
mov dword [PROC_BASE+256+APPDATA.fpu_state], edi |
mov ecx, 512/4 |
jmp @F |
.no_sse: |
lea edi, [eax+112] |
mov dword [PROC_BASE+256+APPDATA.fpu_state], edi |
mov ecx, 112/4 |
@@: |
rep movsd |
; task list |
mov [0x3020+TASKDATA.wnd_number], 1 ; on screen number |
mov [0x3020+TASKDATA.pid], 1 ; process id number |
605,9 → 632,7 |
mov [edi+TSS._cr3],eax |
mov [edi+TSS._eip],osloop |
mov [edi+TSS._eflags],dword 0x11202 ; sti and resume |
mov eax, [os_stack] |
add eax, 0x2000-512 |
mov [edi+TSS._esp], eax |
mov [edi+TSS._esp],sysint_stack_data + 4096*2 ; uses slot 1 stack |
mov [edi+TSS._cs],os_code |
mov [edi+TSS._ss],os_data |
mov [edi+TSS._ds],os_data |
/kernel/trunk/memmap.inc |
---|
209,11 → 209,19 |
; 08 dword draw limit - x end |
; 0C dword draw limit - y end |
; |
; 802000 -> 802fff free (4 Kb) |
; |
; 803000 -> 0xA0AFFF TSS and IO map for (8192*8)=65536 ports |
; 803000 -> 902fff sysint_stack_data |
; - ring0 stacks for ring3 processes |
; - used for interrupt handling |
; - 256 entries * 4096 step |
; |
; 903000 -> 91ffff free (116 Kb) |
; |
; 920000 -> B28000 TSS and IO map for (8192*8)=65536 ports |
; (128+8192)*256 = 2129920 = 0x208000 |
; |
; 0xA0B000 -> kernel heap |
; C00000 -> kernel heap |