/kernel/branches/flat_kernel/core/debug.inc |
---|
115,7 → 115,7 |
; destroys eax,ecx,edx,esi,edi |
cmp ecx, 28h |
jnz .ret |
add edx, std_application_base_address |
; add edx, std_application_base_address |
push ebx |
mov ebx, edx |
call check_region |
174,7 → 174,7 |
; destroys eax,ecx,edx,esi,edi |
cmp ecx, 28h |
jnz .ret |
add edx, std_application_base_address |
; add edx, std_application_base_address |
push ebx |
mov ebx, edx |
call check_region |
230,7 → 230,7 |
lea eax, [eax*8+SLOT_BASE+APPDATA.dbg_regs] |
; [eax]=dr0, [eax+4]=dr1, [eax+8]=dr2, [eax+C]=dr3 |
; [eax+10]=dr7 |
add edx, std_application_base_address |
; add edx, std_application_base_address |
jc .errret |
cmp cl, 3 |
ja .errret |
302,7 → 302,7 |
; edx=address in debuggee |
; out: [esp+36]=sizeof(read) |
; destroys all |
add esi, std_application_base_address |
; add esi, std_application_base_address |
push ebx |
mov ebx, esi |
call check_region |
329,7 → 329,7 |
; edx=address in debuggee |
; out: [esp+36]=sizeof(write) |
; destroys all |
add esi, std_application_base_address |
; add esi, std_application_base_address |
push ebx |
mov ebx, esi |
call check_region |
/kernel/branches/flat_kernel/core/dll.inc |
---|
249,7 → 249,7 |
srv_handlerEx: |
test ebx, ebx |
jz .fail |
add ebx, new_app_base |
; add ebx, new_app_base |
mov eax, [ebx+handle] |
cmp [eax+SRV.magic], ' SRV' |
258,8 → 258,8 |
cmp [eax+SRV.size], SRV_SIZE |
jne .fail |
add [ebx+input], new_app_base |
add [ebx+output], new_app_base |
; add [ebx+input], new_app_base |
; add [ebx+output], new_app_base |
stdcall [eax+SRV.srv_proc], ebx |
ret |
401,9 → 401,9 |
xor eax, eax |
mov ebx, [file_name] |
sub ebx, new_app_base |
; sub ebx, new_app_base |
mov ecx, [info] |
sub ecx, new_app_base |
; sub ecx, new_app_base |
mov [cmd], 5 |
mov [offset], eax |
415,7 → 415,7 |
mov eax, 70 |
lea ebx, [cmd] |
sub ebx, new_app_base |
; sub ebx, new_app_base |
int 0x40 |
ret |
endp |
438,8 → 438,8 |
mov ecx, [off] |
mov edx, [bytes] |
mov esi, [buffer] |
sub ebx, new_app_base |
sub esi, new_app_base |
; sub ebx, new_app_base |
; sub esi, new_app_base |
mov [cmd], eax |
mov [offset], ecx |
451,7 → 451,7 |
mov eax, 70 |
lea ebx, [cmd] |
sub ebx, new_app_base |
; sub ebx, new_app_base |
int 0x40 |
ret |
endp |
907,13 → 907,13 |
jmp .next |
.copy: |
add esi, edx |
add edi, new_app_base |
; add edi, new_app_base |
mov ecx, [eax+CFS.SizeOfRawData] |
cld |
rep movsb |
.next: |
add edi, 15-new_app_base |
and edi, not 15 |
add edi, 15 ;-new_app_base |
and edi, -16 |
add eax, COFF_SECTION_SIZE |
dec ebx |
jnz @B |
/kernel/branches/flat_kernel/core/fpu.inc |
---|
193,7 → 193,7 |
mov ecx, [reg_eip] |
mov edx, [reg_esp] |
sub edx, 4 |
mov [ss:edx+new_app_base], ecx |
mov [ss:edx], ecx |
mov [reg_esp], edx |
mov dword [reg_eip], eax |
237,7 → 237,7 |
mov ecx, [reg_eip] |
mov edx, [reg_esp] |
sub edx, 4 |
mov [ss:edx+new_app_base], ecx |
mov [ss:edx], ecx |
mov [reg_esp], edx |
mov dword [reg_eip], eax |
/kernel/branches/flat_kernel/core/heap.inc |
---|
632,7 → 632,7 |
mov [SLOT_BASE+APPDATA.heap_top+ebx], eax |
sub eax, esi |
add esi, new_app_base |
; add esi, new_app_base |
shr esi, 10 |
mov ecx, eax |
sub eax, 4096 |
655,8 → 655,8 |
shl ebx, 8 |
mov esi, dword [ebx+SLOT_BASE+APPDATA.heap_base]; heap_base |
mov edi, dword [ebx+SLOT_BASE+APPDATA.heap_top]; heap_top |
add esi, new_app_base |
add edi, new_app_base |
; add esi, new_app_base |
; add edi, new_app_base |
l_0: |
cmp esi, edi |
jae m_exit |
700,7 → 700,7 |
mov eax, esi |
add eax, 4096 |
sub eax, new_app_base |
; sub eax, new_app_base |
ret |
m_next: |
add esi, eax |
757,8 → 757,8 |
sub ebx, [edx+SLOT_BASE+APPDATA.mem_size] |
neg ebx |
call update_mem_size |
add esi, new_app_base |
add edi, new_app_base |
; add esi, new_app_base |
; add edi, new_app_base |
shr esi, 12 |
shr edi, 12 |
@@: |
/kernel/branches/flat_kernel/core/memory.inc |
---|
340,8 → 340,8 |
ret |
.expand: |
add edi, new_app_base |
add esi, new_app_base |
; add edi, new_app_base |
; add esi, new_app_base |
push esi |
push edi |
457,13 → 457,13 |
pushad |
push eax |
push edx |
mov edx, 0x400 ;bocsh |
mov al,0xff ;bocsh |
out dx, al ;bocsh |
pop edx |
pop eax |
; push eax |
; push edx |
; mov edx, 0x400 ;bocsh |
; mov al,0xff ;bocsh |
; out dx, al ;bocsh |
; pop edx |
; pop eax |
mov ebp, esp |
mov eax, cr2 |
478,37 → 478,48 |
inc [pg_data.pages_faults] |
mov ebx, [.err_addr] |
mov eax, [.err_code] |
cmp ebx, 0x80000000 |
jae .kernel_space |
cmp ebx, OS_BASE |
jb .user_space ;ñòðàíèöà â ïàìÿòè ïðèëîæåíè |
cmp ebx, page_tabs+0x200000 |
jae .tab_space |
cmp ebx, page_tabs |
jb .kernel_space ;ñòðàíèöà â ïàìÿòè ÿäðà |
cmp ebx, app_page_tabs |
jae .alloc |
cmp ebx, kernel_tabs |
jb .alloc;.app_tabs ;òàáëèöû ñòðàíèö ïðèëîæåíè |
;ïðîñòî ñîçäàäèì îäíó |
cmp ebx, 0x7DC00000 |
jae .lfb_addr |
cmp ebx, LFB_BASE |
jb .core_tabs ;òàáëèöû ñòðàíèö ÿäðà |
;Îøèáêà |
.lfb: |
;îáëàñòü LFB |
;Îøèáêà |
jmp .fail |
; cmp ebx, 0x1000000 |
; jb .exit |
align 4 |
.user_space: |
test eax, PG_MAP |
jnz .err_access ;Ñòðàíèöà ïðèñóòñòâóåò |
;Îøèáêà äîñòóïà ? |
.user_space: |
shr ebx, 12 |
mov ecx, ebx |
shr ecx, 10 |
mov edx, [master_tab+ecx*4] |
test edx, 1 |
jz .fail |
test edx, PG_MAP |
jz .fail ;òàáëèöà ñòðàíèö íå ñîçäàíà |
;íåâåðíûé àäðåñ â ïðîãðàììå |
mov eax, [page_tabs+ebx*4] |
test eax, 2 |
jz .fail |
jz .fail ;àäðåñ íå çàðåçåðâèðîâàí äë |
;èñïîëüçîâàíèÿ. Îøèáêà |
.alloc: |
call alloc_page |
and eax, eax |
jz .exit |
jz .fail |
stdcall map_page,[ebp-4],eax,dword PG_UW |
525,6 → 536,26 |
popad |
add esp, 4 |
iretd |
.err_access: |
;íèêîãäà íå ïðîèñõîäèò |
jmp .fail |
.kernel_space: |
test eax, PG_MAP |
jz .fail ;ñòðàíèöà íå ïðèñóòñòâóåò |
test eax, 4 ;U/S |
jnz .fail ;ïðèëîæåíèå îáðàòèëîñü ê ïàìÿòè |
;ÿäðà |
test eax, 8 |
jnz .fail ;óñòàíîâëåí çàðåçåðâèðîâàííûé áèò |
;â òàáëèöàõ ñòðàíèö. äîáàâëåíî â P4/Xeon |
;ïîïûòêà çàïèñè â çàùèù¸ííóþ ñòðàíèöó ÿäðà |
;íå îáðàáàòûâàåì. Îøèáêà |
.core_tabs: |
.fail: |
pop es |
pop ds |
539,30 → 570,30 |
jmp exc_c |
iretd |
.kernel_space: |
;.kernel_space: |
; shr ebx, 12 |
; mov eax, [page_tabs+ebx*4] |
; shr ebx, 10 |
; mov eax, [master_tab+ebx*4] |
jmp .exit |
.old_addr: |
;.old_addr: |
; shr ebx, 12 |
; mov eax, [page_tabs+ebx*4] |
; shr ebx, 10 |
; mov eax, [master_tab+ebx*4] |
jmp .exit |
.lfb_addr: |
;.lfb_addr: |
; shr ebx, 22 |
; ;mov ecx, [sys_page_dir] |
; mov eax, [master_tab+ebx*4] |
jmp .exit |
.tab_space: |
;.tab_space: |
; shr ebx, 12 |
; mov eax, [page_tabs+ebx*4] |
; shr ebx, 10 |
; ;mov ecx, [sys_page_dir] |
; mov eax, [master_tab+ebx*4] |
jmp .exit |
; jmp .exit |
endp |
align 4 |
706,7 → 737,7 |
mov [eax+0xA0],ebx ;set fields in extended information area |
mov [eax+0xA4],ecx |
add ebx, new_app_base |
; add ebx, new_app_base |
add ecx, ebx |
add ecx, 4095 |
and ecx, not 4095 |
743,7 → 774,7 |
jz .no_ipc_area |
mov ebx, edi |
add edi, new_app_base |
; add edi, new_app_base |
and ebx, 0xFFF |
mov [dst_offset], ebx |
777,7 → 808,7 |
mov [edi+4], ecx |
add edi, 8 |
mov esi, [msg_addr] |
add esi, new_app_base |
; add esi, new_app_base |
cld |
rep movsb |
835,9 → 866,9 |
align 4 |
sysfn_meminfo: |
add ebx, new_app_base |
cmp ebx, new_app_base |
jb .fail |
; add ebx, new_app_base |
cmp ebx, OS_BASE |
jae .fail |
mov eax, [pg_data.pages_count] |
mov [ebx], eax |
883,7 → 914,7 |
@@: |
cmp eax, 13 |
ja @f |
add ebx, new_app_base |
; add ebx, new_app_base |
stdcall user_free, ebx |
mov [esp+36], eax |
ret |
890,9 → 921,9 |
@@: |
cmp eax, 14 |
ja @f |
add ebx, new_app_base |
cmp ebx, new_app_base |
jb .fail |
; add ebx, new_app_base |
cmp ebx, OS_BASE |
jae .fail |
stdcall get_event_ex, ebx, ecx |
mov [esp+36], eax |
ret |
911,9 → 942,9 |
test ebx, ebx |
jz .fail |
add ebx, new_app_base |
cmp ebx, new_app_base |
jb .fail |
; add ebx, new_app_base |
cmp ebx, OS_BASE |
jae .fail |
stdcall get_service, ebx |
mov [esp+36], eax |
ret |
935,9 → 966,9 |
@@: |
cmp eax, 19 |
ja .fail |
add ebx, new_app_base |
cmp ebx, new_app_base |
jb .fail |
; add ebx, new_app_base |
cmp ebx, OS_BASE |
jae .fail |
stdcall load_library, ebx |
mov [esp+36], eax |
ret |
/kernel/branches/flat_kernel/core/taskman.inc |
---|
206,7 → 206,7 |
jna @F |
xor eax, eax |
add edi, new_app_base |
; add edi, new_app_base |
cld |
rep stosb |
@@: |
733,7 → 733,7 |
mov eax, [slot] |
shl eax,8 |
mov ebx, [offset] |
add ebx, new_app_base |
; add ebx, new_app_base |
push ecx |
stdcall map_memEx, [proc_mem_map],\ |
[SLOT_BASE+eax+0xB8],\ |
799,7 → 799,7 |
mov eax, [slot] |
shl eax,8 |
mov ebx, [offset] |
add ebx, new_app_base |
; add ebx, new_app_base |
push ecx |
stdcall map_memEx, [proc_mem_map],\ |
[SLOT_BASE+eax+0xB8],\ |
879,6 → 879,8 |
rep stosd ;clean extended information about new thread |
mov esi,ebx |
mov edi,edx |
mov byte [edi], '@' |
inc edi |
mov ecx,11 |
rep movsb ;copy process name |
991,7 → 993,7 |
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
ja @f |
add edx, new_app_base |
; add edx, new_app_base |
stdcall k_strncpy, edx, [cmd_line], 256 |
@@: |
mov edx,[params] |
1003,7 → 1005,7 |
jc @f |
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
ja @f |
add edx, new_app_base |
; add edx, new_app_base |
stdcall k_strncpy, edx, [app_path], 1024 |
@@: |
mov ebx,[slot] |
1056,7 → 1058,7 |
mov [edi+TSS._eip],eax ;set eip in TSS |
mov eax, [esi+0x0C] ;app_esp |
mov [edi+TSS._esp],eax ;set stack in TSS |
mov [edi+TSS._eflags],dword 0x1202 |
mov [edi+TSS._eflags],dword 0x3202 |
mov [edi+TSS._cs],app_code ;selector of code segment |
mov [edi+TSS._ss],app_data |