diff --git a/img/makefile b/img/makefile index 0c3cdd3..9029f27 100644 --- a/img/makefile +++ b/img/makefile @@ -8,7 +8,7 @@ TEMP_DIR:=$(shell mktemp -d) all: s05k s4k unicode v5 kolibri.img fat32_test0.img coverage 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 @@ -27,14 +27,14 @@ kolibri.img: ../default.skn jfs.img: fallocate -l 16MiB $@ mkfs.jfs -q $@ - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% xfs_borg_bit.img: fallocate -l 16MiB $@ mkfs.xfs -n version=ci $@ - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -52,7 +52,7 @@ xfs_short_dir_i8.img: $(MKDIRRANGE) $(TEMP_DIR)/sf/d0000000002_xx 7 10 0 244 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -83,7 +83,7 @@ xfs_v4_ftype0_s05k_b2k_n8k.img: $(MKDIRRANGE) $(TEMP_DIR)/btree_leaf_free 0 1200 201 43 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -114,7 +114,7 @@ xfs_v4_ftype1_s05k_b2k_n8k.img: $(MKDIRRANGE) $(TEMP_DIR)/btree_leaf_free 0 1200 201 43 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -137,7 +137,7 @@ xfs_v4_xattr.img: $(MKDIRRANGE) $(TEMP_DIR)/btree 0 600 0 244 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -158,7 +158,7 @@ xfs_v4_btrees_l2.img: $(MKFILEPATTERN) $(TEMP_DIR)/file_btree_l2 0 16388096 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -193,7 +193,7 @@ xfs_v4_files_s05k_b4k_n8k.img: $(MKFILEPATTERN) $(TEMP_DIR)/4GiB_plus 0x4000 0x4000 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -224,7 +224,7 @@ xfs_v4_ftype0_s4k_b4k_n8k.img: $(MKDIRRANGE) $(TEMP_DIR)/btree_leaf_free 0 1200 201 43 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ sudo losetup -b 4096 /dev/loop8 $@ sudo parted --script /dev/loop8 mktable gpt sudo parted --script --align optimal /dev/loop8 mkpart primary 1MiB 100% @@ -266,7 +266,7 @@ xfs_v4_ftype0_s05k_b2k_n8k_xattr.img: $(MKDIRRANGE) $(TEMP_DIR)/btree_leaf_free 0 1200 201 43 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -291,7 +291,7 @@ xfs_v4_unicode.img: echo привет❦💗мир > $(TEMP_DIR)/дир3/файл33 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -322,7 +322,7 @@ xfs_v5_ftype1_s05k_b2k_n8k.img: $(MKDIRRANGE) $(TEMP_DIR)/btree_leaf_free 0 1200 201 43 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -351,7 +351,7 @@ xfs_v5_files_s05k_b4k_n8k.img: $(MKFILEPATTERN) $(TEMP_DIR)/btree_l1_no_hole 0 8196096 # sudo umount $(TEMP_DIR) - fallocate -i -o 0 -l 1MiB $@ + fallocate -i -o 0 -l 1MiB $@ parted --script $@ mktable gpt parted --script --align optimal $@ mkpart primary 1MiB 100% @@ -365,4 +365,15 @@ fat32_test0.img: du -sh $(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% diff --git a/shell.c b/shell.c index 0de6566..9c213cc 100644 --- a/shell.c +++ b/shell.c @@ -324,6 +324,8 @@ disk_list_partitions(disk_t *d) { fputs("ext\n", fout); } else if (d->partitions[i]->fs_user_functions == fat_user_functions) { 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) { fputs("ntfs\n", fout); } else { diff --git a/test/016_#f01_#draw_all.ref.log b/test/016_#f01_#draw_all.ref.log index a021a8a..faf7d65 100644 --- a/test/016_#f01_#draw_all.ref.log +++ b/test/016_#f01_#draw_all.ref.log @@ -34,7 +34,7 @@ font smoothing: 0 - off 0x00586786 frame 0x00fefefe grab 0x00c5bdb9 work_3d_dark -0x00ece9e5 work_3d_light +0x00f2efec work_3d_light 0x00333333 grab_text 0x00ddd7cf work 0x007887a6 work_button diff --git a/test/046_#f70_#f70s1_#fat_#exfat_#s05k_ls.ref.log b/test/046_#f70_#f70s1_#fat_#exfat_#s05k_ls.ref.log new file mode 100644 index 0000000..3d9cca4 --- /dev/null +++ b/test/046_#f70_#f70s1_#fat_#exfat_#s05k_ls.ref.log @@ -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 diff --git a/test/046_#f70_#f70s1_#fat_#exfat_#s05k_ls.t b/test/046_#f70_#f70s1_#fat_#exfat_#s05k_ls.t new file mode 100644 index 0000000..6946c00 --- /dev/null +++ b/test/046_#f70_#f70s1_#fat_#exfat_#s05k_ls.t @@ -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 diff --git a/test/makefile b/test/makefile index 572f701..ee7524f 100644 --- a/test/makefile +++ b/test/makefile @@ -9,6 +9,7 @@ UMKA_SHELL ?= sudo taskset 1 ../umka_shell -c endif 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))) s4k_tests := $(addsuffix .out.log, $(basename $(wildcard *\#s4k_*.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))) 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 xfs: $(xfs_tests) +exfat: $(exfat_tests) s05k: $(s05k_tests) s4k: $(s4k_tests) f30: $(f30_tests) diff --git a/umka.asm b/umka.asm index 3b871f9..c32db39 100644 --- a/umka.asm +++ b/umka.asm @@ -87,6 +87,7 @@ pubsym disk_media_changed, 8 pubsym xfs._.user_functions, 'xfs_user_functions' pubsym ext_user_functions pubsym fat_user_functions +pubsym exFAT_user_functions, 'exfat_user_functions' pubsym ntfs_user_functions pubsym i40, no_mangle @@ -852,10 +853,8 @@ macro format [x] {} include 'kernel.asm' -purge org,mov -restore add,org,mov -purge sys_msg_board,delay_ms -restore sys_msg_board,delay_ms +purge org,sys_msg_board,delay_ms +restore org,sys_msg_board,delay_ms coverage_end: diff --git a/umka.h b/umka.h index e13d703..7c6f3dd 100644 --- a/umka.h +++ b/umka.h @@ -433,6 +433,7 @@ hash_oneshot(void *ctx, void *data, size_t len); extern uint8_t xfs_user_functions[]; extern uint8_t ext_user_functions[]; extern uint8_t fat_user_functions[]; +extern uint8_t exfat_user_functions[]; extern uint8_t ntfs_user_functions[]; extern uint8_t kos_ramdisk[2880*512];