Use free from libc, fix ls_range
This commit is contained in:
parent
bd2e078d13
commit
f3f0024d22
@ -67,8 +67,8 @@ s512_xfs_v4_ftype1_btree_dirs.img:
|
|||||||
sudo mount $(LOOP_DEV)p1 $(TEMP_DIR)
|
sudo mount $(LOOP_DEV)p1 $(TEMP_DIR)
|
||||||
sudo chown $(shell whoami) $(TEMP_DIR) -R
|
sudo chown $(shell whoami) $(TEMP_DIR) -R
|
||||||
#
|
#
|
||||||
mkdir $(TEMP_DIR)/btree1
|
mkdir $(TEMP_DIR)/btree
|
||||||
$(MKDIRRANGE) $(TEMP_DIR)/btree1 293181
|
$(MKDIRRANGE) $(TEMP_DIR)/btree 293181
|
||||||
|
|
||||||
sudo umount $(TEMP_DIR)
|
sudo umount $(TEMP_DIR)
|
||||||
sudo losetup -d $(LOOP_DEV)
|
sudo losetup -d $(LOOP_DEV)
|
||||||
|
24
kofu.c
24
kofu.c
@ -40,12 +40,22 @@ char **split_args(char *s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ls_range(struct f70s1arg *f70) {
|
void ls_range(struct f70s1arg *f70) {
|
||||||
int status = kos_fuse_lfn(f70);
|
uint32_t requested = f70->size;
|
||||||
// printf("status = %d\n", status);
|
f70->size = DIRENTS_TO_READ;
|
||||||
if (status == F70_SUCCESS || status == F70_END_OF_FILE) {
|
for (; requested; requested -= f70->size) {
|
||||||
struct f70s1ret *dir = f70->buf;
|
if (f70->size > requested) {
|
||||||
for (size_t i = 0; i < dir->cnt; i++) {
|
f70->size = requested;
|
||||||
printf("%s\n", dir->bdfes[i].name);
|
}
|
||||||
|
int status = kos_fuse_lfn(f70);
|
||||||
|
f70->offset += f70->size;
|
||||||
|
printf("status = %d\n", status);
|
||||||
|
if (status != F70_SUCCESS && status != F70_END_OF_FILE) {
|
||||||
|
abort();
|
||||||
|
} else {
|
||||||
|
struct f70s1ret *dir = f70->buf;
|
||||||
|
for (size_t i = 0; i < dir->cnt; i++) {
|
||||||
|
printf("%s\n", dir->bdfes[i].name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,7 +63,7 @@ void ls_range(struct f70s1arg *f70) {
|
|||||||
void ls_all(struct f70s1arg *f70) {
|
void ls_all(struct f70s1arg *f70) {
|
||||||
while (true) {
|
while (true) {
|
||||||
int status = kos_fuse_lfn(f70);
|
int status = kos_fuse_lfn(f70);
|
||||||
// printf("status = %d\n", status);
|
printf("status = %d\n", status);
|
||||||
if (status != F70_SUCCESS && status != F70_END_OF_FILE) {
|
if (status != F70_SUCCESS && status != F70_END_OF_FILE) {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
11
kolibri.asm
11
kolibri.asm
@ -6,6 +6,9 @@ __DEBUG_LEVEL__ = 1
|
|||||||
extrn malloc
|
extrn malloc
|
||||||
malloc fix __malloc
|
malloc fix __malloc
|
||||||
_malloc fix malloc
|
_malloc fix malloc
|
||||||
|
extrn free
|
||||||
|
free fix __free
|
||||||
|
_free fix free
|
||||||
include 'macros.inc'
|
include 'macros.inc'
|
||||||
include 'proc32.inc'
|
include 'proc32.inc'
|
||||||
include 'struct.inc'
|
include 'struct.inc'
|
||||||
@ -191,11 +194,15 @@ proc alloc_pages _cnt
|
|||||||
endp
|
endp
|
||||||
|
|
||||||
|
|
||||||
free:
|
__free:
|
||||||
|
ccall _free, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
proc kernel_free blah
|
proc kernel_free base
|
||||||
|
mov eax, [base]
|
||||||
|
call free
|
||||||
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user