/kernel/branches/flat_kernel/blkdev/rd.inc |
---|
2292,7 → 2292,7 |
mov ebx, [ebx+4] |
test ebx, ebx |
jz @f |
add ebx, std_application_base_address |
; add ebx, std_application_base_address |
@@: |
;---------------------------------------------------------------- |
/kernel/branches/flat_kernel/boot/bootcode.inc |
---|
301,36 → 301,17 |
push 0 |
pop es |
mov [es:0x9040], ebx |
mov [es:0x9050], ax |
mov [es:0x9052], cx |
mov [es:0x9040], dx |
mov [es:0x9054], dx |
; init selectors |
; movzx eax, ax ; real-mode segment base address of protected-mode 32-bit code segment |
; shl eax, 4 |
; mov [dword apm_code_32 + 2], ax |
; shr eax, 16 |
; mov [dword apm_code_32 + 4], al |
; movzx ecx, cx ; real-mode segment base address of protected-mode 16-bit code segment |
; shl ecx, 4 |
; mov [dword apm_code_16 + 2], cx |
; shr ecx, 16 |
; mov [dword apm_code_16 + 4], cl |
; movzx edx, dx ; real-mode segment base address of protected-mode 16-bit data segment |
; shl edx, 4 |
; mov [dword apm_data_16 + 2], dx |
; shr edx, 16 |
; mov [dword apm_data_16 + 4], dl |
; mov [es : 0x9040], ebx ; offset of APM entry point |
apm_end: |
; ----------------------------------------- |
; DISPLAY VESA INFORMATION |
push 0 |
pop es |
mov ax,0x4f00 |
mov di,0xa000 |
int 0x10 |
/kernel/branches/flat_kernel/const.inc |
---|
276,9 → 276,22 |
twdw equ (CURRENT_TASK-window_data) |
std_application_base_address equ new_app_base |
RING0_STACK_SIZE equ 0x2000 - 512 ;512 áàéò äëÿ êîíòåêñòà FPU |
RING0_STACK_SIZE equ (0x2000 - 512) ;512 áàéò äëÿ êîíòåêñòà FPU |
;PAGES_USED equ 4 |
REG_SS equ (RING0_STACK_SIZE-4) |
REG_ESP equ (RING0_STACK_SIZE-8) |
REG_EFLAGS equ (RING0_STACK_SIZE-12) |
REG_CS equ (RING0_STACK_SIZE-16) |
REG_EIP equ (RING0_STACK_SIZE-20) |
REG_EAX equ (RING0_STACK_SIZE-24) |
REG_ECX equ (RING0_STACK_SIZE-28) |
REG_EDX equ (RING0_STACK_SIZE-32) |
REG_EBX equ (RING0_STACK_SIZE-36) |
REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20 |
REG_EBP equ (RING0_STACK_SIZE-44) |
REG_ESI equ (RING0_STACK_SIZE-48) |
REG_EDI equ (RING0_STACK_SIZE-52) |
REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return |
PG_UNMAP equ 0x000 |
PG_MAP equ 0x001 |
/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 |
/kernel/branches/flat_kernel/data32.inc |
---|
149,7 → 149,7 |
dw 0 |
db 0 |
db cpl3 |
dw G32+D32+(new_app_base shr 16)+0x7; |
dw G32+D32+(new_app_base shr 16)+0xF; |
app_data_l: |
dw 0xFFFF |
156,7 → 156,7 |
dw 0 |
db 0 |
db drw3 |
dw G32+D32+(new_app_base shr 16)+0x7; |
dw G32+D32+(new_app_base shr 16)+0xF; |
; --------------- APM --------------------- |
apm_code_32: |
/kernel/branches/flat_kernel/drivers/ensoniq.asm |
---|
251,9 → 251,9 |
EVENT_NOTIFY equ 0x00000200 |
OS_BASE equ 0; |
OS_BASE equ 0x80000000 |
SLOT_BASE equ OS_BASE+0x0080000 |
new_app_base equ 0x80000000 |
new_app_base equ 0 |
public START |
public service_proc |
385,7 → 385,6 |
cmp eax, DEV_GET_MASTERVOL |
jne @F |
mov ebx, [edi+output] |
add ebx, new_app_base |
stdcall get_master_vol, ebx |
ret |
;@@: |
/kernel/branches/flat_kernel/drivers/infinity.asm |
---|
376,17 → 376,17 |
; ring and waveout |
mov eax, 0x10000 |
mov ebx, 0x10000 |
test [format], PCM_RING |
jz .waveout |
mov eax, [eax+STREAM.r_size] |
add eax, 4095 |
and eax, -4096 |
add eax, eax |
mov ebx, [eax+STREAM.r_size] |
add ebx, 4095 |
and ebx, -4096 |
add ebx, ebx |
.waveout: |
mov [ring_size], eax |
mov ebx, eax |
mov [ring_size], ebx |
mov eax, ebx |
shr ebx, 12 |
mov [ring_pages], ebx |
/kernel/branches/flat_kernel/drivers/sound.asm |
---|
351,6 → 351,7 |
jnc .fail |
stdcall AttachIntHandler, ebx, ac97_irq |
.reg: |
stdcall RegService, sz_sound_srv, service_proc |
ret |
.fail: |
/kernel/branches/flat_kernel/fs/fat12.inc |
---|
2576,7 → 2576,7 |
mov ebx, [ebx+4] |
test ebx, ebx |
jz @f |
add ebx, std_application_base_address |
; add ebx, std_application_base_address |
@@: |
;---------------------------------------------------------------- |
/kernel/branches/flat_kernel/fs/fat32.inc |
---|
3263,7 → 3263,7 |
mov ebx, [ebx+4] |
test ebx, ebx |
jz @f |
add ebx, std_application_base_address |
; add ebx, std_application_base_address |
@@: |
;---------------------------------------------------------------- |
/kernel/branches/flat_kernel/fs/fs.inc |
---|
80,7 → 80,7 |
; \end{diamond}[18.03.2006] |
; Extract parameters |
add eax, std_application_base_address ; abs start of info block |
; add eax, std_application_base_address ; abs start of info block |
cmp dword [eax+0],15 ; GET_DISK_INFO |
je fs_info |
91,7 → 91,7 |
cmp dword [eax+0],1 |
jnz .usual_check |
mov ebx,[eax+12] |
add ebx,std_application_base_address |
; add ebx,std_application_base_address |
mov ecx,[eax+8] |
call check_region |
test eax,eax |
114,7 → 114,7 |
shl ecx,9 |
.small_size: |
mov ebx,[eax+12] |
add ebx,std_application_base_address |
; add ebx,std_application_base_address |
call check_region |
test eax,eax |
jz .error_output |
142,7 → 142,7 |
; \end{diamond}[18.03.2006] |
mov esi,dir0 |
mov edi,[eax+12] |
add edi,std_application_base_address |
; add edi,std_application_base_address |
mov ecx,11 |
push ecx |
; cld ; already is |
196,12 → 196,12 |
push dword [eax+4] ; 512 block number to read |
push dword [eax+8] ; bytes to write/append or 512 blocks to read |
mov ebx,[eax+12] |
add ebx,std_application_base_address |
; add ebx,std_application_base_address |
push ebx ; abs start of return/save area |
lea esi,[eax+20] ; abs start of dir + filename |
mov edi,[eax+16] |
add edi,std_application_base_address ; abs start of work area |
; add edi,std_application_base_address ; abs start of work area |
call expand_pathz |
/kernel/branches/flat_kernel/fs/fs_lfn.inc |
---|
85,7 → 85,7 |
; 8 : delete file |
; 9 : create directory |
add eax, std_application_base_address |
; add eax, std_application_base_address |
; parse file name |
xchg ebx, eax |
lea esi, [ebx+20] |
94,7 → 94,7 |
test al, al |
jnz @f |
mov esi, [esi] |
add esi, std_application_base_address |
; add esi, std_application_base_address |
mov ebp, esi |
lodsb |
@@: |
104,7 → 104,7 |
mov ebx, [ebx+8] |
test ebx, ebx |
jz .l1 |
add ebx, new_app_base |
; add ebx, new_app_base |
.l1: |
call fs_execute ; ebp, ebx, edx |
mov [esp+36], eax |
149,7 → 149,7 |
xor eax, eax |
mov ebp, [ebx+12] |
mov edx, [ebx+16] |
add edx, std_application_base_address |
; add edx, std_application_base_address |
push dword [ebx+4] ; first block |
mov ebx, [ebx+8] ; flags |
mov esi, [edi+4] |
231,7 → 231,7 |
mov esi, virtual_root_query |
mov ebp, [ebx+12] |
mov edx, [ebx+16] |
add edx, std_application_base_address |
; add edx, std_application_base_address |
push dword [ebx+4] ; first block |
mov ebx, [ebx+8] ; flags |
xor eax, eax |
340,7 → 340,7 |
jae .not_impl |
mov ecx, [ebx+12] |
mov edx, [ebx+16] |
add edx, std_application_base_address |
; add edx, std_application_base_address |
add ebx, 4 |
call dword [fs_RamdiskServices + eax*4] |
mov [esp+36], eax |
377,7 → 377,7 |
mov [flp_number], cl |
mov ecx, [ebx+12] |
mov edx, [ebx+16] |
add edx, std_application_base_address |
; add edx, std_application_base_address |
add ebx, 4 |
call dword [fs_FloppyServices + eax*4] |
and [flp_status], 0 |
441,7 → 441,7 |
pop esi ebx |
mov ecx, [ebx+12] |
mov edx, [ebx+16] |
add edx, std_application_base_address |
; add edx, std_application_base_address |
mov eax, [ebx] |
cmp eax, fs_NumHdServices |
jae .not_impl |
517,7 → 517,7 |
@@: |
mov ecx, [ebx+12] |
mov edx, [ebx+16] |
add edx, std_application_base_address |
; add edx, std_application_base_address |
mov eax, [ebx] |
cmp eax,fs_NumCdServices |
jae .not_impl |
/kernel/branches/flat_kernel/fs/iso9660.inc |
---|
499,7 → 499,7 |
mov ebx, [ebx+4] |
test ebx, ebx |
jz @f |
add ebx, std_application_base_address |
; add ebx, std_application_base_address |
@@: |
;---------------------------------------------------------------- |
/kernel/branches/flat_kernel/kernel.asm |
---|
227,16 → 227,40 |
mov dword [sys_pgdir+8], 0 |
mov eax, cr3 |
mov cr3, eax |
mov cr3, eax ; flush TLB |
; SAVE REAL MODE VARIABLES |
mov ax, [BOOT_VAR + 0x9031] |
mov [IDEContrRegsBaseAddr], ax |
; --------------- APM --------------------- |
; mov eax, [BOOT_VAR + 0x9040] ; entry point |
; mov dword[apm_entry], eax |
; mov word [apm_entry + 4], apm_code_32 - gdts |
; init selectors |
mov ebx, [BOOT_VAR+0x9040] ; offset of APM entry point |
movzx eax, word [BOOT_VAR+0x9050] ; real-mode segment base address of |
; protected-mode 32-bit code segment |
movzx ecx, word [BOOT_VAR+0x9052] ; real-mode segment base address of |
; protected-mode 16-bit code segment |
movzx edx, word [BOOT_VAR+0x9054] ; real-mode segment base address of |
; protected-mode 16-bit data segment |
shl eax, 4 |
mov [dword apm_code_32 + 2], ax |
shr eax, 16 |
mov [dword apm_code_32 + 4], al |
shl ecx, 4 |
mov [dword apm_code_16 + 2], cx |
shr ecx, 16 |
mov [dword apm_code_16 + 4], cl |
shl edx, 4 |
mov [dword apm_data_16 + 2], dx |
shr edx, 16 |
mov [dword apm_data_16 + 4], dl |
mov dword[apm_entry], ebx |
mov word [apm_entry + 4], apm_code_32 - gdts |
mov eax, [BOOT_VAR + 0x9044] ; version & flags |
mov [apm_vf], eax |
; ----------------------------------------- |
1711,9 → 1735,9 |
ret |
app_load_cursor: |
add ebx, new_app_base |
cmp ebx, new_app_base |
jb msset |
; add ebx, new_app_base |
cmp ebx, OS_BASE |
jae msset |
stdcall load_cursor, ebx, ecx |
mov [esp+36], eax |
ret |
3942,7 → 3966,7 |
mov edx,ecx |
mov ecx,ebx |
lea ebx, [eax+std_application_base_address] |
mov ebx, eax |
sys_putimage: |
test ecx,0x80008000 |
3984,11 → 4008,11 |
jmp [draw_pointer] |
syscall_putimage_palette: |
lea edi, [esi+std_application_base_address] |
mov edi, esi |
mov esi, edx |
mov edx, ecx |
mov ecx, ebx |
lea ebx, [eax+std_application_base_address] |
mov ebx, eax |
sys_putimage_palette: |
; ebx = pointer to image |
; ecx = [xsize]*65536 + [ysize] |
4840,7 → 4864,8 |
mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported |
ret |
@@: xchg eax, ecx |
@@: |
xchg eax, ecx |
xchg ebx, ecx |
cmp al, 3 |
4852,7 → 4877,22 |
mov [esp + 32], eax |
ret |
@@: call pword [apm_entry] ; call APM BIOS |
@@: |
mov esi, [master_tab+(OS_BASE shr 20)] |
xchg [master_tab], esi |
push esi |
mov edi, cr3 |
mov cr3, edi ;flush TLB |
call pword [apm_entry] ; call APM BIOS |
xchg eax, [esp] |
mov [master_tab], eax |
mov eax, cr3 |
mov cr3, eax |
pop eax |
mov [esp + 8 ], edi |
mov [esp + 12], esi |
mov [esp + 24], ebx |
4862,6 → 4902,8 |
setc al |
and [esp + 56], byte 0xfe |
or [esp + 56], al |
ret |
; ----------------------------------------- |
4880,15 → 4922,6 |
ret |
@@: |
call stop_all_services |
push eax |
push edx |
mov edx, 0x400 ;bocsh |
mov al,0xff ;bocsh |
out dx, al ;bocsh |
pop edx |
pop eax |
push 3 ; stop playing cd |
pop eax |
call sys_cd_audio |
/kernel/branches/flat_kernel/memmap.inc |
---|
24,10 → 24,8 |
; |
; Runtime: |
; |
; 0x00000000 -> 0x7FBFFFFF application 2Gb-4Mb |
; 0x7FC00000 -> 0x7FFFFFFF page tables 4Mb |
; 0x00000000 -> 0x7FFFFFFF application 2Gb |
; 0x80000000 -> 1FFF window_data - 256 entries |
; |
; 0000 dword x start |
229,8 → 227,9 |
; |
; 0x8098B000 -> kernel heap |
; 0x81FFFFFF heap min limit |
; 0xFDFFFFFF heap max limit |
; 0xFDBFFFFF heap max limit |
; 0xFDC00000 -> 0xFDFFFFFF page tables 4Mb |
; 0xFE000000 -> 0xFFFFFFFF LFB 32Mb |
; 0xFE000000 -> 0xFE7FFFFF application available LFB 8Mb |
; 0xFE800000 -> 0xFFFFFFFF kernel LFB part 24 Mb |
/kernel/branches/flat_kernel/network/socket.inc |
---|
592,7 → 592,7 |
.startcopy: |
mov edi, ecx ; |
add edi, std_application_base_address ; get data pointer to buffer in application |
; add edi, std_application_base_address ; get data pointer to buffer in application |
mov esi, ebx ; |
add esi, SOCKETHEADERSIZE ; we dont need to copy the header |