Use libc calloc instead of own malloc stub.
This commit is contained in:
44
kolibri.asm
44
kolibri.asm
@@ -14,10 +14,17 @@ include 'blkdev/disk_cache.inc'
|
|||||||
include 'fs/fs_lfn.inc'
|
include 'fs/fs_lfn.inc'
|
||||||
include 'crc.inc'
|
include 'crc.inc'
|
||||||
|
|
||||||
|
struct FILE_DISK
|
||||||
|
fd dd ?
|
||||||
|
Sectors dd ?
|
||||||
|
Logical dd ? ; sector size
|
||||||
|
ends
|
||||||
|
|
||||||
|
extrn calloc
|
||||||
|
|
||||||
purge section,mov,add,sub
|
purge section,mov,add,sub
|
||||||
section '.text' executable align 16
|
section '.text' executable align 16
|
||||||
|
|
||||||
|
|
||||||
;uint32_t kos_time_to_epoch(uint8_t *time);
|
;uint32_t kos_time_to_epoch(uint8_t *time);
|
||||||
public kos_time_to_epoch
|
public kos_time_to_epoch
|
||||||
kos_time_to_epoch:
|
kos_time_to_epoch:
|
||||||
@@ -151,9 +158,9 @@ endp
|
|||||||
|
|
||||||
|
|
||||||
malloc:
|
malloc:
|
||||||
push [alloc_pos]
|
push ecx edx
|
||||||
add [alloc_pos], eax
|
ccall calloc, 1, eax
|
||||||
pop eax
|
pop edx ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
proc kernel_alloc _size
|
proc kernel_alloc _size
|
||||||
@@ -264,31 +271,12 @@ disk_functions:
|
|||||||
dd 0
|
dd 0
|
||||||
disk_functions_end:
|
disk_functions_end:
|
||||||
|
|
||||||
struct FILE_DISK
|
|
||||||
fd dd ?
|
|
||||||
Sectors dd ?
|
|
||||||
Logical dd ? ; sector size
|
|
||||||
ends
|
|
||||||
|
|
||||||
alloc_pos dd alloc_base
|
|
||||||
disk_name db 'hd0',0
|
disk_name db 'hd0',0
|
||||||
IncludeIGlobals
|
IncludeIGlobals
|
||||||
; crap
|
|
||||||
current_slot dd ?
|
|
||||||
pg_data PG_DATA
|
|
||||||
ide_channel1_mutex MUTEX
|
|
||||||
ide_channel2_mutex MUTEX
|
|
||||||
ide_channel3_mutex MUTEX
|
|
||||||
ide_channel4_mutex MUTEX
|
|
||||||
ide_channel5_mutex MUTEX
|
|
||||||
ide_channel6_mutex MUTEX
|
|
||||||
ide_channel7_mutex MUTEX
|
|
||||||
ide_channel8_mutex MUTEX
|
|
||||||
|
|
||||||
|
|
||||||
section '.bss' writeable align 16
|
section '.bss' writeable align 16
|
||||||
file_disk FILE_DISK
|
file_disk FILE_DISK
|
||||||
alloc_base rb 8*1024*1024
|
|
||||||
IncludeUGlobals
|
IncludeUGlobals
|
||||||
; crap
|
; crap
|
||||||
DiskNumber db ?
|
DiskNumber db ?
|
||||||
@@ -299,3 +287,13 @@ CDDataBuf_pointer dd ?
|
|||||||
DRIVE_DATA: rb 0x4000
|
DRIVE_DATA: rb 0x4000
|
||||||
cdpos dd ?
|
cdpos dd ?
|
||||||
cd_appl_data dd ?
|
cd_appl_data dd ?
|
||||||
|
current_slot dd ?
|
||||||
|
pg_data PG_DATA
|
||||||
|
ide_channel1_mutex MUTEX
|
||||||
|
ide_channel2_mutex MUTEX
|
||||||
|
ide_channel3_mutex MUTEX
|
||||||
|
ide_channel4_mutex MUTEX
|
||||||
|
ide_channel5_mutex MUTEX
|
||||||
|
ide_channel6_mutex MUTEX
|
||||||
|
ide_channel7_mutex MUTEX
|
||||||
|
ide_channel8_mutex MUTEX
|
||||||
|
2
makefile
2
makefile
@@ -14,7 +14,7 @@ kofuse: kofuse.o kolibri.o
|
|||||||
$(CC) $(LDFLAGS) $(LDFLAGS_32) $^ -o $@ `pkg-config fuse3 --libs`
|
$(CC) $(LDFLAGS) $(LDFLAGS_32) $^ -o $@ `pkg-config fuse3 --libs`
|
||||||
|
|
||||||
kolibri.o: kolibri.asm kolibri.h
|
kolibri.o: kolibri.asm kolibri.h
|
||||||
INCLUDE="$(KOLIBRI_TRUNK)" $(FASM) $< $@ -m 100000
|
INCLUDE="$(KOLIBRI_TRUNK)" $(FASM) $< $@
|
||||||
|
|
||||||
kofu.o: kofu.c kolibri.h
|
kofu.o: kofu.c kolibri.h
|
||||||
$(CC) $(CFLAGS) $(CFLAGS_32) -c $<
|
$(CC) $(CFLAGS) $(CFLAGS_32) -c $<
|
||||||
|
Reference in New Issue
Block a user