From 729692241dc1e019f15d2416bda4e681a446a553 Mon Sep 17 00:00:00 2001 From: Christopher Williams Date: Sat, 31 Jan 2015 10:46:56 -0700 Subject: [PATCH] Rename "FDISK" to "MBR" The partition format is called "MBR", not "FDISK". --- doc/en/fdisk.html | 2 +- doc/en/filename.html | 2 +- doc/en/mkfs.html | 6 +++--- doc/ja/fdisk.html | 2 +- doc/ja/mkfs.html | 6 +++--- src/ff.c | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/en/fdisk.html b/doc/en/fdisk.html index ad4e4fd..781ae1f 100644 --- a/doc/en/fdisk.html +++ b/doc/en/fdisk.html @@ -48,7 +48,7 @@ FRESULT f_fdisk (

Description

-

The f_fdisk() function creates a partition table into the MBR of the physical drive. The partitioning rule is in generic FDISK format, so that it can create upto four primary partitions. Logical volumes in the extended partition is not supported. The part[] with four items specifies how to divide the physical drive. The first item specifies the size of first primary partition and fourth item specifies the fourth primary partition. If the value is less than or equal to 100, it specifies percentage of the partition in the entire disk space. If it is larger than 100, it specifies the partition size in unit of sector.

+

The f_fdisk() function creates a partition table into the MBR of the physical drive. The partitioning rule is in generic MBR format, so that it can create upto four primary partitions. Logical volumes in the extended partition is not supported. The part[] with four items specifies how to divide the physical drive. The first item specifies the size of first primary partition and fourth item specifies the fourth primary partition. If the value is less than or equal to 100, it specifies percentage of the partition in the entire disk space. If it is larger than 100, it specifies the partition size in unit of sector.

diff --git a/doc/en/filename.html b/doc/en/filename.html index 49dcc2d..d15d40f 100644 --- a/doc/en/filename.html +++ b/doc/en/filename.html @@ -52,7 +52,7 @@


Volume Management

-

The FatFs module needs dynamic work area called file system object for each volume (logical drive). It is registered to the FatFs module by f_mount() function. By default, each logical drive is bound to the physical drive with the same drive number and an FAT volume on the drive is serched by auto detect feature. It loads boot sectors and checks it if it is an FAT boot sector in order of sector 0 as SFD format, 1st partition, 2nd partition, 3rd partition and 4th partition as FDISK format.

+

The FatFs module needs dynamic work area called file system object for each volume (logical drive). It is registered to the FatFs module by f_mount() function. By default, each logical drive is bound to the physical drive with the same drive number and an FAT volume on the drive is serched by auto detect feature. It loads boot sectors and checks it if it is an FAT boot sector in order of sector 0 as SFD format, 1st partition, 2nd partition, 3rd partition and 4th partition as MBR format.

When _MULTI_PARTITION == 1 is specified by configuration option, each individual logical drive is bound to the partition on the physical drive specified by volume management table. The volume management table must be defined by user to resolve relationship between logical drives and partitions. Following code is an example of a volume management table.

 Example: Logical drive 0-2 are tied to three pri-partitions on the physical drive 0 (fixed disk)
diff --git a/doc/en/mkfs.html b/doc/en/mkfs.html
index 5f733fa..6bb7c36 100644
--- a/doc/en/mkfs.html
+++ b/doc/en/mkfs.html
@@ -29,7 +29,7 @@ FRESULT f_mkfs (
 
path
Pinter to the null-terminated string that specifies the logical drive to be formatted. If there is no drive number, it means the default drive.
sfd
-
Specifies partitioning rule (FDISK(0) or SFD(1)). This argument will be ignored on some case.
+
Specifies partitioning rule (MBR(0) or SFD(1)). This argument will be ignored on some case.
au
Specifies size of the allocation unit (cluter) in number of bytes or sectors. When the value is from 1 to 128, it specifies number of sectors. When the value is >= _MIN_SS, it specifies number of bytes. If any invalid value, zero or not power of 2, is given, the cluster size is automatically determined depends on the volume size.
@@ -51,9 +51,9 @@ FRESULT f_mkfs (

Description

-

The f_mkfs() function creates an FAT volume on the specified logical drive. When FDISK format is specified, a primary partition occupies entire space of the physical drive is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.

+

The f_mkfs() function creates an FAT volume on the specified logical drive. When MBR format is specified, a primary partition occupies entire space of the physical drive is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.

If the logical drive is bound to the specific partition (1-4) by multiple partition feature (_MULTI_PARTITION), the FAT volume is created into the partition. In this case, the second argument sfd is ignored. The physical drive must have been partitioned with f_fdisk() function or any other partitioning tools prior to create the FAT volume with this function.

-

Note that there are two partitioning rules, FDISK and SFD. The FDISK partitioning is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable disk. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is usually used for floppy disk, Microdrive, optical disk and any type of super-floppy media.

+

Note that there are two partitioning rules, MBR and SFD. The MBR partitioning is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable disk. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is usually used for floppy disk, Microdrive, optical disk and any type of super-floppy media.

The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. The cluster size affects read/write throughput and space usage efficiency. Larger cluster size increases the read/write throughput and decreases the space usage efficiency of the volume.

In case of the number of clusters gets near the FAT sub-type boundaries, the function can fail with FR_MKFS_ABORTED.

diff --git a/doc/ja/fdisk.html b/doc/ja/fdisk.html index 53b6cbb..8cca3c9 100644 --- a/doc/ja/fdisk.html +++ b/doc/ja/fdisk.html @@ -48,7 +48,7 @@ FRESULT f_fdisk (

説明

-

この関数は、指定された物理ドライブのMBRに区画テーブルを作成します。区画分けは一般的なFDISK形式で行うため、最大4つの基本区画を作成することができます。拡張区画には対応していません。区画マップテーブルpart[]にはドライブをどのように分割するか指定して渡します。この配列は4つの項目から成り、先頭の項目が1番目の、最後の項目が4番目の区画のサイズを示します。値が100以下の場合、ドライブの総容量に対する割合をパーセント単位で指定します。100を超える値の場合はセクタ数の直接指定になります。

+

この関数は、指定された物理ドライブのMBRに区画テーブルを作成します。区画分けは一般的なMBR形式で行うため、最大4つの基本区画を作成することができます。拡張区画には対応していません。区画マップテーブルpart[]にはドライブをどのように分割するか指定して渡します。この配列は4つの項目から成り、先頭の項目が1番目の、最後の項目が4番目の区画のサイズを示します。値が100以下の場合、ドライブの総容量に対する割合をパーセント単位で指定します。100を超える値の場合はセクタ数の直接指定になります。

diff --git a/doc/ja/mkfs.html b/doc/ja/mkfs.html index 19b4341..e4f9fdd 100644 --- a/doc/ja/mkfs.html +++ b/doc/ja/mkfs.html @@ -29,7 +29,7 @@ FRESULT f_mkfs (
path
フォーマット対象の論理ドライブを示すパス名を示すヌル文字'\0'終端の文字列へのポインタを指定します。ドライブ番号を含まない場合は、カレント ドライブを意味します。
sfd
-
パーテーション形式。(0(FDISK) または 1(SFD))
+
パーテーション形式。(0(MBR) または 1(SFD))
au
クラスタ サイズをバイト数またはセクタ数で指定します。値が1~128の範囲場合は、セクタ数を示します。値が_MIN_SS以上の場合は、バイト数を示します。無効値(0または2の累乗でない値など)を指定した場合、ボリュームのサイズに応じたデフォルトのクラスタ サイズが自動選択されます。
@@ -49,9 +49,9 @@ FRESULT f_mkfs (

説明

-

物理ドライブ上にFATボリュームを作成します。FDISK形式が指定された場合は、物理ドライブ全体を占める基本区画(パーテーション)が作成され、その中にFATボリュームが作成されます。SFD形式では、FATボリュームが物理ドライブの先頭セクタからベタで作成されます。

+

物理ドライブ上にFATボリュームを作成します。MBR形式が指定された場合は、物理ドライブ全体を占める基本区画(パーテーション)が作成され、その中にFATボリュームが作成されます。SFD形式では、FATボリュームが物理ドライブの先頭セクタからベタで作成されます。

フォーマットする論理ドライブがマルチ パーテーション機能(_MULTI_PARTITION)によって特定の区画(1~4)に結び付けられている場合は、その区画の中にFATボリュームが作成されます。sfdは無視され、また対応する物理ドライブはこれに先立ち、f_fdisk()または他のツールで適切に区画設定されている必要があります。

-

パーテーション形式には、FDISK形式とSFD形式の二通りあります。FDISK形式は、ハードディスク、MMC、SDC、CFC、U Diskなどで標準的に使用されます。FDISK形式では一台の物理ドライブ上に一つまたは複数の区画を作成することができます。区画管理情報はMBR(物理ドライブの先頭セクタ)に記録されます。SFD形式は単に何の分割も行わない形式で、ボリュームは物理ドライブの先頭セクタから開始します。SFD形式は、フロッピー ディスク、マイクロドライブ、光学ディスク、およびその他スーパー フロッピー メディアで標準的に使用されています。

+

パーテーション形式には、MBR形式とSFD形式の二通りあります。MBR形式は、ハードディスク、MMC、SDC、CFC、U Diskなどで標準的に使用されます。MBR形式では一台の物理ドライブ上に一つまたは複数の区画を作成することができます。区画管理情報はMBR(物理ドライブの先頭セクタ)に記録されます。SFD形式は単に何の分割も行わない形式で、ボリュームは物理ドライブの先頭セクタから開始します。SFD形式は、フロッピー ディスク、マイクロドライブ、光学ディスク、およびその他スーパー フロッピー メディアで標準的に使用されています。

FATタイプ(FAT12/FAT16/FAT32)は、そのボリューム上のクラスタ数によってのみ決定される決まり[FAT仕様書より]になっていて、それ以外の要因はありません。したがって、どのFATタイプになるかはボリューム サイズとクラスタ サイズに依存します。クラスタ サイズは大きくするほど性能が上がります。

クラスタ数がFATタイプの境界に近くなるときは、FR_MKFS_ABORTEDで関数が失敗する可能性があります。

diff --git a/src/ff.c b/src/ff.c index 733025c..ba81394 100644 --- a/src/ff.c +++ b/src/ff.c @@ -2233,7 +2233,7 @@ FRESULT find_volume ( /* FR_OK(0): successful, !=0: any error occurred */ if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK || SS(fs) < _MIN_SS || SS(fs) > _MAX_SS) return FR_DISK_ERR; #endif - /* Find an FAT partition on the drive. Supports only generic partitioning, FDISK and SFD. */ + /* Find an FAT partition on the drive. Supports only generic partitioning, MBR and SFD. */ bsect = 0; fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT boot sector as SFD */ if (fmt == 1 || (!fmt && (LD2PT(vol)))) { /* Not an FAT boot sector or forced partition number */ @@ -3997,7 +3997,7 @@ FRESULT f_forward ( FRESULT f_mkfs ( const TCHAR* path, /* Logical drive number */ - BYTE sfd, /* Partitioning rule 0:FDISK, 1:SFD */ + BYTE sfd, /* Partitioning rule 0:MBR, 1:SFD */ UINT au /* Size of allocation unit in unit of byte or sector */ ) { @@ -4117,7 +4117,7 @@ FRESULT f_mkfs ( } else { if (sfd) { /* No partition table (SFD) */ md = 0xF0; - } else { /* Create partition table (FDISK) */ + } else { /* Create partition table (MBR) */ mem_set(fs->win, 0, SS(fs)); tbl = fs->win+MBR_Table; /* Create partition table for single partition in the drive */ tbl[1] = 1; /* Partition start head */