Format and FatInfo utilities for VSOS

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
User avatar
Henrik
VLSI Staff
Posts: 1041
Joined: Tue 2010-06-22 14:10

Format and FatInfo utilities for VSOS

Post by Henrik » Thu 2017-04-27 10:31

Hello Forumers!

FORMAT.DL3

Attached to this message is a brand-new utility FORMAT.DL3. With Format, you may format an SD card (or USB stick, although this is still untested) into FAT32 format. Optionally, an MBR partition table may be added to the device.

The main benefit is that Format makes it possible to format SD cards 64 GB and larger to FAT32. All current versions of Microsoft Windows only allow formatting large cards to its proprietary and patent-minefielded exFAT format which VSOS doesn't at least currently support. Large cards also seem to be preformatted with exFAT. With Format, you can reformat them to FAT32, then use them as usual. Cards formatted with Format can also be read from and written to using Microsoft Windows operating systems.

Code: Select all

Usage: Format x: [-v|+v|-llabel|-sx|-cx|-fx|-ix|-p|-px|-F|-y|+y|-h]
x:      Drive name
-v|+v   Verbose on/off
-llabel Set disk label
-sx     Force size to x MiB
-cx     Force cluster size to x 512-byte sectors
-fx     Set number of FATs (1 or 2)
-ix     Set 32-bit serial number volume ID to x
-p|+p   Make/don't make partition table
-px     Reserve x MiB for partition table
-F|+F   Force / don't force making file system even if illegal
-y|+y   Don't ask / Ask for confirmation
-n|+n   Dry run (don't actually write) on/off
-a|+a   Erase (very slow) / Don't erase all data
-h      Show this help
Example run for a 64 GB Lexar card:

Code: Select all

S:>format d:
Raw disk geometry:  125302784 sectors (61183 MiB = 59.7 GiB), 1 sect per block
  sectors 125302784, sectorsPerCluster 64, clusters 1957600
  numberOfFats 1, sectorsPerFat 15294, reservedSectors 1090
  startOfFat 0, startOfFileSystem startOfFat+16384
  serialID 0x0153a38b
Are you sure you want to format drive D:? All data will be lost! (Y/N)
Writing FAT32 information (8.0 MiB of data)...
Formatted capacity: 125286400 sectors (61175 MiB = 59.7 GiB)
S:>
FATINFO.DL3

FATINFO.DL3 is a debug tool that displays many parameters of a FAT32 file system. It can also display contents of individual disk sectors. Use the "-v" option to add FatInfo's verbosity.

Code: Select all

Usage: FatInfo x: [blkNum] [-v|+v|-h]
x:      Drive name
blkNum  Print contents of block number
-v|+v   Verbose on/off
-h      Show this help
Example run for the same 64 GB Lexar card after formatting with Format:

Code: Select all

S:>fatinfo d:
FAT FOUND IN ROOT BLOCK
  Fat32:
    Jump Code + NOP:  eb 58 90
    OEM Name:  76 6c 73 69 64 69 73 6b "vlsidisk"
    Bytes Per Sector 512
    Sectors Per Cluster 64
    Reserved Sectors 1090
    Number Of FATs 1
    16-bit Number of Sectors per FAT 0
    Media Descriptor (0xf8 for HDs) 0xf8
    16-bit FAT size 0
    Sectors Per Track 61
    Number of Heads 31
    Number of Hidden Sectors in Partition 0
    32-bit Number of Sectors in Partition 125302784
    32-bit Number of Sectors per FAT 15294
    Flags 0x0
    Version of FAT32 Drive 0x0
    Cluster Number of the Start of the Root Directory 2
    Sector Number of the FileSystem Information Sector 1
    Sector Number of the Backup Boot Sector 6
    Logical Drive Number of Partition 128
    Extended Signature (0x29) 0x29
    Serial Number of Partition 0x153a38b
    Volume name of Partition: 56 53 4f 53 20 20 20 20 20 20 20 "VSOS       "
    Boot Record Signature (0x55 0xaa) 0x55 0xaa
  Fat32_2:
    First Signature (0x52 0x52 0x61 0x41) 0x52 0x52 0x61 0x41
    Signature of FSInfo Sector (0x72 0x72 0x41 0x61) 0x72 0x72 0x41 0x61
    Number of Free Clusters 0xffffffff
    Most Recently Allocated Cluster 0x00000002
    Boot Record Signature (0x55 0xaa) 0x55 0xaa
fatStart 1090, fatSize 15294, rootStart 16384
S:>
Kind regards,
- Henrik
Attachments
Format.zip
Format utility for VSOS. Either copy Format.dl3 to your SYS/ folder, or recompile the whole solution using VSIDE.
(36.18 KiB) Downloaded 20 times
FatInfo.zip
FatInfo utility for VSOS. Either copy FatInfo.dl3 to your SYS/ folder, or recompile the whole solution using VSIDE.
(19.68 KiB) Downloaded 22 times
Good signatures never die. They just fade away.

User avatar
Henrik
VLSI Staff
Posts: 1041
Joined: Tue 2010-06-22 14:10

Re: Format and FatInfo utilities for VSOS

Post by Henrik » Tue 2017-05-23 14:46

The new utilities are now an integral part of the VSOS 3.42 Root and Libraries Source Code package, available at the end of this thread:
viewtopic.php?t=680

Kind regards,
- Henrik
Good signatures never die. They just fade away.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider]