Search
Sunday, 15th of April 2018, 5:29:10 UTC
11:29:10
ebrasca
froggey: Hi , I have done PR.
16:59:15
froggey
ebrasca: I can't mount my test image
16:59:40
froggey
Disk read error: :TOO-MANY-SECTORS
17:00:43
froggey
it's a 256MiB image created with "dd if=/dev/zero of=test.image count=256k bs=1024 && mkfs.vfat -F 32 test.image"
17:01:34
froggey
read-fat calls read-sector with n=4033/2
17:01:46
ebrasca
Can you mount it with you OS?
17:02:32
ebrasca
mmm maybe fat32 don't allways have 2 FAT.
17:03:30
ebrasca
2 come from fat32-table-count
17:05:00
froggey
table-size-32 is 4033 and table-count is 2
17:05:38
ebrasca
I don't understand why "Disk read error: :TOO-MANY-SECTORS"
17:07:41
froggey
it's trying to read too many sectors at once with disk-read. the disk supports reading up to 256 sectors
17:08:23
froggey
and it's trying to read a non-integer number of sectors, which is definitely invalid. I'll add a check for that in the disk code
17:09:29
ebrasca
In my case table-size-32 is 8992 and table-count is 2.
17:10:14
ebrasca
froggey: Are you sure it it fat32 and not other fat*
17:10:50
froggey
I told mkfs to create a fat32 image, that's the "-F 32" option
17:11:56
ebrasca
It need to have some number of cluster to be fat32.
17:12:14
froggey
your disk is probably lba48-capable, which supports reading up to 65k sectors at once
17:17:29
ebrasca
Yo be fat32 it need to have more than 65525 clusters.
17:18:02
ebrasca
Thanks for testing and reporting 1 problems.
17:20:01
ebrasca
For now i don't understand how to read and write FAT in smaller parts.
17:21:43
froggey
you can read sectors in a loop
17:22:01
froggey
read sectors one by one and copy them into the result array
17:22:20
ebrasca
And after how do you write it?
17:24:26
froggey
the same, but the other way around. for each sector, copy one sector out of your source array into a temporary array, then write that sector
17:27:03
ebrasca
I think you have solve my problem of how to write files to disk with sizes bigger than 1 cluster.
17:27:41
froggey
something like this: https://gist.github.com/froggey/9708b2e073648263b48672a8d6d0e985
Sunday, 15th of April 2018, 17:29:10 UTC