From 6cb566cf5e320132a7cd49aae1a88292b93b6f7c Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Mon, 15 Sep 2008 15:25:03 +0000 Subject: [PATCH] replace old alloc_kernel_space and kernel_alloc with mem_alloc git-svn-id: svn://kolibrios.org@864 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/kolibri_pe/boot/boot.asm | 2 +- kernel/branches/kolibri_pe/core/dll.inc | 34 ++--- kernel/branches/kolibri_pe/core/exports.inc | 9 +- kernel/branches/kolibri_pe/core/heap.c | 47 ++++--- kernel/branches/kolibri_pe/core/heap.inc | 74 ----------- kernel/branches/kolibri_pe/core/malloc.inc | 4 +- kernel/branches/kolibri_pe/core/memory.inc | 119 +++++++++--------- kernel/branches/kolibri_pe/core/mm.c | 25 +--- kernel/branches/kolibri_pe/core/peload.inc | 12 +- kernel/branches/kolibri_pe/core/taskman.inc | 3 +- kernel/branches/kolibri_pe/core/v86.inc | 5 +- .../branches/kolibri_pe/detect/getcache.inc | 6 +- .../branches/kolibri_pe/drivers/imports.inc | 4 +- .../branches/kolibri_pe/drivers/infinity.asm | 27 +--- kernel/branches/kolibri_pe/drivers/sis.asm | 8 +- kernel/branches/kolibri_pe/drivers/sound.asm | 6 +- kernel/branches/kolibri_pe/fs/ntfs.inc | 70 ++++++----- kernel/branches/kolibri_pe/fs/parse_fn.inc | 27 ++-- kernel/branches/kolibri_pe/gui/event.inc | 6 +- kernel/branches/kolibri_pe/include/mm.h | 10 +- kernel/branches/kolibri_pe/kernel.asm | 26 ++-- kernel/branches/kolibri_pe/makefile | 11 +- kernel/branches/kolibri_pe/video/cursors.inc | 9 +- 23 files changed, 243 insertions(+), 301 deletions(-) diff --git a/kernel/branches/kolibri_pe/boot/boot.asm b/kernel/branches/kolibri_pe/boot/boot.asm index 369d33ccb8..5b8663435c 100644 --- a/kernel/branches/kolibri_pe/boot/boot.asm +++ b/kernel/branches/kolibri_pe/boot/boot.asm @@ -4,7 +4,7 @@ format MS COFF include '../macros.inc' -$Revision: 849 $ +$Revision$ __REV__ = __REV diff --git a/kernel/branches/kolibri_pe/core/dll.inc b/kernel/branches/kolibri_pe/core/dll.inc index 4eb0d5edd5..4af98a1f3d 100644 --- a/kernel/branches/kolibri_pe/core/dll.inc +++ b/kernel/branches/kolibri_pe/core/dll.inc @@ -585,12 +585,15 @@ proc load_file stdcall, file_name:dword test eax, eax jnz .fail - mov eax, [file_size] - cmp eax, 1024*1024*16 + mov ecx, [file_size] + cmp ecx, 1024*1024*16 ja .fail - stdcall kernel_alloc, [file_size] + mov edx, PG_SW + call @mem_alloc@8 mov [file], eax + test eax, eax + jz .fail stdcall read_file, [file_name], eax, dword 0, [file_size] cmp ebx, [file_size] @@ -599,10 +602,11 @@ proc load_file stdcall, file_name:dword mov eax, [file] cmp dword [eax], 0x4B43504B jne .exit - mov ebx, [eax+4] - mov [file_size], ebx - stdcall kernel_alloc, ebx + mov ecx, [eax+4] + mov [file_size], ecx + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jz .cleanup @@ -824,20 +828,20 @@ proc load_driver stdcall, driver_name:dword mov [coff], eax - movzx ecx, [eax+CFH.nSections] - xor ebx, ebx - + movzx ebx, [eax+CFH.nSections] lea edx, [eax+20] + xor ecx, ecx @@: - add ebx, [edx+CFS.SizeOfRawData] - add ebx, 15 - and ebx, not 15 + add ecx, [edx+CFS.SizeOfRawData] + add ecx, 15 + and ecx, not 15 add edx, COFF_SECTION_SIZE - dec ecx + dec ebx jnz @B - mov [img_size], ebx - stdcall kernel_alloc, ebx + mov [img_size], ecx + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jz .fail mov [img_base], eax diff --git a/kernel/branches/kolibri_pe/core/exports.inc b/kernel/branches/kolibri_pe/core/exports.inc index 0fddba1522..c7bb10d3e5 100644 --- a/kernel/branches/kolibri_pe/core/exports.inc +++ b/kernel/branches/kolibri_pe/core/exports.inc @@ -31,7 +31,6 @@ iglobal szPciWrite32 db 'PciWrite32',0 szAllocPage db 'AllocPage',0 - szAllocPages db 'AllocPages',0 szFreePage db 'FreePage',0 szGetPgAddr db 'GetPgAddr',0 szMapPage db 'MapPage',0 @@ -42,7 +41,7 @@ iglobal szAllocKernelSpace db 'AllocKernelSpace',0 szFreeKernelSpace db 'FreeKernelSpace',0 - szKernelAlloc db 'KernelAlloc',0 + szHeapAlloc db 'HeapAlloc',0 szKernelFree db 'KernelFree',0 szUserAlloc db 'UserAlloc',0 szUserFree db 'UserFree',0 @@ -103,8 +102,7 @@ kernel_export: dd szPciWrite16 , pci_write16 dd szPciWrite32 , pci_write32 - dd szAllocPage , _alloc_page ;stdcall - dd szAllocPages , _alloc_pages ;stdcall + dd szAllocPage , _alloc_page ;stdcall dd szFreePage , free_page dd szMapPage , map_page ;stdcall dd szMapSpace , map_space @@ -113,9 +111,8 @@ kernel_export: dd szCommitPages , commit_pages ;not implemented dd szReleasePages , release_pages - dd szAllocKernelSpace, alloc_kernel_space ;stdcall dd szFreeKernelSpace , free_kernel_space ;stdcall - dd szKernelAlloc , kernel_alloc ;stdcall + dd szHeapAlloc , @heap_alloc@8 ;fastcall dd szKernelFree , kernel_free ;stdcall dd szUserAlloc , user_alloc ;stdcall dd szUserFree , user_free ;stdcall diff --git a/kernel/branches/kolibri_pe/core/heap.c b/kernel/branches/kolibri_pe/core/heap.c index 6eee756e75..75a688e1df 100644 --- a/kernel/branches/kolibri_pe/core/heap.c +++ b/kernel/branches/kolibri_pe/core/heap.c @@ -335,10 +335,7 @@ void* __fastcall mem_alloc(size_t size, u32_t flags) return NULL; }; -void* __stdcall alloc_kernel_space(size_t size); //__asm__("alloc_kernel_space"); - - -void* __stdcall alloc_kernel_space(size_t size) +void * __fastcall heap_alloc(size_t size, u32_t flags) { md_t *md; @@ -346,16 +343,36 @@ void* __stdcall alloc_kernel_space(size_t size) md = find_small_md(size); - DBG("alloc_kernel_space: %x size %x\n\n",md->base, size); - if( md ) - return (void*)md->base; - return NULL; -} + { + if( flags & PG_MAP ) + { + count_t tmp = size >> 12; + addr_t *pte = &((addr_t*)page_tabs)[md->base>>12]; + + while(tmp) + { + u32_t order; + addr_t frame; + size_t size; + + asm volatile ("bsr %0, %1":"=&r"(order):"r"(tmp):"cc"); + asm volatile ("btr %0, %1" :"=r"(tmp):"r"(order):"cc"); + + frame = core_alloc(order) | flags; + + size = (1 << order); + while(size--) + { + *pte++ = frame; + frame+= 4096; + }; + }; + }; + DBG("alloc_heap: %x size %x\n\n",md->base, size); + return (void*)md->base; + }; + return NULL; +}; + -//void* __stdcall kernel_alloc(size_t size) -//{ -// -// return NULL; -//} -//*/ diff --git a/kernel/branches/kolibri_pe/core/heap.inc b/kernel/branches/kolibri_pe/core/heap.inc index 9306148f32..e550660c12 100644 --- a/kernel/branches/kolibri_pe/core/heap.inc +++ b/kernel/branches/kolibri_pe/core/heap.inc @@ -45,80 +45,6 @@ proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword ret endp -align 4 -proc kernel_alloc stdcall, size:dword - locals - lin_addr dd ? - pages_count dd ? - endl - - push ebx - push edi - - mov eax, [size] - add eax, 4095 - and eax, not 4095; - mov [size], eax - test eax, eax - jz .err - - mov ebx, eax - shr ebx, 12 - mov [pages_count], ebx - - stdcall alloc_kernel_space, eax - test eax, eax - jz .err - mov [lin_addr], eax - - mov ecx, [pages_count] - mov edx, eax - mov ebx, ecx - - shr ecx, 3 - jz .next - - and ebx, not 7 - push ebx - stdcall _alloc_pages, ebx - pop ecx ; yes ecx!!! - test eax, eax - jz .err - - mov edi, eax - mov edx, [lin_addr] -@@: - stdcall map_page,edx,edi,dword PG_SW - add edx, 0x1000 - add edi, 0x1000 - dec ecx - jnz @B -.next: - mov ecx, [pages_count] - and ecx, 7 - jz .end -@@: - push ecx - call _alloc_page - pop ecx - test eax, eax - jz .err - - stdcall map_page,edx,eax,dword PG_SW - add edx, 0x1000 - dec ecx - jnz @B -.end: - mov eax, [lin_addr] - pop edi - pop ebx - ret -.err: - xor eax, eax - pop edi - pop ebx - ret -endp align 4 proc kernel_free stdcall, base:dword diff --git a/kernel/branches/kolibri_pe/core/malloc.inc b/kernel/branches/kolibri_pe/core/malloc.inc index b915da5d89..640b88f569 100644 --- a/kernel/branches/kolibri_pe/core/malloc.inc +++ b/kernel/branches/kolibri_pe/core/malloc.inc @@ -983,7 +983,9 @@ malloc_large: align 4 init_malloc: - stdcall kernel_alloc, 0x40000 + mov ecx, 6 + call @core_alloc@4 + add eax, OS_BASE mov [mst.top], eax mov [mst.topsize], 256*1024 diff --git a/kernel/branches/kolibri_pe/core/memory.inc b/kernel/branches/kolibri_pe/core/memory.inc index 298bdd7db0..158d9a350a 100644 --- a/kernel/branches/kolibri_pe/core/memory.inc +++ b/kernel/branches/kolibri_pe/core/memory.inc @@ -37,42 +37,37 @@ free_page: proc map_io_mem stdcall, base:dword, size:dword, flags:dword - push ebx push edi - mov eax, [size] - add eax, 4095 - and eax, -4096 - mov [size], eax - stdcall alloc_kernel_space, eax + + mov ecx, [size] + add ecx, 4095 + and ecx, -4096 + mov [size], ecx + xor edx, edx + call @mem_alloc@8 test eax, eax jz .fail - push eax - mov edi, 0x1000 - mov ebx, eax - mov ecx,[size] - mov edx, [base] - shr eax, 12 + mov edx, eax + mov edi, eax + shr edi, 10 + add edi, page_tabs + + mov ecx, [size] shr ecx, 12 - and edx, -4096 - or edx, [flags] + mov eax, [base] + and eax, -4096 + or eax, [flags] @@: - mov [page_tabs+eax*4], edx - ; push eax - ; invlpg [ebx] - ; pop eax - inc eax - add ebx, edi - add edx, edi + stosd + add eax, 0x1000 loop @B - pop eax - mov edx, [base] - and edx, 4095 + mov eax, [base] + and eax, 4095 add eax, edx .fail: pop edi - pop ebx ret endp @@ -194,8 +189,9 @@ proc init_LFB cmp dword [LFBAddress], -1 jne @f mov [BOOT_VAR+0x901c],byte 2 - stdcall _alloc_pages, 0x280000 shr 12 - add eax, OS_BASE + mov ecx, 0x280000 + mov edx, PG_SW + call @mem_alloc@8 mov [LFBAddress], eax ret @@: @@ -477,7 +473,8 @@ align 4 test edx, PG_MAP jnz @F - call _alloc_page + xor ecx, ecx + call @core_alloc@4 test eax, eax jz .fail @@ -789,11 +786,12 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword mov ecx, [ipc_tmp] cmp esi, 0x40000-0x1000 ; size of [ipc_tmp] minus one page jbe @f - push eax esi edi - add esi,0x1000 - stdcall alloc_kernel_space,esi + push eax + lea ecx, [esi+0x1000] + xor edx, edx + call @mem_alloc@8 mov ecx, eax - pop edi esi eax + pop eax @@: mov [used_buf], ecx stdcall map_mem, ecx, [SLOT_BASE+eax+0xB8],\ @@ -820,7 +818,6 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword mov [edi+4], ecx add edi, 8 mov esi, [msg_addr] - ; add esi, new_app_base cld rep movsb @@ -1154,54 +1151,50 @@ proc create_ring_buffer stdcall, size:dword, flags:dword buf_ptr dd ? endl - mov eax, [size] + mov ecx, [size] + test ecx, 4095 + jnz .fail + + add ecx, ecx + xor edx, edx + call @mem_alloc@8 test eax, eax - jz .fail - - add eax, eax - stdcall alloc_kernel_space, eax - test eax, eax - jz .fail - - push ebx - mov [buf_ptr], eax + jz .fail - mov ebx, [size] - shr ebx, 12 push ebx - stdcall _alloc_pages, ebx - pop ecx + xor ecx, ecx + mov edx, [size] + shr edx, 12 + mov ebx, edx + dec edx + bsr ecx, edx + inc ecx + call @core_alloc@4 test eax, eax jz .mm_fail - push edi - - or eax, [flags] - mov edi, [buf_ptr] - mov ebx, [buf_ptr] - mov edx, ecx - shl edx, 2 - shr edi, 10 + or eax, [flags] + mov edx, [buf_ptr] + lea ecx, [ebx*4] + shr edx, 10 @@: - mov [page_tabs+edi], eax - mov [page_tabs+edi+edx], eax + mov [page_tabs+edx], eax + mov [page_tabs+edx+ecx], eax add eax, 0x1000 - add ebx, 0x1000 - add edi, 4 - dec ecx + add edx, 4 + dec ebx jnz @B mov eax, [buf_ptr] - pop edi pop ebx ret .mm_fail: - stdcall free_kernel_space, [buf_ptr] - xor eax, eax + ;stdcall free_kernel_space, [buf_ptr] pop ebx + xor eax, eax .fail: ret endp diff --git a/kernel/branches/kolibri_pe/core/mm.c b/kernel/branches/kolibri_pe/core/mm.c index ea071618ac..a392f2ebb5 100644 --- a/kernel/branches/kolibri_pe/core/mm.c +++ b/kernel/branches/kolibri_pe/core/mm.c @@ -559,7 +559,7 @@ addr_t __fastcall core_alloc(u32_t order) //export v = zone_frame_alloc(&z_core, order); spinlock_unlock(&z_core.lock); safe_sti(efl); - + DBG("core alloc: %x, size %x\n", v << FRAME_WIDTH, (1<buffer, edx=size of partition ; out: CF set <=> invalid ; 1. Name=='NTFS ' @@ -133,14 +133,15 @@ ntfs_setup: ; CODE XREF: part_set.inc mov eax, 1 shl eax, cl .4: + mov ecx, [ntfs_data.frs_size] mov [ntfs_data.iab_size], eax ; allocate space for buffers - add eax, [ntfs_data.frs_size] - push eax - call kernel_alloc + add ecx, eax + mov edx, PG_SW + call @mem_alloc@8 test eax, eax - jz problem_fat_dec_count mov [ntfs_data.frs_buffer], eax + jz problem_fat_dec_count add eax, [ntfs_data.frs_size] mov [ntfs_data.iab_buffer], eax ; read $MFT disposition @@ -177,10 +178,9 @@ ntfs_setup: ; CODE XREF: part_set.inc .mftok: ; read $MFT table retrieval information ; start with one page, increase if not enough (when MFT too fragmented) - push ebx - push 0x1000 - call kernel_alloc - pop ebx + mov ecx, 0x1000 + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jz .fail_free_frs mov [ntfs_data.mft_retrieval], eax @@ -225,11 +225,12 @@ ntfs_setup: ; CODE XREF: part_set.inc ; if they will be needed, they will be loaded later mov [ntfs_data.cur_index_size], 0x1000/0x200 - push 0x1000 - call kernel_alloc + mov ecx, 0x1000 + mov edx, PG_SW + call @mem_alloc@8 test eax, eax - jz .fail_free_mft mov [ntfs_data.cur_index_buf], eax + jz .fail_free_mft popad call free_hd_channel @@ -241,11 +242,12 @@ ntfs_setup: ; CODE XREF: part_set.inc mov eax, [ntfs_data.mft_retrieval_size] cmp eax, [ntfs_data.mft_retrieval_alloc] jnz .ok - add eax, 0x1000/8 - mov [ntfs_data.mft_retrieval_alloc], eax - shl eax, 3 - push eax - call kernel_alloc + + lea ecx, [eax+0x1000/8] + mov [ntfs_data.mft_retrieval_alloc], ecx + shl ecx, 3 + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jnz @f popad @@ -980,10 +982,10 @@ ntfs_find_lfn: push eax push [ntfs_data.cur_index_buf] call kernel_free - pop eax - mov [ntfs_data.cur_index_size], eax - push eax - call kernel_alloc + pop ecx + mov [ntfs_data.cur_index_size], ecx + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jnz @f and [ntfs_data.cur_index_size], 0 @@ -998,12 +1000,13 @@ ntfs_find_lfn: shr ebp, 9 cmp ebp, [ntfs_data.cur_index_size] jbe .ok2 - push esi ebp - push ebp - call kernel_alloc - pop ebp esi + + mov ecx, ebp + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jz .stc_ret + mov edi, eax mov ecx, [ntfs_data.cur_index_size] shl ecx, 9-2 @@ -1326,10 +1329,10 @@ ntfs_HdReadFolder: push eax push [ntfs_data.cur_index_buf] call kernel_free - pop eax - mov [ntfs_data.cur_index_size], eax - push eax - call kernel_alloc + pop ecx + mov [ntfs_data.cur_index_size], ecx + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jnz @f and [ntfs_data.cur_index_size], 0 @@ -1349,12 +1352,13 @@ ntfs_HdReadFolder: shr ebp, 9 cmp ebp, [ntfs_data.cur_index_size] jbe .ok2 - push esi ebp - push ebp - call kernel_alloc - pop ebp esi + + mov ecx, ebp + mov edx, PG_SW + call @mem_alloc@8 test eax, eax jz .nomem + mov edi, eax mov ecx, [ntfs_data.cur_index_size] shl ecx, 9-2 diff --git a/kernel/branches/kolibri_pe/fs/parse_fn.inc b/kernel/branches/kolibri_pe/fs/parse_fn.inc index 9f1067c71f..35efb69588 100644 --- a/kernel/branches/kolibri_pe/fs/parse_fn.inc +++ b/kernel/branches/kolibri_pe/fs/parse_fn.inc @@ -84,20 +84,23 @@ endl endp proc load_file_parse_table - stdcall kernel_alloc,0x1000 - mov [tmp_file_name_table],eax - mov edi,eax - mov esi,sysdir_name - mov ecx,128/4 - rep movsd - invoke ini.enum_keys,conf_fname,conf_path_sect,get_every_key + xor eac, ecx + call @core_alloc@4 + add eax, OS_BASE + mov [tmp_file_name_table],eax + mov edi,eax + mov esi,sysdir_name + mov ecx,128/4 + rep movsd - mov eax,[tmp_file_name_table] - mov [full_file_name_table],eax - mov eax,[tmp_file_name_size] - mov [full_file_name_table.size],eax - ret + invoke ini.enum_keys,conf_fname,conf_path_sect,get_every_key + + mov eax,[tmp_file_name_table] + mov [full_file_name_table],eax + mov eax,[tmp_file_name_size] + mov [full_file_name_table.size],eax + ret endp uglobal diff --git a/kernel/branches/kolibri_pe/gui/event.inc b/kernel/branches/kolibri_pe/gui/event.inc index 4badc179bf..5f9976ca52 100644 --- a/kernel/branches/kolibri_pe/gui/event.inc +++ b/kernel/branches/kolibri_pe/gui/event.inc @@ -10,7 +10,11 @@ $Revision$ align 4 init_events: - stdcall kernel_alloc, 512*EVENT_SIZE + + mov ecx, 512*EVENT_SIZE + mov edx, PG_SW + call @mem_alloc@8 + mov [events], eax xor eax, eax mov [event_uid], eax diff --git a/kernel/branches/kolibri_pe/include/mm.h b/kernel/branches/kolibri_pe/include/mm.h index 456d5e6e18..69ca399525 100644 --- a/kernel/branches/kolibri_pe/include/mm.h +++ b/kernel/branches/kolibri_pe/include/mm.h @@ -29,14 +29,18 @@ typedef struct }phismem_t; -# define PA2KA(x) (((addr_t) (x)) + OS_BASE) -# define KA2PA(x) (((addr_t) (x)) - OS_BASE) +#define PG_MAP 1 + #define PAGE_SIZE 4096 #define FRAME_WIDTH 12 #define BUDDY_SYSTEM_INNER_BLOCK 0xff + +# define PA2KA(x) (((addr_t) (x)) + OS_BASE) +# define KA2PA(x) (((addr_t) (x)) - OS_BASE) + static inline count_t SIZE2FRAMES(size_t size) { if (!size) @@ -66,3 +70,5 @@ void frame_free(pfn_t frame); void __fastcall frame_set_parent(pfn_t pfn, void *data); void* __fastcall frame_get_parent(pfn_t pfn); + +void* __fastcall heap_alloc(size_t size, u32_t flags) ; diff --git a/kernel/branches/kolibri_pe/kernel.asm b/kernel/branches/kolibri_pe/kernel.asm index 9728287842..79f8463dfb 100644 --- a/kernel/branches/kolibri_pe/kernel.asm +++ b/kernel/branches/kolibri_pe/kernel.asm @@ -141,24 +141,27 @@ extrn _poweroff extrn _init extrn _init_mm +extrn @core_alloc@4 + 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 @heap_alloc@8 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 + +@mem_alloc@8 equ @heap_alloc@8 + + section '.flat' code readable align 4096 use32 @@ -555,7 +558,9 @@ __setvars: call init_fpu call init_malloc - stdcall alloc_kernel_space, 0x51000 + mov ecx, 0x51000 + xor edx, edx + call @mem_alloc@8 mov [default_io_map], eax add eax, 0x2000 @@ -611,8 +616,10 @@ __setvars: mov [BgrDrawMode],eax mov [BgrDataWidth],eax mov [BgrDataHeight],eax + mov ecx, 4095 + mov edx, PG_SW mov [mem_BACKGROUND],4095 - stdcall kernel_alloc, [mem_BACKGROUND] + call @mem_alloc@8 mov [img_background], eax mov [SLOT_BASE + 256 + APPDATA.dir_table], _sys_pdbr + (0x100000000-OS_BASE) @@ -2290,10 +2297,11 @@ sys_background: @@: mov eax,[BgrDataWidth] imul eax,[BgrDataHeight] - lea eax,[eax*3] - mov [mem_BACKGROUND],eax + lea ecx,[eax*3] + mov [mem_BACKGROUND],ecx ; get memory for new background - stdcall kernel_alloc, eax + mov edx, PG_SW + stdcall @mem_alloc@8 test eax, eax jz .exit_mem mov [img_background], eax diff --git a/kernel/branches/kolibri_pe/makefile b/kernel/branches/kolibri_pe/makefile index 07e793d842..3313ab9733 100644 --- a/kernel/branches/kolibri_pe/makefile +++ b/kernel/branches/kolibri_pe/makefile @@ -6,17 +6,24 @@ INCLUDE = include/ DEFS = -DUSE_SMP -DCONFIG_DEBUG -CFLAGS = -c -O2 -I $(INCLUDE) -fomit-frame-pointer -fno-builtin-printf -masm=intel +CFLAGS = -c -O2 -I $(INCLUDE) -fomit-frame-pointer -fno-builtin-printf -masm=intel LDFLAGS = -shared -s -Map kernel.map --image-base 0x100000 --file-alignment 32 KERNEL_SRC:= \ kernel.asm \ + data32.inc \ core/memory.inc \ core/heap.inc \ + core/malloc.inc \ core/taskman.inc \ + core/v86.inc \ core/sys32.inc \ core/dll.inc \ - data32.inc + core/exports.inc \ + fs/ntfs.inc \ + gui/event.inc \ + video/cursors.inc + PE_SRC:= \ init.c \ diff --git a/kernel/branches/kolibri_pe/video/cursors.inc b/kernel/branches/kolibri_pe/video/cursors.inc index 574ecac17d..e02af9474b 100644 --- a/kernel/branches/kolibri_pe/video/cursors.inc +++ b/kernel/branches/kolibri_pe/video/cursors.inc @@ -313,12 +313,13 @@ vesa_cursor: mov [eax+CURSOR.hot_x], ebx mov [eax+CURSOR.hot_y], ebx - stdcall kernel_alloc, 0x1000 + mov edi, eax + mov ecx, 0x1000 + mov edx, PG_SW + call @mem_alloc@8 test eax, eax - jz .fail - - mov edi, [.hcursor] mov [edi+CURSOR.base], eax + jz .fail mov esi, [.src] mov ebx, [.flags]