Add a basic exfat test.

This commit is contained in:
Ivan Baravy 2022-03-12 00:08:20 +04:00
parent c5dd1673af
commit d59c8d5f55
8 changed files with 99 additions and 20 deletions

View File

@ -8,7 +8,7 @@ TEMP_DIR:=$(shell mktemp -d)
all: s05k s4k unicode v5 kolibri.img fat32_test0.img coverage all: s05k s4k unicode v5 kolibri.img fat32_test0.img coverage
rmdir $(TEMP_DIR) rmdir $(TEMP_DIR)
s05k: xfs_v4_ftype0_s05k_b2k_n8k.img xfs_v4_ftype1_s05k_b2k_n8k.img xfs_v4_xattr.img xfs_v4_files_s05k_b4k_n8k.img xfs_v4_ftype0_s05k_b2k_n8k_xattr.img xfs_v4_btrees_l2.img xfs_short_dir_i8.img s05k: xfs_v4_ftype0_s05k_b2k_n8k.img xfs_v4_ftype1_s05k_b2k_n8k.img xfs_v4_xattr.img xfs_v4_files_s05k_b4k_n8k.img xfs_v4_ftype0_s05k_b2k_n8k_xattr.img xfs_v4_btrees_l2.img xfs_short_dir_i8.img exfat_s05k_c16k_b16k.img
s4k: xfs_v4_ftype0_s4k_b4k_n8k.img s4k: xfs_v4_ftype0_s4k_b4k_n8k.img
@ -365,4 +365,15 @@ fat32_test0.img:
du -sh $(TEMP_DIR) du -sh $(TEMP_DIR)
sudo umount $(TEMP_DIR) sudo umount $(TEMP_DIR)
exfat_s05k_c16k_b16k.img:
fallocate -l 64MiB $@
mkfs.exfat -L KOLIBRIOS -c 16k -b 16k $@
sudo mount -o codepage=866,iocharset=utf8,umask=111,dmask=000 $@ $(TEMP_DIR)
mkdir $(TEMP_DIR)/dir_empty
mkdir $(TEMP_DIR)/dir_one
touch $(TEMP_DIR)/dir_one/file000
sudo umount $(TEMP_DIR)
fallocate -i -o 0 -l 1MiB $@
parted --script $@ mktable msdos
parted --script --align optimal $@ mkpart primary 1MiB 100%

View File

@ -324,6 +324,8 @@ disk_list_partitions(disk_t *d) {
fputs("ext\n", fout); fputs("ext\n", fout);
} else if (d->partitions[i]->fs_user_functions == fat_user_functions) { } else if (d->partitions[i]->fs_user_functions == fat_user_functions) {
fputs("fat\n", fout); fputs("fat\n", fout);
} else if (d->partitions[i]->fs_user_functions == exfat_user_functions) {
fputs("exfat\n", fout);
} else if (d->partitions[i]->fs_user_functions == ntfs_user_functions) { } else if (d->partitions[i]->fs_user_functions == ntfs_user_functions) {
fputs("ntfs\n", fout); fputs("ntfs\n", fout);
} else { } else {

View File

@ -34,7 +34,7 @@ font smoothing: 0 - off
0x00586786 frame 0x00586786 frame
0x00fefefe grab 0x00fefefe grab
0x00c5bdb9 work_3d_dark 0x00c5bdb9 work_3d_dark
0x00ece9e5 work_3d_light 0x00f2efec work_3d_light
0x00333333 grab_text 0x00333333 grab_text
0x00ddd7cf work 0x00ddd7cf work
0x007887a6 work_button 0x007887a6 work_button

View File

@ -0,0 +1,44 @@
/> umka_init
/> disk_add ../img/exfat_s05k_c16k_b16k.img hd0 -c 0
/hd0/1: exfat
/> ls70 /hd0/1/dir_empty -f 0 -c 0
/> ls70 /hd0/1/dir_empty -f 0 -c 1
status = 0 success, count = 1
----f ..
/> ls70 /hd0/1/dir_empty -f 0 -c 2
status = 6 end_of_file, count = 1
----f ..
/> ls70 /hd0/1/dir_empty -f 0 -c 0xffffffff
status = 6 end_of_file, count = 1
----f ..
/> ls70 /hd0/1/dir_empty -f 1 -c 0
/> ls70 /hd0/1/dir_empty -f 1 -c 1
status = 6 end_of_file, count = 0
/> ls70 /hd0/1/dir_empty -f 1 -c 2
status = 6 end_of_file, count = 0
/> ls70 /hd0/1/dir_empty -f 1 -c 0xffffffff
status = 6 end_of_file, count = 0
/> ls70 /hd0/1/dir_one -f 0 -c 0
/> ls70 /hd0/1/dir_one -f 0 -c 1
status = 0 success, count = 1
----f ..
/> ls70 /hd0/1/dir_one -f 0 -c 2
status = 0 success, count = 2
----f ..
----- file000
/> ls70 /hd0/1/dir_one -f 0 -c 0xffffffff
status = 6 end_of_file, count = 2
----f ..
----- file000
/> ls70 /hd0/1/dir_one -f 1 -c 0
/> ls70 /hd0/1/dir_one -f 1 -c 1
status = 0 success, count = 1
----- file000
/> ls70 /hd0/1/dir_one -f 1 -c 2
status = 6 end_of_file, count = 1
----- file000
/> ls70 /hd0/1/dir_one -f 1 -c 0xffffffff
status = 6 end_of_file, count = 1
----- file000
/> disk_del hd0

View File

@ -0,0 +1,20 @@
umka_init
disk_add ../img/exfat_s05k_c16k_b16k.img hd0 -c 0
ls70 /hd0/1/dir_empty -f 0 -c 0
ls70 /hd0/1/dir_empty -f 0 -c 1
ls70 /hd0/1/dir_empty -f 0 -c 2
ls70 /hd0/1/dir_empty -f 0 -c 0xffffffff
ls70 /hd0/1/dir_empty -f 1 -c 0
ls70 /hd0/1/dir_empty -f 1 -c 1
ls70 /hd0/1/dir_empty -f 1 -c 2
ls70 /hd0/1/dir_empty -f 1 -c 0xffffffff
ls70 /hd0/1/dir_one -f 0 -c 0
ls70 /hd0/1/dir_one -f 0 -c 1
ls70 /hd0/1/dir_one -f 0 -c 2
ls70 /hd0/1/dir_one -f 0 -c 0xffffffff
ls70 /hd0/1/dir_one -f 1 -c 0
ls70 /hd0/1/dir_one -f 1 -c 1
ls70 /hd0/1/dir_one -f 1 -c 2
ls70 /hd0/1/dir_one -f 1 -c 0xffffffff
disk_del hd0

View File

@ -9,6 +9,7 @@ UMKA_SHELL ?= sudo taskset 1 ../umka_shell -c
endif endif
xfs_tests := $(addsuffix .out.log, $(basename $(wildcard *\#xfs_*.t))) xfs_tests := $(addsuffix .out.log, $(basename $(wildcard *\#xfs_*.t)))
exfat_tests := $(addsuffix .out.log, $(basename $(wildcard *\#exfat_*.t)))
s05k_tests := $(addsuffix .out.log, $(basename $(wildcard *\#s05k_*.t))) s05k_tests := $(addsuffix .out.log, $(basename $(wildcard *\#s05k_*.t)))
s4k_tests := $(addsuffix .out.log, $(basename $(wildcard *\#s4k_*.t))) s4k_tests := $(addsuffix .out.log, $(basename $(wildcard *\#s4k_*.t)))
f30_tests := $(addsuffix .out.log, $(basename $(wildcard *\#f30_*.t))) f30_tests := $(addsuffix .out.log, $(basename $(wildcard *\#f30_*.t)))
@ -28,10 +29,11 @@ net_tests := $(addsuffix .out.log, $(basename $(wildcard *\#net_*.t)))
arp_tests := $(addsuffix .out.log, $(basename $(wildcard *\#arp_*.t))) arp_tests := $(addsuffix .out.log, $(basename $(wildcard *\#arp_*.t)))
acpi_tests := $(addsuffix .out.log, $(basename $(wildcard *\#acpi_*.t))) acpi_tests := $(addsuffix .out.log, $(basename $(wildcard *\#acpi_*.t)))
all: xfs s05k s4k f30 f70 f70s0 f70s1 f70s5 lookup bug xattr unicode v5 draw coverage i40 net arp acpi all: xfs exfat s05k s4k f30 f70 f70s0 f70s1 f70s5 lookup bug xattr unicode v5 draw coverage i40 net arp acpi
@echo all tests passed @echo all tests passed
xfs: $(xfs_tests) xfs: $(xfs_tests)
exfat: $(exfat_tests)
s05k: $(s05k_tests) s05k: $(s05k_tests)
s4k: $(s4k_tests) s4k: $(s4k_tests)
f30: $(f30_tests) f30: $(f30_tests)

View File

@ -87,6 +87,7 @@ pubsym disk_media_changed, 8
pubsym xfs._.user_functions, 'xfs_user_functions' pubsym xfs._.user_functions, 'xfs_user_functions'
pubsym ext_user_functions pubsym ext_user_functions
pubsym fat_user_functions pubsym fat_user_functions
pubsym exFAT_user_functions, 'exfat_user_functions'
pubsym ntfs_user_functions pubsym ntfs_user_functions
pubsym i40, no_mangle pubsym i40, no_mangle
@ -852,10 +853,8 @@ macro format [x] {}
include 'kernel.asm' include 'kernel.asm'
purge org,mov purge org,sys_msg_board,delay_ms
restore add,org,mov restore org,sys_msg_board,delay_ms
purge sys_msg_board,delay_ms
restore sys_msg_board,delay_ms
coverage_end: coverage_end:

1
umka.h
View File

@ -433,6 +433,7 @@ hash_oneshot(void *ctx, void *data, size_t len);
extern uint8_t xfs_user_functions[]; extern uint8_t xfs_user_functions[];
extern uint8_t ext_user_functions[]; extern uint8_t ext_user_functions[];
extern uint8_t fat_user_functions[]; extern uint8_t fat_user_functions[];
extern uint8_t exfat_user_functions[];
extern uint8_t ntfs_user_functions[]; extern uint8_t ntfs_user_functions[];
extern uint8_t kos_ramdisk[2880*512]; extern uint8_t kos_ramdisk[2880*512];