/kernel/trunk/core/dll.inc |
---|
388,8 → 388,6 |
align 4 |
proc reg_service stdcall, name:dword, handler:dword |
push ebx |
xor eax, eax |
cmp [name], eax |
398,11 → 396,14 |
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 |
428,7 → 429,6 |
ret |
.fail: |
xor eax, eax |
pop ebx |
ret |
endp |
/kernel/trunk/core/heap.inc |
---|
164,7 → 164,7 |
; ebx= descriptor index |
align 4 |
get_small_block: |
get_block: |
mov ecx, eax |
shr ecx, 12 |
dec ecx |
211,7 → 211,7 |
ret |
align 4 |
alloc_mem_block: |
proc alloc_mem_block |
mov ebx, [mem_block_start] |
mov ecx, [mem_block_end] |
233,8 → 233,9 |
add eax, [mem_block_arr] |
dec [free_blocks] |
ret |
align 4 |
free_mem_block: |
endp |
proc free_mem_block |
mov dword [eax], 0 |
mov dword [eax+4], 0 |
mov dword [eax+8], 0 |
262,6 → 263,7 |
.err: |
xor eax, eax |
ret |
endp |
align 4 |
proc alloc_kernel_space stdcall, size:dword |
282,7 → 284,7 |
cmp eax, [heap_free] |
ja .error |
call get_small_block ; eax |
call get_block ; eax |
test edi, edi |
jz .error |
/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 ;stdcall |
dd szCreateRingBuffer, create_ring_buffer |
dd szGetPid , get_pid |
dd szCreateObject , create_kernel_object |
/kernel/trunk/core/peload.inc |
---|
280,9 → 280,7 |
__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 |
290,7 → 288,6 |
malloc, 'Kmalloc', \ |
free, 'Kfree', \ |
map_io_mem, 'MapIoMem', \ ; stdcall |
get_pg_addr, 'GetPgAddr', \ ; eax |
\ |
select_hw_cursor, 'SelectHwCursor', \ ; stdcall |
set_hw_cursor, 'SetHwCursor', \ ; stdcall |
306,10 → 303,9 |
pci_write16, 'PciWrite16', \ ; stdcall |
pci_write32, 'PciWrite32', \ ; stdcall |
\ |
reg_service, 'RegService', \ ; stdcall |
reg_service, 'RegService', \ |
user_alloc, 'UserAlloc', \ ; stdcall |
user_free, 'UserFree', \ ; stdcall |
unmap_pages, 'UnmapPages', \ ; eax, ecx |
sys_msg_board_str, 'SysMsgBoardStr' |
/kernel/trunk/core/taskman.inc |
---|
212,6 → 212,7 |
jna @F |
xor eax, eax |
; add edi, new_app_base |
cld |
rep stosb |
@@: |
452,7 → 453,12 |
if GREEDY_KERNEL |
mov eax, 0x02 |
rep stosd |
.reserve: |
stosd |
invlpg [edx] |
add edx, 4096 |
dec ecx |
jnz .reserve |
else |
.alloc: |
501,8 → 507,6 |
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 |
572,8 → 576,9 |
align 4 |
get_pid: |
;mov eax, [TASK_DATA] ; I think it's the bug. (Rus) |
mov eax, [TASK_BASE] |
mov eax, [eax+TASKDATA.pid] |
mov eax, [eax+4] |
ret |
pid_to_slot: |
/kernel/trunk/core/memory.inc |
---|
166,9 → 166,7 |
or edx, [flags] |
@@: |
mov [page_tabs+eax*4], edx |
; push eax |
; invlpg [ebx] |
; pop eax |
invlpg [ebx] |
inc eax |
add ebx, edi |
add edx, edi |
186,7 → 184,7 |
; param |
; eax= page base + page flags |
; ebx= linear address |
; ebx= liear address |
; ecx= count |
align 4 |
204,9 → 202,7 |
shr ebx, 12 |
@@: |
mov [page_tabs+ebx*4], eax |
; push eax |
; invlpg [edi] |
; pop eax |
invlpg [edi] |
add edi, edx |
add eax, edx |
inc ebx |
267,33 → 263,7 |
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] |
1116,27 → 1086,6 |
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 |
1210,6 → 1159,8 |
ret |
endp |
align 4 |
proc stall stdcall, delay:dword |
push ecx |
1277,6 → 1228,8 |
@@: |
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 |
1295,4 → 1248,14 |
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/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,6 → 468,8 |
.init: |
mov [cur_def_interl], ebx |
; stdcall load_pe_driver, szAtiHW |
stdcall load_driver, szHwMouse |
mov [hw_cursor], eax |
test eax, eax |