/kernel/trunk/core/exports.inc |
---|
39,7 → 39,9 |
szUserFree db 'UserFree',0 |
szKmalloc db 'Kmalloc',0 |
szKfree db 'Kfree',0 |
szCreateRingBuffer db 'CreateRingBuffer',0 |
szGetPid db 'GetPid',0 |
szCreateObject db 'CreateObject',0 |
szDestroyObject db 'DestroyObject',0 |
szCreateEvent db 'CreateEvent',0 |
101,7 → 103,9 |
dd szUserFree , user_free |
dd szKmalloc , malloc |
dd szKfree , free |
dd szCreateRingBuffer, create_ring_buffer |
dd szGetPid , get_pid |
dd szCreateObject , create_kernel_object |
dd szDestroyObject , destroy_kernel_object |
dd szCreateEvent , create_event |
/kernel/trunk/core/memory.inc |
---|
1085,7 → 1085,59 |
ret |
endp |
align 4 |
proc create_ring_buffer stdcall, size:dword, flags:dword |
locals |
buf_ptr dd ? |
endl |
mov eax, [size] |
test eax, eax |
jz .fail |
add eax, eax |
stdcall alloc_kernel_space, eax |
test eax, eax |
jz .fail |
mov [buf_ptr], eax |
mov ebx, [size] |
shr ebx, 12 |
push ebx |
stdcall alloc_pages, ebx |
pop ecx |
test eax, eax |
jz .mm_fail |
or eax, [flags] |
mov edi, [buf_ptr] |
mov ebx, [buf_ptr] |
mov edx, ecx |
shl edx, 2 |
shr edi, 10 |
@@: |
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 |
dec ecx |
jnz @B |
mov eax, [buf_ptr] |
ret |
.mm_fail: |
stdcall free_kernel_space, [buf_ptr] |
xor eax, eax |
.fail: |
ret |
endp |
if 0 |
push eax |
push edx |
/kernel/trunk/core/taskman.inc |
---|
544,6 → 544,12 |
ret |
endp |
align 4 |
get_pid: |
mov eax, [TASK_DATA] |
mov eax, [eax+4] |
ret |
pid_to_slot: |
;Input: |
; eax - pid of process |
/kernel/trunk/drivers/imports.inc |
---|
88,7 → 88,13 |
if used Kfree |
extrn Kfree |
end if |
if used CreateRingBuffer |
extrn CreateRingBuffer |
end if |
if used GetPid |
extrn GetPid |
end if |
if used CreateObject |
extrn CreateObject |
end if |
/kernel/trunk/drivers/infinity.asm |
---|
15,7 → 15,10 |
include 'proc32.inc' |
;include 'system.inc' |
include 'main.inc' |
include 'imports.inc' |
FORCE_MMX equ 0 ;set to 1 to force use mmx or |
27,9 → 30,6 |
OS_BASE equ 0x80000000 |
SLOT_BASE equ (OS_BASE+0x0080000) |
TASK_COUNT equ (OS_BASE+0x0003004) |
CURRENT_TASK equ (OS_BASE+0x0003000) |
CAPS_SSE2 equ 26 |
PG_SW equ 0x003 |
334,9 → 334,9 |
test eax, PCM_OUT+PCM_STATIC |
jnz .fail |
.test_ok: |
mov ebx, [CURRENT_TASK] ;hack: direct accsess |
shl ebx, 5 ;to kernel data |
mov ebx, [CURRENT_TASK+ebx+4] |
call GetPid |
mov ebx, eax |
mov eax, STREAM_SIZE |
call CreateObject |
390,9 → 390,11 |
shr ebx, 12 |
mov [ring_pages], ebx |
add eax, eax ;double ring size |
stdcall CreateRingBuffer, eax, PG_SW |
if 0 |
stdcall AllocKernelSpace, eax |
end if |
mov edi, [str] |
mov ecx, [ring_size] |
mov [edi+STREAM.in_base], eax |
407,6 → 409,7 |
add eax, ecx |
mov [edi+STREAM.in_top], eax |
if 0 |
mov ebx, [ring_pages] |
stdcall AllocPages, ebx |
mov edi, [str] |
421,7 → 424,7 |
pop eax |
add ebx, [ring_size] |
call CommitPages ;double mapped |
end if |
jmp .out_buff |
.static: |
mov ecx, [size] |
/kernel/trunk/fs/fs_lfn.inc |
---|
107,6 → 107,7 |
stdcall kernel_alloc, 200 |
mov edx,eax |
pop eax |
push edx |
push end_of_file_system_lfn |
mov ebx,edx |
146,9 → 147,6 |
; add eax, std_application_base_address |
; parse file name |
xchg ebx, eax |