/kernel/trunk/core/dll.inc |
---|
388,8 → 388,10 |
align 4 |
proc reg_service stdcall, name:dword, handler:dword |
xor eax, eax |
push ebx |
xor eax, eax |
cmp [name], eax |
je .fail |
396,14 → 398,11 |
cmp [handler], eax |
je .fail |
push ebx |
mov eax, SRV_SIZE |
call malloc ;call alloc_service |
pop ebx |
test eax, eax |
jz .fail |
push ebx |
push esi |
push edi |
mov edi, eax |
429,6 → 428,7 |
ret |
.fail: |
xor eax, eax |
pop ebx |
ret |
endp |
/kernel/trunk/core/exports.inc |
---|
121,7 → 121,7 |
dd szUserFree , user_free ;stdcall |
dd szKmalloc , malloc |
dd szKfree , free |
dd szCreateRingBuffer, create_ring_buffer |
dd szCreateRingBuffer, create_ring_buffer ;stdcall |
dd szGetPid , get_pid |
dd szCreateObject , create_kernel_object |
/kernel/trunk/core/heap.inc |
---|
164,7 → 164,7 |
; ebx= descriptor index |
align 4 |
get_block: |
get_small_block: |
mov ecx, eax |
shr ecx, 12 |
dec ecx |
211,7 → 211,7 |
ret |
align 4 |
proc alloc_mem_block |
alloc_mem_block: |
mov ebx, [mem_block_start] |
mov ecx, [mem_block_end] |
233,9 → 233,8 |
add eax, [mem_block_arr] |
dec [free_blocks] |
ret |
endp |
proc free_mem_block |
align 4 |
free_mem_block: |
mov dword [eax], 0 |
mov dword [eax+4], 0 |
mov dword [eax+8], 0 |
263,7 → 262,6 |
.err: |
xor eax, eax |
ret |
endp |
align 4 |
proc alloc_kernel_space stdcall, size:dword |
284,7 → 282,7 |
cmp eax, [heap_free] |
ja .error |
call get_block ; eax |
call get_small_block ; eax |
test edi, edi |
jz .error |
/kernel/trunk/core/memory.inc |
---|
126,12 → 126,12 |
;arg: eax page address |
pushfd |
cli |
shr eax, 12 ;page index |
bts dword [sys_pgmap], eax ;that's all! |
shr eax, 12 ;page index |
bts dword [sys_pgmap], eax ;that's all! |
cmc |
adc [pg_data.pages_free], 0 |
shr eax, 3 |
and eax, not 3 ;dword offset from page_map |
and eax, not 3 ;dword offset from page_map |
add eax, sys_pgmap |
cmp [page_start], eax |
ja @f |
166,7 → 166,9 |
or edx, [flags] |
@@: |
mov [page_tabs+eax*4], edx |
invlpg [ebx] |
; push eax |
; invlpg [ebx] |
; pop eax |
inc eax |
add ebx, edi |
add edx, edi |
184,7 → 186,7 |
; param |
; eax= page base + page flags |
; ebx= liear address |
; ebx= linear address |
; ecx= count |
align 4 |
202,7 → 204,9 |
shr ebx, 12 |
@@: |
mov [page_tabs+ebx*4], eax |
invlpg [edi] |
; push eax |
; invlpg [edi] |
; pop eax |
add edi, edx |
add eax, edx |
inc ebx |
263,7 → 267,33 |
popad |
ret |
; param |
; eax= base |
; ecx= count |
align 4 |
unmap_pages: |
push edi |
mov edi, eax |
mov edx, eax |
shr edi, 10 |
add edi, page_tabs |
xor eax, eax |
@@: |
stosd |
invlpg [edx] |
add edx, 0x1000 |
loop @b |
pop edi |
ret |
align 4 |
proc map_page_table stdcall, lin_addr:dword, phis_addr:dword |
push ebx |
mov ebx, [lin_addr] |
1086,6 → 1116,27 |
ret |
align 4 |
proc load_pe_driver stdcall, file:dword |
stdcall load_PE, [file] |
test eax, eax |
jz .fail |
mov esi, eax |
stdcall eax, DRV_ENTRY |
test eax, eax |
jz .fail |
mov [eax+SRV.entry], esi |
ret |
.fail: |
xor eax, eax |
ret |
endp |
align 4 |
proc init_mtrr |
cmp [BOOT_VAR+0x901c],byte 2 |
1159,8 → 1210,6 |
ret |
endp |
align 4 |
proc stall stdcall, delay:dword |
push ecx |
1228,8 → 1277,6 |
@@: |
mov [page_tabs+edi], eax |
mov [page_tabs+edi+edx], eax |
invlpg [ebx] |
invlpg [ebx+esi] |
add eax, 0x1000 |
add ebx, 0x1000 |
add edi, 4 |
1248,14 → 1295,4 |
ret |
endp |
if 0 |
push eax |
push edx |
mov edx, 0x400 ;bochs |
mov al,0xff ;bochs |
out dx, al ;bochs |
pop edx |
pop eax |
end if |
/kernel/trunk/core/peload.inc |
---|
280,7 → 280,9 |
__exports: |
export 'KERNEL', \ |
alloc_kernel_space, 'AllocKernelSpace', \ ; stdcall |
commit_pages, 'CommitPages', \ ; eax, ebx, ecx |
create_kernel_object, 'CreateObject', \ |
create_ring_buffer, 'CreateRingBuffer', \ ; stdcall |
destroy_kernel_object, 'DestroyObject', \ |
free_kernel_space, 'FreeKernelSpace', \ ; stdcall |
kernel_alloc, 'KernelAlloc', \ ; stdcall |
288,6 → 290,7 |
malloc, 'Kmalloc', \ |
free, 'Kfree', \ |
map_io_mem, 'MapIoMem', \ ; stdcall |
get_pg_addr, 'GetPgAddr', \ ; eax |
\ |
select_hw_cursor, 'SelectHwCursor', \ ; stdcall |
set_hw_cursor, 'SetHwCursor', \ ; stdcall |
303,9 → 306,10 |
pci_write16, 'PciWrite16', \ ; stdcall |
pci_write32, 'PciWrite32', \ ; stdcall |
\ |
reg_service, 'RegService', \ |
reg_service, 'RegService', \ ; stdcall |
user_alloc, 'UserAlloc', \ ; stdcall |
user_free, 'UserFree', \ ; stdcall |
unmap_pages, 'UnmapPages', \ ; eax, ecx |
sys_msg_board_str, 'SysMsgBoardStr' |
/kernel/trunk/core/taskman.inc |
---|
212,8 → 212,7 |
jna @F |
xor eax, eax |
; add edi, new_app_base |
cld |
cld |
rep stosb |
@@: |
end if |
453,12 → 452,7 |
if GREEDY_KERNEL |
mov eax, 0x02 |
.reserve: |
stosd |
invlpg [edx] |
add edx, 4096 |
dec ecx |
jnz .reserve |
rep stosd |
else |
.alloc: |
507,6 → 501,8 |
mov eax, [esi] |
test eax, 1 |
jz .next |
test eax, 1 shl 9 |
jnz .next ;skip shared pages |
call free_page |
.next: |
add esi, 4 |
576,9 → 572,8 |
align 4 |
get_pid: |
;mov eax, [TASK_DATA] ; I think it's the bug. (Rus) |
mov eax, [TASK_BASE] |
mov eax, [eax+4] |
mov eax, [eax+TASKDATA.pid] |
ret |
pid_to_slot: |
/kernel/trunk/drivers/ati2d.asm |
---|
178,7 → 178,7 |
inc edx |
} |
macro OUT_PACKET3 pkt, count \ |
macro OUT_PACKET3 pkt, count |
{ |
mov eax, (RADEON_CP_PACKET3 or pkt or (count shl 16)) |
mov [edi+edx*4], eax |
/kernel/trunk/video/cursors.inc |
---|
468,8 → 468,6 |
.init: |
mov [cur_def_interl], ebx |
; stdcall load_pe_driver, szAtiHW |
stdcall load_driver, szHwMouse |
mov [hw_cursor], eax |
test eax, eax |