123,6 → 123,12 |
|
public __setvars |
|
public _rd_base |
public _rd_fat |
public _rd_fat_end |
public _rd_root |
public _rd_root_end |
|
extrn _16bit_start |
extrn _16bit_end |
|
131,15 → 137,22 |
extrn _init |
extrn _init_mm |
|
public _rd_base |
public _rd_fat |
public _rd_fat_end |
public _rd_root |
public _rd_root_end |
extrn @init_heap@8 |
extrn @find_large_md@4 |
extrn @find_small_md@4 |
extrn @phis_alloc@4 |
extrn @mem_alloc@8 |
|
extrn _alloc_kernel_space@4 |
|
extrn _slab_cache_init |
extrn _alloc_pages |
extrn _alloc_page |
|
extrn _get_free_mem |
|
alloc_kernel_space equ _alloc_kernel_space@4 |
|
extrn _bx_from_load |
|
section '.flat' code readable align 4096 |
349,11 → 362,15 |
|
; MEMORY MODEL |
|
call init_kernel_heap ; FIXME initialize heap after pager |
|
call _init_mm |
mov [pg_data.pg_mutex], 0 |
|
call _slab_cache_init |
|
mov ecx, 0x80000000 |
mov edx, 0x40000000 |
call @init_heap@8 |
|
mov esi, _16bit_start |
mov ecx, _16bit_end |
shr ecx, 2 |
361,8 → 378,6 |
cld |
rep movsd |
|
xchg bx, bx |
|
jmp far 0x60:_enter_bootscreen; |
|
align 4 |
379,8 → 394,9 |
|
; SAVE & CLEAR 0-0xffff |
|
cld |
xor esi, esi |
mov edi,0x1F0000 |
mov edi,BOOT_VAR |
mov ecx,0x10000 / 4 |
rep movsd |
xor edi, edi |
388,6 → 404,15 |
mov ecx,0x10000 / 4 |
rep stosd |
|
mov edi, SLOT_BASE |
mov ecx,0x10000 / 4 |
rep stosd |
|
mov dword [_sys_pdbr], eax |
mov dword [_sys_pdbr+4], eax |
mov eax, cr3 |
mov cr3, eax |
|
; SAVE REAL MODE VARIABLES |
mov ax, [BOOT_VAR + 0x9031] |
mov [IDEContrRegsBaseAddr], ax |
788,7 → 813,6 |
|
; SET MOUSE |
|
;call detect_devices |
stdcall load_driver, szPS2MDriver |
; stdcall load_driver, szCOM_MDriver |
|
829,10 → 853,10 |
add esi, 0x1000 |
stdcall map_page,esi,(tss._io_map_1-OS_BASE), PG_MAP |
|
stdcall map_page,tss._io_map_0,\ |
(tss._io_map_0-OS_BASE), PG_MAP |
stdcall map_page,tss._io_map_1,\ |
(tss._io_map_1-OS_BASE), PG_MAP |
; stdcall map_page,tss._io_map_0,\ |
; (tss._io_map_0-OS_BASE), PG_MAP |
; stdcall map_page,tss._io_map_1,\ |
; (tss._io_map_1-OS_BASE), PG_MAP |
|
; mov ax,[OS_BASE+0x10000+bx_from_load] |
; cmp ax,'r1' ; if not rused ram disk - load network configuration from files {SPraid.simba} |
842,18 → 866,7 |
|
; LOAD FIRST APPLICATION |
|
cmp byte [BOOT_VAR+0x9030],1 |
jne no_load_vrr_m |
|
mov ebp, vrr_m |
call fs_execute_from_sysdir |
|
cmp eax,2 ; if vrr_m app found (PID=2) |
je first_app_found |
|
no_load_vrr_m: |
|
|
mov ebp, firstapp |
call fs_execute_from_sysdir |
|
1893,18 → 1906,6 |
|
ret |
|
|
detect_devices: |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
;include 'detect/commouse.inc' |
;include 'detect/ps2mouse.inc' |
;include 'detect/dev_fd.inc' |
;include 'detect/dev_hdcd.inc' |
;include 'detect/sear_par.inc' |
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
ret |
|
|
sys_end: |
|
mov eax,[TASK_BASE] |
2170,7 → 2171,7 |
ret |
|
sysfn_getfreemem: |
mov eax, [pg_data.pages_free] |
call _get_free_mem |
shl eax, 2 |
mov [esp+32],eax |
ret |