forked from KolibriOS/kolibrios
flat kernel
git-svn-id: svn://kolibrios.org@419 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
4c9dc158c8
commit
5f84f102c5
@ -2292,7 +2292,7 @@ fs_RamdiskExecute:
|
|||||||
mov ebx, [ebx+4]
|
mov ebx, [ebx+4]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz @f
|
jz @f
|
||||||
add ebx, std_application_base_address
|
; add ebx, std_application_base_address
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
|
@ -301,36 +301,17 @@ wait_loop: ; variant 2
|
|||||||
push 0
|
push 0
|
||||||
pop es
|
pop es
|
||||||
|
|
||||||
|
mov [es:0x9040], ebx
|
||||||
mov [es:0x9050], ax
|
mov [es:0x9050], ax
|
||||||
mov [es:0x9052], cx
|
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:
|
apm_end:
|
||||||
; -----------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
; DISPLAY VESA INFORMATION
|
; DISPLAY VESA INFORMATION
|
||||||
|
push 0
|
||||||
|
pop es
|
||||||
|
|
||||||
push 0
|
|
||||||
pop es
|
|
||||||
mov ax,0x4f00
|
mov ax,0x4f00
|
||||||
mov di,0xa000
|
mov di,0xa000
|
||||||
int 0x10
|
int 0x10
|
||||||
|
@ -276,9 +276,22 @@ new_app_base equ 0; 0x01000000
|
|||||||
twdw equ (CURRENT_TASK-window_data)
|
twdw equ (CURRENT_TASK-window_data)
|
||||||
|
|
||||||
std_application_base_address equ new_app_base
|
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_UNMAP equ 0x000
|
||||||
PG_MAP equ 0x001
|
PG_MAP equ 0x001
|
||||||
|
@ -115,7 +115,7 @@ debug_getcontext:
|
|||||||
; destroys eax,ecx,edx,esi,edi
|
; destroys eax,ecx,edx,esi,edi
|
||||||
cmp ecx, 28h
|
cmp ecx, 28h
|
||||||
jnz .ret
|
jnz .ret
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
push ebx
|
push ebx
|
||||||
mov ebx, edx
|
mov ebx, edx
|
||||||
call check_region
|
call check_region
|
||||||
@ -174,7 +174,7 @@ debug_setcontext:
|
|||||||
; destroys eax,ecx,edx,esi,edi
|
; destroys eax,ecx,edx,esi,edi
|
||||||
cmp ecx, 28h
|
cmp ecx, 28h
|
||||||
jnz .ret
|
jnz .ret
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
push ebx
|
push ebx
|
||||||
mov ebx, edx
|
mov ebx, edx
|
||||||
call check_region
|
call check_region
|
||||||
@ -230,7 +230,7 @@ debug_set_drx:
|
|||||||
lea eax, [eax*8+SLOT_BASE+APPDATA.dbg_regs]
|
lea eax, [eax*8+SLOT_BASE+APPDATA.dbg_regs]
|
||||||
; [eax]=dr0, [eax+4]=dr1, [eax+8]=dr2, [eax+C]=dr3
|
; [eax]=dr0, [eax+4]=dr1, [eax+8]=dr2, [eax+C]=dr3
|
||||||
; [eax+10]=dr7
|
; [eax+10]=dr7
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
jc .errret
|
jc .errret
|
||||||
cmp cl, 3
|
cmp cl, 3
|
||||||
ja .errret
|
ja .errret
|
||||||
@ -302,7 +302,7 @@ debug_read_process_memory:
|
|||||||
; edx=address in debuggee
|
; edx=address in debuggee
|
||||||
; out: [esp+36]=sizeof(read)
|
; out: [esp+36]=sizeof(read)
|
||||||
; destroys all
|
; destroys all
|
||||||
add esi, std_application_base_address
|
; add esi, std_application_base_address
|
||||||
push ebx
|
push ebx
|
||||||
mov ebx, esi
|
mov ebx, esi
|
||||||
call check_region
|
call check_region
|
||||||
@ -329,7 +329,7 @@ debug_write_process_memory:
|
|||||||
; edx=address in debuggee
|
; edx=address in debuggee
|
||||||
; out: [esp+36]=sizeof(write)
|
; out: [esp+36]=sizeof(write)
|
||||||
; destroys all
|
; destroys all
|
||||||
add esi, std_application_base_address
|
; add esi, std_application_base_address
|
||||||
push ebx
|
push ebx
|
||||||
mov ebx, esi
|
mov ebx, esi
|
||||||
call check_region
|
call check_region
|
||||||
|
@ -249,7 +249,7 @@ align 4
|
|||||||
srv_handlerEx:
|
srv_handlerEx:
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz .fail
|
jz .fail
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
|
|
||||||
mov eax, [ebx+handle]
|
mov eax, [ebx+handle]
|
||||||
cmp [eax+SRV.magic], ' SRV'
|
cmp [eax+SRV.magic], ' SRV'
|
||||||
@ -258,8 +258,8 @@ srv_handlerEx:
|
|||||||
cmp [eax+SRV.size], SRV_SIZE
|
cmp [eax+SRV.size], SRV_SIZE
|
||||||
jne .fail
|
jne .fail
|
||||||
|
|
||||||
add [ebx+input], new_app_base
|
; add [ebx+input], new_app_base
|
||||||
add [ebx+output], new_app_base
|
; add [ebx+output], new_app_base
|
||||||
|
|
||||||
stdcall [eax+SRV.srv_proc], ebx
|
stdcall [eax+SRV.srv_proc], ebx
|
||||||
ret
|
ret
|
||||||
@ -401,9 +401,9 @@ proc get_fileinfo stdcall, file_name:dword, info:dword
|
|||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov ebx, [file_name]
|
mov ebx, [file_name]
|
||||||
sub ebx, new_app_base
|
; sub ebx, new_app_base
|
||||||
mov ecx, [info]
|
mov ecx, [info]
|
||||||
sub ecx, new_app_base
|
; sub ecx, new_app_base
|
||||||
|
|
||||||
mov [cmd], 5
|
mov [cmd], 5
|
||||||
mov [offset], eax
|
mov [offset], eax
|
||||||
@ -415,7 +415,7 @@ proc get_fileinfo stdcall, file_name:dword, info:dword
|
|||||||
|
|
||||||
mov eax, 70
|
mov eax, 70
|
||||||
lea ebx, [cmd]
|
lea ebx, [cmd]
|
||||||
sub ebx, new_app_base
|
; sub ebx, new_app_base
|
||||||
int 0x40
|
int 0x40
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
@ -438,8 +438,8 @@ proc read_file stdcall,file_name:dword, buffer:dword, off:dword,\
|
|||||||
mov ecx, [off]
|
mov ecx, [off]
|
||||||
mov edx, [bytes]
|
mov edx, [bytes]
|
||||||
mov esi, [buffer]
|
mov esi, [buffer]
|
||||||
sub ebx, new_app_base
|
; sub ebx, new_app_base
|
||||||
sub esi, new_app_base
|
; sub esi, new_app_base
|
||||||
|
|
||||||
mov [cmd], eax
|
mov [cmd], eax
|
||||||
mov [offset], ecx
|
mov [offset], ecx
|
||||||
@ -451,7 +451,7 @@ proc read_file stdcall,file_name:dword, buffer:dword, off:dword,\
|
|||||||
|
|
||||||
mov eax, 70
|
mov eax, 70
|
||||||
lea ebx, [cmd]
|
lea ebx, [cmd]
|
||||||
sub ebx, new_app_base
|
; sub ebx, new_app_base
|
||||||
int 0x40
|
int 0x40
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
@ -907,13 +907,13 @@ proc load_library stdcall, file_name:dword
|
|||||||
jmp .next
|
jmp .next
|
||||||
.copy:
|
.copy:
|
||||||
add esi, edx
|
add esi, edx
|
||||||
add edi, new_app_base
|
; add edi, new_app_base
|
||||||
mov ecx, [eax+CFS.SizeOfRawData]
|
mov ecx, [eax+CFS.SizeOfRawData]
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
.next:
|
.next:
|
||||||
add edi, 15-new_app_base
|
add edi, 15 ;-new_app_base
|
||||||
and edi, not 15
|
and edi, -16
|
||||||
add eax, COFF_SECTION_SIZE
|
add eax, COFF_SECTION_SIZE
|
||||||
dec ebx
|
dec ebx
|
||||||
jnz @B
|
jnz @B
|
||||||
|
@ -193,7 +193,7 @@ except_16: ;fpu native exceptions handler
|
|||||||
mov ecx, [reg_eip]
|
mov ecx, [reg_eip]
|
||||||
mov edx, [reg_esp]
|
mov edx, [reg_esp]
|
||||||
sub edx, 4
|
sub edx, 4
|
||||||
mov [ss:edx+new_app_base], ecx
|
mov [ss:edx], ecx
|
||||||
mov [reg_esp], edx
|
mov [reg_esp], edx
|
||||||
mov dword [reg_eip], eax
|
mov dword [reg_eip], eax
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ except_19: ;sse exceptions handler
|
|||||||
mov ecx, [reg_eip]
|
mov ecx, [reg_eip]
|
||||||
mov edx, [reg_esp]
|
mov edx, [reg_esp]
|
||||||
sub edx, 4
|
sub edx, 4
|
||||||
mov [ss:edx+new_app_base], ecx
|
mov [ss:edx], ecx
|
||||||
mov [reg_esp], edx
|
mov [reg_esp], edx
|
||||||
mov dword [reg_eip], eax
|
mov dword [reg_eip], eax
|
||||||
|
|
||||||
|
@ -632,7 +632,7 @@ proc init_heap
|
|||||||
mov [SLOT_BASE+APPDATA.heap_top+ebx], eax
|
mov [SLOT_BASE+APPDATA.heap_top+ebx], eax
|
||||||
|
|
||||||
sub eax, esi
|
sub eax, esi
|
||||||
add esi, new_app_base
|
; add esi, new_app_base
|
||||||
shr esi, 10
|
shr esi, 10
|
||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
sub eax, 4096
|
sub eax, 4096
|
||||||
@ -655,8 +655,8 @@ proc user_alloc stdcall, alloc_size:dword
|
|||||||
shl ebx, 8
|
shl ebx, 8
|
||||||
mov esi, dword [ebx+SLOT_BASE+APPDATA.heap_base]; heap_base
|
mov esi, dword [ebx+SLOT_BASE+APPDATA.heap_base]; heap_base
|
||||||
mov edi, dword [ebx+SLOT_BASE+APPDATA.heap_top]; heap_top
|
mov edi, dword [ebx+SLOT_BASE+APPDATA.heap_top]; heap_top
|
||||||
add esi, new_app_base
|
; add esi, new_app_base
|
||||||
add edi, new_app_base
|
; add edi, new_app_base
|
||||||
l_0:
|
l_0:
|
||||||
cmp esi, edi
|
cmp esi, edi
|
||||||
jae m_exit
|
jae m_exit
|
||||||
@ -700,7 +700,7 @@ l_0:
|
|||||||
|
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
add eax, 4096
|
add eax, 4096
|
||||||
sub eax, new_app_base
|
; sub eax, new_app_base
|
||||||
ret
|
ret
|
||||||
m_next:
|
m_next:
|
||||||
add esi, eax
|
add esi, eax
|
||||||
@ -757,8 +757,8 @@ proc user_free stdcall, base:dword
|
|||||||
sub ebx, [edx+SLOT_BASE+APPDATA.mem_size]
|
sub ebx, [edx+SLOT_BASE+APPDATA.mem_size]
|
||||||
neg ebx
|
neg ebx
|
||||||
call update_mem_size
|
call update_mem_size
|
||||||
add esi, new_app_base
|
; add esi, new_app_base
|
||||||
add edi, new_app_base
|
; add edi, new_app_base
|
||||||
shr esi, 12
|
shr esi, 12
|
||||||
shr edi, 12
|
shr edi, 12
|
||||||
@@:
|
@@:
|
||||||
|
@ -340,8 +340,8 @@ proc new_mem_resize stdcall, new_size:dword
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.expand:
|
.expand:
|
||||||
add edi, new_app_base
|
; add edi, new_app_base
|
||||||
add esi, new_app_base
|
; add esi, new_app_base
|
||||||
|
|
||||||
push esi
|
push esi
|
||||||
push edi
|
push edi
|
||||||
@ -457,13 +457,13 @@ proc page_fault_handler
|
|||||||
|
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
push eax
|
; push eax
|
||||||
push edx
|
; push edx
|
||||||
mov edx, 0x400 ;bocsh
|
; mov edx, 0x400 ;bocsh
|
||||||
mov al,0xff ;bocsh
|
; mov al,0xff ;bocsh
|
||||||
out dx, al ;bocsh
|
; out dx, al ;bocsh
|
||||||
pop edx
|
; pop edx
|
||||||
pop eax
|
; pop eax
|
||||||
|
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
mov eax, cr2
|
mov eax, cr2
|
||||||
@ -478,37 +478,48 @@ proc page_fault_handler
|
|||||||
inc [pg_data.pages_faults]
|
inc [pg_data.pages_faults]
|
||||||
|
|
||||||
mov ebx, [.err_addr]
|
mov ebx, [.err_addr]
|
||||||
|
mov eax, [.err_code]
|
||||||
|
|
||||||
cmp ebx, 0x80000000
|
cmp ebx, OS_BASE
|
||||||
jae .kernel_space
|
jb .user_space ;страница в памяти приложени
|
||||||
|
|
||||||
cmp ebx, page_tabs+0x200000
|
cmp ebx, page_tabs
|
||||||
jae .tab_space
|
jb .kernel_space ;страница в памяти ядра
|
||||||
|
|
||||||
cmp ebx, app_page_tabs
|
cmp ebx, kernel_tabs
|
||||||
jae .alloc
|
jb .alloc;.app_tabs ;таблицы страниц приложени
|
||||||
|
;просто создадим одну
|
||||||
|
|
||||||
cmp ebx, 0x7DC00000
|
cmp ebx, LFB_BASE
|
||||||
jae .lfb_addr
|
jb .core_tabs ;таблицы страниц ядра
|
||||||
|
;Ошибка
|
||||||
; cmp ebx, 0x1000000
|
.lfb:
|
||||||
; jb .exit
|
;область LFB
|
||||||
|
;Ошибка
|
||||||
|
jmp .fail
|
||||||
|
|
||||||
|
align 4
|
||||||
.user_space:
|
.user_space:
|
||||||
|
test eax, PG_MAP
|
||||||
|
jnz .err_access ;Страница присутствует
|
||||||
|
;Ошибка доступа ?
|
||||||
|
|
||||||
shr ebx, 12
|
shr ebx, 12
|
||||||
mov ecx, ebx
|
mov ecx, ebx
|
||||||
shr ecx, 10
|
shr ecx, 10
|
||||||
mov edx, [master_tab+ecx*4]
|
mov edx, [master_tab+ecx*4]
|
||||||
test edx, 1
|
test edx, PG_MAP
|
||||||
jz .fail
|
jz .fail ;таблица страниц не создана
|
||||||
|
;неверный адрес в программе
|
||||||
|
|
||||||
mov eax, [page_tabs+ebx*4]
|
mov eax, [page_tabs+ebx*4]
|
||||||
test eax, 2
|
test eax, 2
|
||||||
jz .fail
|
jz .fail ;адрес не зарезервирован дл
|
||||||
|
;использования. Ошибка
|
||||||
.alloc:
|
.alloc:
|
||||||
call alloc_page
|
call alloc_page
|
||||||
and eax, eax
|
and eax, eax
|
||||||
jz .exit
|
jz .fail
|
||||||
|
|
||||||
stdcall map_page,[ebp-4],eax,dword PG_UW
|
stdcall map_page,[ebp-4],eax,dword PG_UW
|
||||||
|
|
||||||
@ -525,6 +536,26 @@ proc page_fault_handler
|
|||||||
popad
|
popad
|
||||||
add esp, 4
|
add esp, 4
|
||||||
iretd
|
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:
|
.fail:
|
||||||
pop es
|
pop es
|
||||||
pop ds
|
pop ds
|
||||||
@ -539,30 +570,30 @@ proc page_fault_handler
|
|||||||
jmp exc_c
|
jmp exc_c
|
||||||
iretd
|
iretd
|
||||||
|
|
||||||
.kernel_space:
|
;.kernel_space:
|
||||||
; shr ebx, 12
|
; shr ebx, 12
|
||||||
; mov eax, [page_tabs+ebx*4]
|
; mov eax, [page_tabs+ebx*4]
|
||||||
; shr ebx, 10
|
; shr ebx, 10
|
||||||
; mov eax, [master_tab+ebx*4]
|
; mov eax, [master_tab+ebx*4]
|
||||||
jmp .exit
|
jmp .exit
|
||||||
.old_addr:
|
;.old_addr:
|
||||||
; shr ebx, 12
|
; shr ebx, 12
|
||||||
; mov eax, [page_tabs+ebx*4]
|
; mov eax, [page_tabs+ebx*4]
|
||||||
; shr ebx, 10
|
; shr ebx, 10
|
||||||
; mov eax, [master_tab+ebx*4]
|
; mov eax, [master_tab+ebx*4]
|
||||||
jmp .exit
|
jmp .exit
|
||||||
.lfb_addr:
|
;.lfb_addr:
|
||||||
; shr ebx, 22
|
; shr ebx, 22
|
||||||
; ;mov ecx, [sys_page_dir]
|
; ;mov ecx, [sys_page_dir]
|
||||||
; mov eax, [master_tab+ebx*4]
|
; mov eax, [master_tab+ebx*4]
|
||||||
jmp .exit
|
jmp .exit
|
||||||
.tab_space:
|
;.tab_space:
|
||||||
; shr ebx, 12
|
; shr ebx, 12
|
||||||
; mov eax, [page_tabs+ebx*4]
|
; mov eax, [page_tabs+ebx*4]
|
||||||
; shr ebx, 10
|
; shr ebx, 10
|
||||||
; ;mov ecx, [sys_page_dir]
|
; ;mov ecx, [sys_page_dir]
|
||||||
; mov eax, [master_tab+ebx*4]
|
; mov eax, [master_tab+ebx*4]
|
||||||
jmp .exit
|
; jmp .exit
|
||||||
endp
|
endp
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@ -706,7 +737,7 @@ proc set_ipc_buff
|
|||||||
mov [eax+0xA0],ebx ;set fields in extended information area
|
mov [eax+0xA0],ebx ;set fields in extended information area
|
||||||
mov [eax+0xA4],ecx
|
mov [eax+0xA4],ecx
|
||||||
|
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
add ecx, ebx
|
add ecx, ebx
|
||||||
add ecx, 4095
|
add ecx, 4095
|
||||||
and ecx, not 4095
|
and ecx, not 4095
|
||||||
@ -743,7 +774,7 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
|
|||||||
jz .no_ipc_area
|
jz .no_ipc_area
|
||||||
|
|
||||||
mov ebx, edi
|
mov ebx, edi
|
||||||
add edi, new_app_base
|
; add edi, new_app_base
|
||||||
and ebx, 0xFFF
|
and ebx, 0xFFF
|
||||||
mov [dst_offset], ebx
|
mov [dst_offset], ebx
|
||||||
|
|
||||||
@ -777,7 +808,7 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
|
|||||||
mov [edi+4], ecx
|
mov [edi+4], ecx
|
||||||
add edi, 8
|
add edi, 8
|
||||||
mov esi, [msg_addr]
|
mov esi, [msg_addr]
|
||||||
add esi, new_app_base
|
; add esi, new_app_base
|
||||||
cld
|
cld
|
||||||
rep movsb
|
rep movsb
|
||||||
|
|
||||||
@ -835,9 +866,9 @@ endp
|
|||||||
align 4
|
align 4
|
||||||
sysfn_meminfo:
|
sysfn_meminfo:
|
||||||
|
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
cmp ebx, new_app_base
|
cmp ebx, OS_BASE
|
||||||
jb .fail
|
jae .fail
|
||||||
|
|
||||||
mov eax, [pg_data.pages_count]
|
mov eax, [pg_data.pages_count]
|
||||||
mov [ebx], eax
|
mov [ebx], eax
|
||||||
@ -883,16 +914,16 @@ new_services:
|
|||||||
@@:
|
@@:
|
||||||
cmp eax, 13
|
cmp eax, 13
|
||||||
ja @f
|
ja @f
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
stdcall user_free, ebx
|
stdcall user_free, ebx
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
cmp eax, 14
|
cmp eax, 14
|
||||||
ja @f
|
ja @f
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
cmp ebx, new_app_base
|
cmp ebx, OS_BASE
|
||||||
jb .fail
|
jae .fail
|
||||||
stdcall get_event_ex, ebx, ecx
|
stdcall get_event_ex, ebx, ecx
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
ret
|
ret
|
||||||
@ -911,9 +942,9 @@ new_services:
|
|||||||
|
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz .fail
|
jz .fail
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
cmp ebx, new_app_base
|
cmp ebx, OS_BASE
|
||||||
jb .fail
|
jae .fail
|
||||||
stdcall get_service, ebx
|
stdcall get_service, ebx
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
ret
|
ret
|
||||||
@ -935,9 +966,9 @@ new_services:
|
|||||||
@@:
|
@@:
|
||||||
cmp eax, 19
|
cmp eax, 19
|
||||||
ja .fail
|
ja .fail
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
cmp ebx, new_app_base
|
cmp ebx, OS_BASE
|
||||||
jb .fail
|
jae .fail
|
||||||
stdcall load_library, ebx
|
stdcall load_library, ebx
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
ret
|
ret
|
||||||
|
@ -206,7 +206,7 @@ else
|
|||||||
jna @F
|
jna @F
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
add edi, new_app_base
|
; add edi, new_app_base
|
||||||
cld
|
cld
|
||||||
rep stosb
|
rep stosb
|
||||||
@@:
|
@@:
|
||||||
@ -733,7 +733,7 @@ proc read_process_memory
|
|||||||
mov eax, [slot]
|
mov eax, [slot]
|
||||||
shl eax,8
|
shl eax,8
|
||||||
mov ebx, [offset]
|
mov ebx, [offset]
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
push ecx
|
push ecx
|
||||||
stdcall map_memEx, [proc_mem_map],\
|
stdcall map_memEx, [proc_mem_map],\
|
||||||
[SLOT_BASE+eax+0xB8],\
|
[SLOT_BASE+eax+0xB8],\
|
||||||
@ -799,7 +799,7 @@ proc write_process_memory
|
|||||||
mov eax, [slot]
|
mov eax, [slot]
|
||||||
shl eax,8
|
shl eax,8
|
||||||
mov ebx, [offset]
|
mov ebx, [offset]
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
push ecx
|
push ecx
|
||||||
stdcall map_memEx, [proc_mem_map],\
|
stdcall map_memEx, [proc_mem_map],\
|
||||||
[SLOT_BASE+eax+0xB8],\
|
[SLOT_BASE+eax+0xB8],\
|
||||||
@ -879,6 +879,8 @@ proc new_sys_threads
|
|||||||
rep stosd ;clean extended information about new thread
|
rep stosd ;clean extended information about new thread
|
||||||
mov esi,ebx
|
mov esi,ebx
|
||||||
mov edi,edx
|
mov edi,edx
|
||||||
|
mov byte [edi], '@'
|
||||||
|
inc edi
|
||||||
mov ecx,11
|
mov ecx,11
|
||||||
rep movsb ;copy process name
|
rep movsb ;copy process name
|
||||||
|
|
||||||
@ -991,7 +993,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
|||||||
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8]
|
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8]
|
||||||
ja @f
|
ja @f
|
||||||
|
|
||||||
add edx, new_app_base
|
; add edx, new_app_base
|
||||||
stdcall k_strncpy, edx, [cmd_line], 256
|
stdcall k_strncpy, edx, [cmd_line], 256
|
||||||
@@:
|
@@:
|
||||||
mov edx,[params]
|
mov edx,[params]
|
||||||
@ -1003,7 +1005,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
|||||||
jc @f
|
jc @f
|
||||||
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8]
|
cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8]
|
||||||
ja @f
|
ja @f
|
||||||
add edx, new_app_base
|
; add edx, new_app_base
|
||||||
stdcall k_strncpy, edx, [app_path], 1024
|
stdcall k_strncpy, edx, [app_path], 1024
|
||||||
@@:
|
@@:
|
||||||
mov ebx,[slot]
|
mov ebx,[slot]
|
||||||
@ -1056,7 +1058,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
|||||||
mov [edi+TSS._eip],eax ;set eip in TSS
|
mov [edi+TSS._eip],eax ;set eip in TSS
|
||||||
mov eax, [esi+0x0C] ;app_esp
|
mov eax, [esi+0x0C] ;app_esp
|
||||||
mov [edi+TSS._esp],eax ;set stack in TSS
|
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._cs],app_code ;selector of code segment
|
||||||
mov [edi+TSS._ss],app_data
|
mov [edi+TSS._ss],app_data
|
||||||
|
@ -149,14 +149,14 @@ app_code_l:
|
|||||||
dw 0
|
dw 0
|
||||||
db 0
|
db 0
|
||||||
db cpl3
|
db cpl3
|
||||||
dw G32+D32+(new_app_base shr 16)+0x7;
|
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||||
|
|
||||||
app_data_l:
|
app_data_l:
|
||||||
dw 0xFFFF
|
dw 0xFFFF
|
||||||
dw 0
|
dw 0
|
||||||
db 0
|
db 0
|
||||||
db drw3
|
db drw3
|
||||||
dw G32+D32+(new_app_base shr 16)+0x7;
|
dw G32+D32+(new_app_base shr 16)+0xF;
|
||||||
|
|
||||||
; --------------- APM ---------------------
|
; --------------- APM ---------------------
|
||||||
apm_code_32:
|
apm_code_32:
|
||||||
|
@ -251,9 +251,9 @@ end virtual
|
|||||||
|
|
||||||
EVENT_NOTIFY equ 0x00000200
|
EVENT_NOTIFY equ 0x00000200
|
||||||
|
|
||||||
OS_BASE equ 0;
|
OS_BASE equ 0x80000000
|
||||||
SLOT_BASE equ OS_BASE+0x0080000
|
SLOT_BASE equ OS_BASE+0x0080000
|
||||||
new_app_base equ 0x80000000
|
new_app_base equ 0
|
||||||
|
|
||||||
public START
|
public START
|
||||||
public service_proc
|
public service_proc
|
||||||
@ -385,7 +385,6 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
cmp eax, DEV_GET_MASTERVOL
|
cmp eax, DEV_GET_MASTERVOL
|
||||||
jne @F
|
jne @F
|
||||||
mov ebx, [edi+output]
|
mov ebx, [edi+output]
|
||||||
add ebx, new_app_base
|
|
||||||
stdcall get_master_vol, ebx
|
stdcall get_master_vol, ebx
|
||||||
ret
|
ret
|
||||||
;@@:
|
;@@:
|
||||||
|
@ -376,17 +376,17 @@ proc CreateBuffer stdcall, format:dword, size:dword
|
|||||||
|
|
||||||
; ring and waveout
|
; ring and waveout
|
||||||
|
|
||||||
mov eax, 0x10000
|
mov ebx, 0x10000
|
||||||
test [format], PCM_RING
|
test [format], PCM_RING
|
||||||
jz .waveout
|
jz .waveout
|
||||||
|
|
||||||
mov eax, [eax+STREAM.r_size]
|
mov ebx, [eax+STREAM.r_size]
|
||||||
add eax, 4095
|
add ebx, 4095
|
||||||
and eax, -4096
|
and ebx, -4096
|
||||||
add eax, eax
|
add ebx, ebx
|
||||||
.waveout:
|
.waveout:
|
||||||
mov [ring_size], eax
|
mov [ring_size], ebx
|
||||||
mov ebx, eax
|
mov eax, ebx
|
||||||
shr ebx, 12
|
shr ebx, 12
|
||||||
mov [ring_pages], ebx
|
mov [ring_pages], ebx
|
||||||
|
|
||||||
|
@ -351,6 +351,7 @@ proc START stdcall, state:dword
|
|||||||
jnc .fail
|
jnc .fail
|
||||||
|
|
||||||
stdcall AttachIntHandler, ebx, ac97_irq
|
stdcall AttachIntHandler, ebx, ac97_irq
|
||||||
|
.reg:
|
||||||
stdcall RegService, sz_sound_srv, service_proc
|
stdcall RegService, sz_sound_srv, service_proc
|
||||||
ret
|
ret
|
||||||
.fail:
|
.fail:
|
||||||
|
@ -2576,7 +2576,7 @@ fs_FloppyExecute:
|
|||||||
mov ebx, [ebx+4]
|
mov ebx, [ebx+4]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz @f
|
jz @f
|
||||||
add ebx, std_application_base_address
|
; add ebx, std_application_base_address
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
|
@ -3263,7 +3263,7 @@ fs_HdExecute:
|
|||||||
mov ebx, [ebx+4]
|
mov ebx, [ebx+4]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz @f
|
jz @f
|
||||||
add ebx, std_application_base_address
|
; add ebx, std_application_base_address
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
|
@ -80,7 +80,7 @@ file_system:
|
|||||||
; \end{diamond}[18.03.2006]
|
; \end{diamond}[18.03.2006]
|
||||||
|
|
||||||
; Extract parameters
|
; 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
|
cmp dword [eax+0],15 ; GET_DISK_INFO
|
||||||
je fs_info
|
je fs_info
|
||||||
@ -91,7 +91,7 @@ file_system:
|
|||||||
cmp dword [eax+0],1
|
cmp dword [eax+0],1
|
||||||
jnz .usual_check
|
jnz .usual_check
|
||||||
mov ebx,[eax+12]
|
mov ebx,[eax+12]
|
||||||
add ebx,std_application_base_address
|
; add ebx,std_application_base_address
|
||||||
mov ecx,[eax+8]
|
mov ecx,[eax+8]
|
||||||
call check_region
|
call check_region
|
||||||
test eax,eax
|
test eax,eax
|
||||||
@ -114,7 +114,7 @@ endg
|
|||||||
shl ecx,9
|
shl ecx,9
|
||||||
.small_size:
|
.small_size:
|
||||||
mov ebx,[eax+12]
|
mov ebx,[eax+12]
|
||||||
add ebx,std_application_base_address
|
; add ebx,std_application_base_address
|
||||||
call check_region
|
call check_region
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jz .error_output
|
jz .error_output
|
||||||
@ -142,7 +142,7 @@ endg
|
|||||||
; \end{diamond}[18.03.2006]
|
; \end{diamond}[18.03.2006]
|
||||||
mov esi,dir0
|
mov esi,dir0
|
||||||
mov edi,[eax+12]
|
mov edi,[eax+12]
|
||||||
add edi,std_application_base_address
|
; add edi,std_application_base_address
|
||||||
mov ecx,11
|
mov ecx,11
|
||||||
push ecx
|
push ecx
|
||||||
; cld ; already is
|
; cld ; already is
|
||||||
@ -196,12 +196,12 @@ endg
|
|||||||
push dword [eax+4] ; 512 block number to read
|
push dword [eax+4] ; 512 block number to read
|
||||||
push dword [eax+8] ; bytes to write/append or 512 blocks to read
|
push dword [eax+8] ; bytes to write/append or 512 blocks to read
|
||||||
mov ebx,[eax+12]
|
mov ebx,[eax+12]
|
||||||
add ebx,std_application_base_address
|
; add ebx,std_application_base_address
|
||||||
push ebx ; abs start of return/save area
|
push ebx ; abs start of return/save area
|
||||||
|
|
||||||
lea esi,[eax+20] ; abs start of dir + filename
|
lea esi,[eax+20] ; abs start of dir + filename
|
||||||
mov edi,[eax+16]
|
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
|
call expand_pathz
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ file_system_lfn:
|
|||||||
; 8 : delete file
|
; 8 : delete file
|
||||||
; 9 : create directory
|
; 9 : create directory
|
||||||
|
|
||||||
add eax, std_application_base_address
|
; add eax, std_application_base_address
|
||||||
; parse file name
|
; parse file name
|
||||||
xchg ebx, eax
|
xchg ebx, eax
|
||||||
lea esi, [ebx+20]
|
lea esi, [ebx+20]
|
||||||
@ -94,7 +94,7 @@ file_system_lfn:
|
|||||||
test al, al
|
test al, al
|
||||||
jnz @f
|
jnz @f
|
||||||
mov esi, [esi]
|
mov esi, [esi]
|
||||||
add esi, std_application_base_address
|
; add esi, std_application_base_address
|
||||||
mov ebp, esi
|
mov ebp, esi
|
||||||
lodsb
|
lodsb
|
||||||
@@:
|
@@:
|
||||||
@ -104,7 +104,7 @@ file_system_lfn:
|
|||||||
mov ebx, [ebx+8]
|
mov ebx, [ebx+8]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz .l1
|
jz .l1
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
.l1:
|
.l1:
|
||||||
call fs_execute ; ebp, ebx, edx
|
call fs_execute ; ebp, ebx, edx
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
@ -149,7 +149,7 @@ file_system_lfn:
|
|||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov ebp, [ebx+12]
|
mov ebp, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
push dword [ebx+4] ; first block
|
push dword [ebx+4] ; first block
|
||||||
mov ebx, [ebx+8] ; flags
|
mov ebx, [ebx+8] ; flags
|
||||||
mov esi, [edi+4]
|
mov esi, [edi+4]
|
||||||
@ -231,7 +231,7 @@ file_system_lfn:
|
|||||||
mov esi, virtual_root_query
|
mov esi, virtual_root_query
|
||||||
mov ebp, [ebx+12]
|
mov ebp, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
push dword [ebx+4] ; first block
|
push dword [ebx+4] ; first block
|
||||||
mov ebx, [ebx+8] ; flags
|
mov ebx, [ebx+8] ; flags
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -340,7 +340,7 @@ fs_OnRamdisk:
|
|||||||
jae .not_impl
|
jae .not_impl
|
||||||
mov ecx, [ebx+12]
|
mov ecx, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
add ebx, 4
|
add ebx, 4
|
||||||
call dword [fs_RamdiskServices + eax*4]
|
call dword [fs_RamdiskServices + eax*4]
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
@ -377,7 +377,7 @@ fs_OnFloppy:
|
|||||||
mov [flp_number], cl
|
mov [flp_number], cl
|
||||||
mov ecx, [ebx+12]
|
mov ecx, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
add ebx, 4
|
add ebx, 4
|
||||||
call dword [fs_FloppyServices + eax*4]
|
call dword [fs_FloppyServices + eax*4]
|
||||||
and [flp_status], 0
|
and [flp_status], 0
|
||||||
@ -441,7 +441,7 @@ fs_OnHd:
|
|||||||
pop esi ebx
|
pop esi ebx
|
||||||
mov ecx, [ebx+12]
|
mov ecx, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
mov eax, [ebx]
|
mov eax, [ebx]
|
||||||
cmp eax, fs_NumHdServices
|
cmp eax, fs_NumHdServices
|
||||||
jae .not_impl
|
jae .not_impl
|
||||||
@ -517,7 +517,7 @@ fs_OnCd:
|
|||||||
@@:
|
@@:
|
||||||
mov ecx, [ebx+12]
|
mov ecx, [ebx+12]
|
||||||
mov edx, [ebx+16]
|
mov edx, [ebx+16]
|
||||||
add edx, std_application_base_address
|
; add edx, std_application_base_address
|
||||||
mov eax, [ebx]
|
mov eax, [ebx]
|
||||||
cmp eax,fs_NumCdServices
|
cmp eax,fs_NumCdServices
|
||||||
jae .not_impl
|
jae .not_impl
|
||||||
|
@ -499,7 +499,7 @@ fs_CdExecute:
|
|||||||
mov ebx, [ebx+4]
|
mov ebx, [ebx+4]
|
||||||
test ebx, ebx
|
test ebx, ebx
|
||||||
jz @f
|
jz @f
|
||||||
add ebx, std_application_base_address
|
; add ebx, std_application_base_address
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
;----------------------------------------------------------------
|
;----------------------------------------------------------------
|
||||||
|
@ -227,15 +227,39 @@ high_code:
|
|||||||
mov dword [sys_pgdir+8], 0
|
mov dword [sys_pgdir+8], 0
|
||||||
|
|
||||||
mov eax, cr3
|
mov eax, cr3
|
||||||
mov cr3, eax
|
mov cr3, eax ; flush TLB
|
||||||
|
|
||||||
; SAVE REAL MODE VARIABLES
|
; SAVE REAL MODE VARIABLES
|
||||||
mov ax, [BOOT_VAR + 0x9031]
|
mov ax, [BOOT_VAR + 0x9031]
|
||||||
mov [IDEContrRegsBaseAddr], ax
|
mov [IDEContrRegsBaseAddr], ax
|
||||||
; --------------- APM ---------------------
|
; --------------- APM ---------------------
|
||||||
; mov eax, [BOOT_VAR + 0x9040] ; entry point
|
|
||||||
; mov dword[apm_entry], eax
|
; init selectors
|
||||||
; mov word [apm_entry + 4], apm_code_32 - gdts
|
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 eax, [BOOT_VAR + 0x9044] ; version & flags
|
||||||
mov [apm_vf], eax
|
mov [apm_vf], eax
|
||||||
@ -1711,9 +1735,9 @@ msset:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
app_load_cursor:
|
app_load_cursor:
|
||||||
add ebx, new_app_base
|
; add ebx, new_app_base
|
||||||
cmp ebx, new_app_base
|
cmp ebx, OS_BASE
|
||||||
jb msset
|
jae msset
|
||||||
stdcall load_cursor, ebx, ecx
|
stdcall load_cursor, ebx, ecx
|
||||||
mov [esp+36], eax
|
mov [esp+36], eax
|
||||||
ret
|
ret
|
||||||
@ -3942,7 +3966,7 @@ syscall_putimage: ; PutImage
|
|||||||
|
|
||||||
mov edx,ecx
|
mov edx,ecx
|
||||||
mov ecx,ebx
|
mov ecx,ebx
|
||||||
lea ebx, [eax+std_application_base_address]
|
mov ebx, eax
|
||||||
|
|
||||||
sys_putimage:
|
sys_putimage:
|
||||||
test ecx,0x80008000
|
test ecx,0x80008000
|
||||||
@ -3984,11 +4008,11 @@ sys_putimage_bpp:
|
|||||||
jmp [draw_pointer]
|
jmp [draw_pointer]
|
||||||
|
|
||||||
syscall_putimage_palette:
|
syscall_putimage_palette:
|
||||||
lea edi, [esi+std_application_base_address]
|
mov edi, esi
|
||||||
mov esi, edx
|
mov esi, edx
|
||||||
mov edx, ecx
|
mov edx, ecx
|
||||||
mov ecx, ebx
|
mov ecx, ebx
|
||||||
lea ebx, [eax+std_application_base_address]
|
mov ebx, eax
|
||||||
sys_putimage_palette:
|
sys_putimage_palette:
|
||||||
; ebx = pointer to image
|
; ebx = pointer to image
|
||||||
; ecx = [xsize]*65536 + [ysize]
|
; ecx = [xsize]*65536 + [ysize]
|
||||||
@ -4840,7 +4864,8 @@ sys_apm:
|
|||||||
mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported
|
mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@: xchg eax, ecx
|
@@:
|
||||||
|
xchg eax, ecx
|
||||||
xchg ebx, ecx
|
xchg ebx, ecx
|
||||||
|
|
||||||
cmp al, 3
|
cmp al, 3
|
||||||
@ -4852,7 +4877,22 @@ sys_apm:
|
|||||||
mov [esp + 32], eax
|
mov [esp + 32], eax
|
||||||
ret
|
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 + 8 ], edi
|
||||||
mov [esp + 12], esi
|
mov [esp + 12], esi
|
||||||
mov [esp + 24], ebx
|
mov [esp + 24], ebx
|
||||||
@ -4862,6 +4902,8 @@ sys_apm:
|
|||||||
setc al
|
setc al
|
||||||
and [esp + 56], byte 0xfe
|
and [esp + 56], byte 0xfe
|
||||||
or [esp + 56], al
|
or [esp + 56], al
|
||||||
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
; -----------------------------------------
|
; -----------------------------------------
|
||||||
|
|
||||||
@ -4880,15 +4922,6 @@ system_shutdown: ; shut down the system
|
|||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
call stop_all_services
|
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
|
push 3 ; stop playing cd
|
||||||
pop eax
|
pop eax
|
||||||
call sys_cd_audio
|
call sys_cd_audio
|
||||||
|
@ -24,9 +24,7 @@
|
|||||||
;
|
;
|
||||||
; Runtime:
|
; Runtime:
|
||||||
;
|
;
|
||||||
; 0x00000000 -> 0x7FBFFFFF application 2Gb-4Mb
|
; 0x00000000 -> 0x7FFFFFFF application 2Gb
|
||||||
; 0x7FC00000 -> 0x7FFFFFFF page tables 4Mb
|
|
||||||
|
|
||||||
|
|
||||||
; 0x80000000 -> 1FFF window_data - 256 entries
|
; 0x80000000 -> 1FFF window_data - 256 entries
|
||||||
;
|
;
|
||||||
@ -229,8 +227,9 @@
|
|||||||
;
|
;
|
||||||
; 0x8098B000 -> kernel heap
|
; 0x8098B000 -> kernel heap
|
||||||
; 0x81FFFFFF heap min limit
|
; 0x81FFFFFF heap min limit
|
||||||
; 0xFDFFFFFF heap max limit
|
; 0xFDBFFFFF heap max limit
|
||||||
|
|
||||||
|
; 0xFDC00000 -> 0xFDFFFFFF page tables 4Mb
|
||||||
; 0xFE000000 -> 0xFFFFFFFF LFB 32Mb
|
; 0xFE000000 -> 0xFFFFFFFF LFB 32Mb
|
||||||
; 0xFE000000 -> 0xFE7FFFFF application available LFB 8Mb
|
; 0xFE000000 -> 0xFE7FFFFF application available LFB 8Mb
|
||||||
; 0xFE800000 -> 0xFFFFFFFF kernel LFB part 24 Mb
|
; 0xFE800000 -> 0xFFFFFFFF kernel LFB part 24 Mb
|
||||||
|
@ -592,7 +592,7 @@ socket_read_packet:
|
|||||||
|
|
||||||
.startcopy:
|
.startcopy:
|
||||||
mov edi, ecx ;
|
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 ;
|
mov esi, ebx ;
|
||||||
add esi, SOCKETHEADERSIZE ; we dont need to copy the header
|
add esi, SOCKETHEADERSIZE ; we dont need to copy the header
|
||||||
|
Loading…
Reference in New Issue
Block a user