]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - fatfs/doc/en/fdisk.html
Merge branch 'chan-fatfs' into fatfs-integration
[z180-stamp.git] / fatfs / doc / en / fdisk.html
index ad4e4fd67c33b589f1862f3515a1e7a53019f30d..6581d87cfb48b4d6dcc3e605a16362c6d4b76539 100644 (file)
@@ -16,9 +16,9 @@
 <p>The f_fdisk fucntion divides a physical drive.</p>\r
 <pre>\r
 FRESULT f_fdisk (\r
-  BYTE  <span class="arg">pdrv</span>,         <span class="c">/* [IN] Physical drive number */</span>\r
-  const DWORD <span class="arg">part[]</span>, <span class="c">/* [IN] Partition size */</span>\r
-  void* <span class="arg">work</span>          <span class="c">/* [IN] Work area */</span>\r
+  BYTE  <span class="arg">pdrv</span>,        <span class="c">/* [IN] Physical drive number */</span>\r
+  const DWORD* <span class="arg">szt</span>,  <span class="c">/* [IN] Partition map table */</span>\r
+  void* <span class="arg">work</span>         <span class="c">/* [IN] Work area */</span>\r
 );\r
 </pre>\r
 </div>\r
@@ -27,9 +27,9 @@ FRESULT f_fdisk (
 <h4>Parameters</h4>\r
 <dl class="par">\r
 <dt>pdrv</dt>\r
-<dd>Specifies the <em>physical drive</em> to be divided.</dd>\r
-<dt>part[]</dt>\r
-<dd>Partition map table. It must have four items.</dd>\r
+<dd>Specifies the <em>physical drive</em> to be divided. This is not the logical drive number but the drive identifier passed to the low level disk functions.</dd>\r
+<dt>szt</dt>\r
+<dd>Pointer to the first item of the partition map table.</dd>\r
 <dt>work</dt>\r
 <dd>Pointer to the function work area. The size must be at least <tt>_MAX_SS</tt> bytes.</dd>\r
 </dl>\r
@@ -48,7 +48,7 @@ FRESULT f_fdisk (
 \r
 <div class="para desc">\r
 <h4>Description</h4>\r
-<p>The <tt>f_fdisk()</tt> 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 <tt class="arg">part[]</tt> 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.</p>\r
+<p>The <tt>f_fdisk</tt> function creates partitions on the physical drive. The partitioning format is in generic FDISK format, so that it can create upto four primary partitions. Logical volumes in the extended partition is not supported. The partition map table 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 the partition size in percentage of the entire drive space. If it is larger than 100, it specifies the partition size in unit of sector. The partitions are located on the drive in order of from first item.</p>\r
 </div>\r
 \r
 <div class="para comp">\r
@@ -74,15 +74,10 @@ FRESULT f_fdisk (
     DWORD plist[] = {50, 50, 0, 0};  <span class="c">/* Divide drive into two partitions */</span>\r
     BYTE work[_MAX_SS];\r
 \r
-    f_fdisk(0, plist, work);    <span class="c">/* Divide physical drive 0 */</span>\r
+    f_fdisk(0, plist, work);                     <span class="c">/* Divide physical drive 0 */</span>\r
 \r
-    f_mount(&amp;fs, "0:", 0);      <span class="c">/* Register work area to the logical drive 0 */</span>\r
-    f_mkfs("0:", 0, 0);         <span class="c">/* Create FAT volume on the logical drive 0. 2nd argument is ignored. */</span>\r
-    f_mount(0, "0:", 0);        <span class="c">/* Unregister work area from the logical drive 0 */</span>\r
-\r
-    f_mount(&amp;fs, "1:", 0);      <span class="c">/* Register a work area to the logical drive 1 */</span>\r
-    f_mkfs("1:", 0, 0);         <span class="c">/* Create FAT volume on the logical drive 1. 2nd argument is ignored. */</span>\r
-    f_mount(0, "1:", 0);        <span class="c">/* Unregister work area from the logical drive 1 */</span>\r
+    f_mkfs("0:", FMT_ANY, work, sizeof work);    <span class="c">/* Create FAT volume on the logical drive 0 */</span>\r
+    f_mkfs("1:", FMT_ANY, work, sizeof work);    <span class="c">/* Create FAT volume on the logical drive 1 */</span>\r
 \r
 </pre>\r
 </div>\r