Browse Source

Import

master
Ondřej Hruška 4 years ago
commit
c847120dbc
Signed by: MightyPork GPG Key ID: 2C5FD5035250423D
  1. BIN
      F072B_DISCO/Analog_adc-input-noise.pdf
  2. BIN
      F072B_DISCO/F0 prog manual.pdf
  3. BIN
      F072B_DISCO/F072_discovery_RM.pdf
  4. BIN
      F072B_DISCO/F072x8,xB.pdf
  5. BIN
      F072B_DISCO/F0x1,2,8 RM.pdf
  6. BIN
      F072B_DISCO/Raspberry-Pi-Zero.pdf
  7. BIN
      F072B_DISCO/STM32L4_TSC_ppt.pdf
  8. BIN
      F072B_DISCO/STM32L4_timers_ppt.pdf
  9. BIN
      F072B_DISCO/STM32_Lec6.pdf
  10. BIN
      F072B_DISCO/an_Timers_cookbook.pdf
  11. BIN
      F072B_DISCO/en.CD00177113 oversampling adc.pdf
  12. BIN
      F072B_DISCO/en.CD00259245 dac audio.pdf
  13. BIN
      F072B_DISCO/en.STM32F7_WDG_TIMERS_GPTIM.pdf
  14. BIN
      F072B_DISCO/en.STM32L4_Peripheral_Touchsense.pdf
  15. BIN
      F072B_DISCO/f072_afs.pdf
  16. BIN
      F072B_DISCO/mh-z19b-co2-ver1_0.pdf
  17. BIN
      F072B_DISCO/navrhZadani.pdf
  18. BIN
      F103_BLUEPILL/0.jpg
  19. BIN
      F103_BLUEPILL/F103.pdf
  20. BIN
      F103_BLUEPILL/F103x8,B.pdf
  21. BIN
      F103_BLUEPILL/F10x ref manual.pdf
  22. BIN
      F103_BLUEPILL/F1xx flash pgm manual.pdf
  23. BIN
      F103_BLUEPILL/bluepill-schematic.pdf
  24. BIN
      F103_BLUEPILL/schematic.jpg
  25. BIN
      F103_BLUEPILL/stm32f103 errata.pdf
  26. BIN
      F303_DISCO/Discovery F3 periph examples.pdf
  27. BIN
      F303_DISCO/Discovery F303 schema.pdf
  28. BIN
      F303_DISCO/Discovery F303.pdf
  29. BIN
      F303_DISCO/F3 ref manual.pdf
  30. BIN
      F303_DISCO/F303xB,C.pdf
  31. BIN
      F407_DISCO/F4-appnote-AUDIO.pdf
  32. BIN
      F407_DISCO/F4-audio-decoding.pdf
  33. BIN
      F407_DISCO/F4-disco-UM-getting_started.pdf
  34. BIN
      F407_DISCO/F4-disco-UM.pdf
  35. BIN
      F407_DISCO/F4-disco.pdf
  36. BIN
      F407_DISCO/F4-migration.pdf
  37. BIN
      F407_DISCO/F407_DS.pdf
  38. BIN
      F407_DISCO/F4_RM.pdf
  39. BIN
      L432_NUCLEO/L432 errata.pdf
  40. BIN
      L432_NUCLEO/L432 ref manual.pdf
  41. BIN
      L432_NUCLEO/L432.pdf
  42. BIN
      L432_NUCLEO/Small_Nucleo.pdf
  43. BIN
      L432_NUCLEO/nucleo32l432kc_mbed_pinout_v3_.png
  44. BIN
      component-datasheets/F072x8,xB.pdf
  45. BIN
      component-datasheets/F0x1,2,8 RM.pdf
  46. BIN
      component-datasheets/cap10uf-48923393847140904892335692597769lmk316ab7106ml-t_ss.pdf.pdf
  47. BIN
      component-datasheets/esd-11265.pdf
  48. BIN
      component-datasheets/ld3985-ldo33small-13475800261421539.pdf
  49. BIN
      component-datasheets/ldo33-168346138795742az1117.pdf
  50. BIN
      component-datasheets/rs485-1238662599727145285678fg.pdf
  51. BIN
      component-datasheets/usb-a-1782329398044234up2-ah-th.pdf
  52. BIN
      component-datasheets/usb-micro-40474642682600710118194.pdf
  53. BIN
      component-datasheets/usb-mini-391167168305991391164671226288ux_catalog.pdf.pdf
  54. BIN
      component-datasheets/xtal-8mhz-7a_c.pdf
  55. BIN
      early-sketch.jpg
  56. BIN
      en.DM00095744_L0x3 RM.pdf
  57. BIN
      en.DM00105823_nucleos UM.pdf
  58. BIN
      en.DM00105918_nucleos.pdf
  59. 181865
      en.DM00108281_L0x2 RM.pdf
  60. BIN
      en.DM00141036_stm32l073_ds.pdf
  61. BIN
      gex-drawings.ora
  62. BIN
      inteligent-sensors.jpg
  63. BIN
      nRF24L01P_Product_Specification_1_0.pdf
  64. BIN
      pi0/Rainbow-HAT-Manual-1.pdf
  65. BIN
      pi0/Raspberry-Pi-Zero.pdf
  66. BIN
      pi0/btn=hole.jpg
  67. BIN
      pi0/btn=smd.jpg
  68. BIN
      pi0/btn=smd2.jpg
  69. BIN
      pi0/rpi_MECH_Zero_1p2.pdf
  70. BIN
      references/AD9834.pdf
  71. BIN
      references/AD_all-about-direct-digital-synthesis.pdf
  72. BIN
      references/AN10033-Frequency-Measurement-Guidelines-for-Oscillators.pdf
  73. BIN
      references/AN1080.pdf
  74. BIN
      references/DS1820.pdf
  75. BIN
      references/FAT16/FAT12Description_www.dfists.ua.es_~gil.pdf
  76. 517
      references/FAT16/FAT16 Structure Information.html
  77. 1304
      references/FAT16/FAT32 Structure Information.html
  78. 580
      references/FAT16/Long Filename Specification.html
  79. BIN
      references/FAT16/MS_fatgen102.pdf
  80. 319
      references/FAT16/Maverick FAT16 reference/Maverick - FAT16 - LFN.html
  81. 816
      references/FAT16/Maverick FAT16 reference/Maverick - FAT16 structure.html
  82. 323
      references/FAT16/Maverick FAT16 reference/Maverick.css
  83. 944
      references/FAT16/Phobos FAT16 tutorial/Photos FAT tutorial.html
  84. BIN
      references/FAT16/Phobos FAT16 tutorial/images/bootblk.jpg
  85. BIN
      references/FAT16/Phobos FAT16 tutorial/images/bootblk1.jpg
  86. BIN
      references/FAT16/Phobos FAT16 tutorial/images/bootblk2.jpg
  87. BIN
      references/FAT16/Phobos FAT16 tutorial/images/datablk1.jpg
  88. BIN
      references/FAT16/Phobos FAT16 tutorial/images/datablk2.jpg
  89. BIN
      references/FAT16/Phobos FAT16 tutorial/images/datablk3.jpg
  90. BIN
      references/FAT16/Phobos FAT16 tutorial/images/datablk4.jpg
  91. BIN
      references/FAT16/Phobos FAT16 tutorial/images/fat.jpg
  92. BIN
      references/FAT16/Phobos FAT16 tutorial/images/rootdir.jpg
  93. BIN
      references/FAT16/Phobos FAT16 tutorial/images/rootdir1.jpg
  94. BIN
      references/FAT16/Phobos FAT16 tutorial/images/rootdir2.jpg
  95. BIN
      references/FAT16/Phobos FAT16 tutorial/images/rootdir3.jpg
  96. 306
      references/FAT16/Phobos FAT16 tutorial/phobos.css
  97. BIN
      references/FAT16/fatgen103.pdf
  98. BIN
      references/Raspberry-Pi-Zero-mech.pdf
  99. BIN
      references/SD__Part_1_Physical_Layer_Simplified_Specification_Ver_3.01_Final_100518.pdf
  100. BIN
      references/STM32/F072x8,xB.pdf

BIN
F072B_DISCO/Analog_adc-input-noise.pdf

Binary file not shown.

BIN
F072B_DISCO/F0 prog manual.pdf

Binary file not shown.

BIN
F072B_DISCO/F072_discovery_RM.pdf

Binary file not shown.

BIN
F072B_DISCO/F072x8,xB.pdf

Binary file not shown.

BIN
F072B_DISCO/F0x1,2,8 RM.pdf

Binary file not shown.

BIN
F072B_DISCO/Raspberry-Pi-Zero.pdf

Binary file not shown.

BIN
F072B_DISCO/STM32L4_TSC_ppt.pdf

Binary file not shown.

BIN
F072B_DISCO/STM32L4_timers_ppt.pdf

Binary file not shown.

BIN
F072B_DISCO/STM32_Lec6.pdf

Binary file not shown.

BIN
F072B_DISCO/an_Timers_cookbook.pdf

Binary file not shown.

BIN
F072B_DISCO/en.CD00177113 oversampling adc.pdf

Binary file not shown.

BIN
F072B_DISCO/en.CD00259245 dac audio.pdf

Binary file not shown.

BIN
F072B_DISCO/en.STM32F7_WDG_TIMERS_GPTIM.pdf

Binary file not shown.

BIN
F072B_DISCO/en.STM32L4_Peripheral_Touchsense.pdf

Binary file not shown.

BIN
F072B_DISCO/f072_afs.pdf

Binary file not shown.

BIN
F072B_DISCO/mh-z19b-co2-ver1_0.pdf

Binary file not shown.

BIN
F072B_DISCO/navrhZadani.pdf

Binary file not shown.

BIN
F103_BLUEPILL/0.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
F103_BLUEPILL/F103.pdf

Binary file not shown.

BIN
F103_BLUEPILL/F103x8,B.pdf

Binary file not shown.

BIN
F103_BLUEPILL/F10x ref manual.pdf

Binary file not shown.

BIN
F103_BLUEPILL/F1xx flash pgm manual.pdf

Binary file not shown.

BIN
F103_BLUEPILL/bluepill-schematic.pdf

Binary file not shown.

BIN
F103_BLUEPILL/schematic.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

BIN
F103_BLUEPILL/stm32f103 errata.pdf

Binary file not shown.

BIN
F303_DISCO/Discovery F3 periph examples.pdf

Binary file not shown.

BIN
F303_DISCO/Discovery F303 schema.pdf

Binary file not shown.

BIN
F303_DISCO/Discovery F303.pdf

Binary file not shown.

BIN
F303_DISCO/F3 ref manual.pdf

Binary file not shown.

BIN
F303_DISCO/F303xB,C.pdf

Binary file not shown.

BIN
F407_DISCO/F4-appnote-AUDIO.pdf

Binary file not shown.

BIN
F407_DISCO/F4-audio-decoding.pdf

Binary file not shown.

BIN
F407_DISCO/F4-disco-UM-getting_started.pdf

Binary file not shown.

BIN
F407_DISCO/F4-disco-UM.pdf

Binary file not shown.

BIN
F407_DISCO/F4-disco.pdf

Binary file not shown.

BIN
F407_DISCO/F4-migration.pdf

Binary file not shown.

BIN
F407_DISCO/F407_DS.pdf

Binary file not shown.

BIN
F407_DISCO/F4_RM.pdf

Binary file not shown.

BIN
L432_NUCLEO/L432 errata.pdf

Binary file not shown.

BIN
L432_NUCLEO/L432 ref manual.pdf

Binary file not shown.

BIN
L432_NUCLEO/L432.pdf

Binary file not shown.

BIN
L432_NUCLEO/Small_Nucleo.pdf

Binary file not shown.

BIN
L432_NUCLEO/nucleo32l432kc_mbed_pinout_v3_.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB

BIN
component-datasheets/F072x8,xB.pdf

Binary file not shown.

BIN
component-datasheets/F0x1,2,8 RM.pdf

Binary file not shown.

BIN
component-datasheets/cap10uf-48923393847140904892335692597769lmk316ab7106ml-t_ss.pdf.pdf

Binary file not shown.

BIN
component-datasheets/esd-11265.pdf

Binary file not shown.

BIN
component-datasheets/ld3985-ldo33small-13475800261421539.pdf

Binary file not shown.

BIN
component-datasheets/ldo33-168346138795742az1117.pdf

Binary file not shown.

BIN
component-datasheets/rs485-1238662599727145285678fg.pdf

Binary file not shown.

BIN
component-datasheets/usb-a-1782329398044234up2-ah-th.pdf

Binary file not shown.

BIN
component-datasheets/usb-micro-40474642682600710118194.pdf

Binary file not shown.

BIN
component-datasheets/usb-mini-391167168305991391164671226288ux_catalog.pdf.pdf

Binary file not shown.

BIN
component-datasheets/xtal-8mhz-7a_c.pdf

Binary file not shown.

BIN
early-sketch.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
en.DM00095744_L0x3 RM.pdf

Binary file not shown.

BIN
en.DM00105823_nucleos UM.pdf

Binary file not shown.

BIN
en.DM00105918_nucleos.pdf

Binary file not shown.

181865
en.DM00108281_L0x2 RM.pdf

File diff suppressed because one or more lines are too long

BIN
en.DM00141036_stm32l073_ds.pdf

Binary file not shown.

BIN
gex-drawings.ora

Binary file not shown.

BIN
inteligent-sensors.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

BIN
nRF24L01P_Product_Specification_1_0.pdf

Binary file not shown.

BIN
pi0/Rainbow-HAT-Manual-1.pdf

Binary file not shown.

BIN
pi0/Raspberry-Pi-Zero.pdf

Binary file not shown.

BIN
pi0/btn=hole.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
pi0/btn=smd.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
pi0/btn=smd2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
pi0/rpi_MECH_Zero_1p2.pdf

Binary file not shown.

BIN
references/AD9834.pdf

Binary file not shown.

BIN
references/AD_all-about-direct-digital-synthesis.pdf

Binary file not shown.

BIN
references/AN10033-Frequency-Measurement-Guidelines-for-Oscillators.pdf

Binary file not shown.

BIN
references/AN1080.pdf

Binary file not shown.

BIN
references/DS1820.pdf

Binary file not shown.

BIN
references/FAT16/FAT12Description_www.dfists.ua.es_~gil.pdf

Binary file not shown.

517
references/FAT16/FAT16 Structure Information.html

@ -0,0 +1,517 @@
<html>
<!-- http://home.teleport.com/~brainy/fat16.htm -->
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>FAT16 Structure Information</title>
</head>
<body>
<p align="center"><strong><u><big>FAT16 Structure Information - Written by Jack Dobiash</big></u></strong></p>
<p align="center"><em><small>Updated : June 17th, 1999</small></em></p>
<p>Looking for FAT32 Info?&nbsp; Go <a href="http://home.teleport.com/~brainy/fat32.htm">here</a>.<br>
Looking for Informaton on how to Read and Write to your Hard Drive?&nbsp; Go <a
href="http://home.teleport.com/~brainy/diskaccess.htm">here</a>.</p>
<p>I've written this page for anyone who wishes to write software that can do low-level
reading and writing of a hard drive, and needs to know what the underlying structure of a
FAT16 Drive is, in order to interpret the information properly.&nbsp; Basically I've
searched all over the web, and have compiled this information in one spot. &nbsp;&nbsp;
Hopefully it can be of use to someone.&nbsp; I don't guarantee that all of this
information is correct or complete, but so far is seems to have been working for me.
&nbsp;</p>
<p>A lot of the number references I've made in this document are in Hexadecimal.&nbsp; Any
that are have an 'h' after them.&nbsp; Also, just in case my terminology may be different
from yours; a 'WORD' is 2 Bytes and a 'DOUBLE WORD' is 4 Bytes.</p>
<p>&nbsp;</p>
<p><u><strong>Master Boot Record</strong></u></p>
<blockquote>
<p>The Master Boot Record is the same for pretty much all Operating Systems.&nbsp; It is
located on the first Sector of the Hard Drive, at Cylinder 0, Head 0, Sector 1.&nbsp; It
is the first piece of code that your computer runs after it has checked all of your
hardware (POST) and turned control of loading software over the hard drive.&nbsp; It also
contains the partition table, which defines the different sections of your hard
drive.&nbsp; Basically if anything happens to this little 512 byte section, your hard
drive is brain dead.&nbsp; Kinda scary, eh? :)</p>
</blockquote>
<div align="left">
<table border="1" width="455" height="79">
<tr>
<td width="44" height="25">Offset</td>
<td width="269" height="25">Description</td>
<td width="52" height="25">Size</td>
</tr>
<tr>
<td width="44" height="25">000h</td>
<td width="269" height="25">Executable Code (Boots Computer)</td>
<td width="52" height="25">446 Bytes</td>
</tr>
<tr>
<td width="44" height="22">1BEh</td>
<td width="269" height="1">1st Partition Entry (See Next Table)</td>
<td width="52" height="22">16 Bytes</td>
</tr>
<tr>
<td width="44" height="17">1CEh</td>
<td width="269" height="17">2nd Partition Entry</td>
<td width="52" height="17">16 Bytes</td>
</tr>
<tr>
<td width="44" height="12">1DEh</td>
<td width="269" height="12">3rd Partition Entry</td>
<td width="52" height="12">16 Bytes</td>
</tr>
<tr>
<td width="44" height="20">1EEh</td>
<td width="269" height="20">4th Partition Entry</td>
<td width="52" height="20">16 Bytes</td>
</tr>
<tr>
<td width="44" height="16">1FEh</td>
<td width="269" height="16">Executable Marker (55h AAh)</td>
<td width="52" height="16">2 Bytes</td>
</tr>
</table>
</div>
<p><br>
<strong>Partition Entry (Part of MBR)</strong></p>
<div align="left">
<table border="1" width="523" height="236">
<tr>
<td width="47" height="7">Offset</td>
<td width="328" height="7">Description</td>
<td width="130" height="7">Size</td>
</tr>
<tr>
<td width="47" height="8">00h</td>
<td width="328" height="8">Current State of Partition (00h=Inactive, 80h=Active)</td>
<td width="130" height="8">1 Byte</td>
</tr>
<tr>
<td width="47" height="18">01h</td>
<td width="328" height="18">Beginning of Partition - Head</td>
<td width="130" height="18">1 Byte</td>
</tr>
<tr>
<td width="47" height="19">02h </td>
<td width="328" height="19">Beginning of Partition - Cylinder/Sector (See Below)</td>
<td width="130" height="19">1 Word</td>
</tr>
<tr>
<td width="47" height="15">04h</td>
<td width="328" height="15">Type of Partition (See List Below)</td>
<td width="130" height="15">1 Byte</td>
</tr>
<tr>
<td width="47" height="13">05h</td>
<td width="328" height="13">End of Partition - Head</td>
<td width="130" height="13">1 Byte</td>
</tr>
<tr>
<td width="47" height="15">06h</td>
<td width="328" height="15">End of Partition - Cylinder/Sector</td>
<td width="130" height="15">1 Word</td>
</tr>
<tr>
<td width="47" height="22">08h</td>
<td width="328" height="22">Number of Sectors Between the MBR and the First Sector in the
Partition</td>
<td width="130" height="22">1 Double Word</td>
</tr>
<tr>
<td width="47" height="22">0Ch</td>
<td width="328" height="22">Number of Sectors in the Partition</td>
<td width="130" height="22">1 Double Word</td>
</tr>
</table>
</div>
<p><br>
<strong>Cylinder/Sector Encoding</strong></p>
<blockquote>
<p>I guess back in the days of 10MB hard drives and 8086's, code was at a premium. &nbsp;
So they did everything they could to preserve space.&nbsp; Unfortunately now we have to
live with it, but luckily they created new ways of translating the system so the 1024
Cylinder Limit (2^10) isn't too big of a problem, for newer computers, at least. &nbsp;
Older ones usually need some sort of Disk Overlay program to make them see the whole hard
drive.&nbsp;&nbsp; </p>
<p>Anyway, to get the Sector out of this, you need to apply an AND mask ($3F) to it.
&nbsp; To get the Cylinder, you take the high byte and OR it with the low byte that has
been AND masked with ($C0) and then Shifted Left Two.&nbsp; It's not very easy to explain,
so I'll just show you how I did it with two routines I made (In Pascal) for Encoding and
Decoding the Cylinder/Sector.&nbsp; Hopefully even if you don't know Pascal you'll be able
to read it.</p>
<p>Function CylSecEncode(Cylinder, Sector : Word) : Word;<br>
Begin<br>
&nbsp;&nbsp;&nbsp; CylSecEncode := (Lo(Cylinder) shl 8) or (Hi(Cylinder) shl 6) or Sector;<br>
End;<br>
<br>
Procedure CylSecDecode(Var Cylinder, Sector : Word; CylSec : Word);<br>
Begin<br>
&nbsp;&nbsp;&nbsp; Cylinder := Hi(CylSec) or ((Lo(CylSec) and $C0) shl 2);<br>
&nbsp;&nbsp;&nbsp; Sector := (CylSec and $3F);<br>
End;<br>
</p>
</blockquote>
<div align="left">
<table border="1" width="418" height="48">
<tr>
<td width="10" height="23">15</td>
<td width="13" height="23">14</td>
<td width="18" height="23">13</td>
<td width="7" height="23">12</td>
<td width="12" height="23">11</td>
<td width="20" height="23">10</td>
<td width="19" height="23">9</td>
<td width="20" height="23">8</td>
<td width="36" height="23">7</td>
<td width="29" height="23">6</td>
<td width="20" height="23">5</td>
<td width="22" height="23">4</td>
<td width="21" height="23">3</td>
<td width="22" height="23">2</td>
<td width="25" height="23">1</td>
<td width="23" height="23">0</td>
</tr>
<tr>
<td width="184" height="13" colspan="8">Cylinder Bits 7 to 0</td>
<td width="67" height="13" colspan="2">Cylinder Bits 9+8</td>
<td width="149" height="13" colspan="6">Sector Bits 5 to 0</td>
</tr>
</table>
</div>
<p><br>
<strong>Partition Type Listing</strong></p>
<blockquote>
<p>There are more than just these shown, but I've only included that ones relevant to MS
Operating Systems.</p>
</blockquote>
<div align="left">
<table border="1" width="418" height="57">
<tr>
<td width="52" height="23">Value</td>
<td width="354" height="23">Description</td>
</tr>
<tr>
<td width="52" height="10">00h</td>
<td width="354" height="10">Unknown or Nothing</td>
</tr>
<tr>
<td width="52" height="13">01h</td>
<td width="354" height="13">12-bit FAT</td>
</tr>
<tr>
<td width="52" height="0">04h</td>
<td width="354" height="0">16-bit FAT (Partition Smaller than 32MB)</td>
</tr>
<tr>
<td width="52" height="8">05h</td>
<td width="354" height="8">Extended MS-DOS Partition</td>
</tr>
<tr>
<td width="52" height="7">06h</td>
<td width="354" height="7">16-bit FAT (Partition Larger than 32MB)</td>
</tr>
<tr>
<td width="52" height="6">0Bh</td>
<td width="354" height="6">32-bit FAT (Partition Up to 2048GB)</td>
</tr>
<tr>
<td width="52" height="10">0Ch</td>
<td width="354" height="10">Same as 0BH, but uses LBA<sub>1</sub> 13h Extensions</td>
</tr>
<tr>
<td width="52" height="12">0Eh</td>
<td width="354" height="12">Same as 06H, but uses LBA<sub>1</sub> 13h Extensions</td>
</tr>
<tr>
<td width="52" height="1">0Fh</td>
<td width="354" height="1">Same as 05H, but uses LBA<sub>1</sub> 13h Extensions</td>
</tr>
</table>
</div>
<p><br>
<u><strong>Reading Multiple Partitions</strong></u></p>
<blockquote>
<p>Since FAT16 is limited to 2GB per partition, drives that use it tend to have multiple
partitions.&nbsp; The first partition is the Primary Partition, and everything else is
stored in the Extended Partition.&nbsp; It's a little tricky when it comes to reading
those extra partitions though (not a lot, just a little).&nbsp; The first record in the
partition table shows where the Primary partition is (how big it is, where it starts, and
where it ends).&nbsp; The second entry in the partition table shows where the Entire
Extended Partition is (which may include more than just one partition).&nbsp; To read any
more partitions, you go to the where it says the Extended Partition starts, and read the
first sector.&nbsp; It acts just like the MBR.&nbsp; It'll have blank where the code is
supposed to be, and in the partition table it will have for it's first entry the next
Partition in the Drive, and if there are anymore, there will be another Extended
partition, just like before.&nbsp; However, all references to Sector Numbers are made
using the that new MBR point as the reference, making it a virtual drive.&nbsp; Just
incase this doesn't make much sense (and by the way I explain things I can understand if
it doesn't), let me show you how a drive with three partitions is setup.</p>
<p>MBR of Whole Drive</p>
<p>&nbsp;&nbsp;&nbsp; Entry #1 - Points to Partition #1<br>
&nbsp;&nbsp;&nbsp; Entry #2 - Points to the Entire Extended Partition</p>
<p>You would read the first sector of that Extended Partition, and see another MBR
Structure.</p>
<p>MBR of Extended Partition</p>
<p>&nbsp;&nbsp;&nbsp; Entry #1 - Points to Partition #2<br>
&nbsp;&nbsp;&nbsp; Entry #2 - Points to Rest of Extended Partition after Partition #2</p>
<p>Now, all references to Sector Numbers (most specifically the entry at Offset 08h) in
those Entries wouldn't be referenced from the start of the drive, but from the start of
the Extended Partition.&nbsp; However, the CHS (Cylinder, Head, Sector) numbers would
still be right.</p>
<p>Once again, you would read the first sector of that Extended Partition, and see the
next MBR.</p>
<p>MBR of Rest of Extended Partition</p>
<p>&nbsp;&nbsp;&nbsp; Entry #1 - Points to Partition #3<br>
&nbsp;&nbsp;&nbsp; No Entry #2, since this was the Last Partition</p>
<p>If there were another partition, the pattern would continue just like before, until the
last one was reached.</p>
</blockquote>
<p>&nbsp;</p>
<p><br>
<u><strong>FAT16 Boot Record</strong></u></p>
<blockquote>
<p>This information is located in the first sector of every partition.</p>
</blockquote>
<div align="left">
<table border="1" width="518" height="192">
<tr>
<td width="60" height="19">Offset</td>
<td width="329" height="19">Description</td>
<td width="110" height="19">Size</td>
</tr>
<tr>
<td width="60" height="10">00h</td>
<td width="329" height="10">Jump Code + NOP</td>
<td width="110" height="10">3 Bytes</td>
</tr>
<tr>
<td width="60" height="25">03h</td>
<td width="329" height="25">OEM Name</td>
<td width="110" height="25">8 Bytes</td>
</tr>
<tr>
<td width="60" height="6">0Bh</td>
<td width="329" height="6">Bytes Per Sector</td>
<td width="110" height="6">1 Word</td>
</tr>
<tr>
<td width="60" height="7">0Dh</td>
<td width="329" height="7">Sectors Per Cluster</td>
<td width="110" height="7">1 Byte</td>
</tr>
<tr>
<td width="60" height="12">0Eh</td>
<td width="329" height="12">Reserved Sectors</td>
<td width="110" height="12">1 Word</td>
</tr>
<tr>
<td width="60" height="7">10h</td>
<td width="328" height="7">Number of Copies of FAT</td>
<td width="111" height="7">1 Byte</td>
</tr>
<tr>
<td width="60" height="4">11h</td>
<td width="328" height="4">Maximum Root Directory Entries</td>
<td width="111" height="4">1 Word</td>
</tr>
<tr>
<td width="60" height="5">13h</td>
<td width="328" height="5">Number of Sectors in Partition Smaller than 32MB</td>
<td width="111" height="5">1 Word</td>
</tr>
<tr>
<td width="60" height="8">15h</td>
<td width="328" height="8">Media Descriptor (F8h for Hard Disks)</td>
<td width="111" height="8">1 Byte</td>
</tr>
<tr>
<td width="60" height="4">16h</td>
<td width="328" height="4">Sectors Per FAT</td>
<td width="111" height="4">1 Word</td>
</tr>
<tr>
<td width="61" height="14">18h</td>
<td width="328" height="14">Sectors Per Track</td>
<td width="111" height="14">1 Word</td>
</tr>
<tr>
<td width="61" height="23">1Ah</td>
<td width="328" height="23">Number of Heads</td>
<td width="111" height="23">1 Word</td>
</tr>
<tr>
<td width="61" height="22">1Ch</td>
<td width="328" height="22">Number of Hidden Sectors in Partition</td>
<td width="111" height="22">1 Double Word</td>
</tr>
<tr>
<td width="61" height="22">20h</td>
<td width="328" height="22">Number of Sectors in Partition</td>
<td width="111" height="22">1 Double Word</td>
</tr>
<tr>
<td width="61" height="22">24h</td>
<td width="328" height="22">Logical Drive Number of Partition</td>
<td width="111" height="22">1 Word</td>
</tr>
<tr>
<td width="61" height="22">26h</td>
<td width="328" height="22">Extended Signature (29h)</td>
<td width="111" height="22">1 Byte</td>
</tr>
<tr>
<td width="61" height="22">27h</td>
<td width="328" height="22">Serial Number of Partition</td>
<td width="111" height="22">1 Double Word</td>
</tr>
<tr>
<td width="61" height="22">2Bh</td>
<td width="328" height="22">Volume Name of Partition</td>
<td width="111" height="22">11 Bytes</td>
</tr>
<tr>
<td width="61" height="22">36h</td>
<td width="328" height="22">FAT Name (FAT16)</td>
<td width="111" height="22">8 Bytes</td>
</tr>
<tr>
<td width="61" height="22">3Eh</td>
<td width="328" height="22">Executable Code</td>
<td width="111" height="22">448 Bytes</td>
</tr>
<tr>
<td width="61" height="22">1FEh</td>
<td width="328" height="22">Executable Marker (55h AAh)</td>
<td width="111" height="22">2 Bytes</td>
</tr>
</table>
</div>
<p><br>
<br>
<u><strong>FAT16 Drive Layout</strong></u></p>
<div align="left">
<table border="1" width="521" height="64">
<tr>
<td width="374" height="23">Offset</td>
<td width="111" height="23">Description</td>
</tr>
<tr>
<td width="374" height="10">Start of Partition</td>
<td width="111" height="10">Boot Sector</td>
</tr>
<tr>
<td width="374" height="14">Start + # of Reserved Sectors</td>
<td width="111" height="14">Fat Tables</td>
</tr>
<tr>
<td width="374" height="-1">Start + # of Reserved + (# of Sectors Per FAT * 2)</td>
<td width="111" height="-1">Root Directory Entry</td>
</tr>
<tr>
<td width="374" height="3">Start + # of Reserved + (# of Sectors Per FAT * 2) + ((Maximum
Root Directory Entries * 32) / Bytes per Sector) </td>
<td width="111" height="3">Data Area (Starts with Cluster #2)</td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<p><u><strong>Cluster Meaning (FAT Table Entries)</strong></u></p>
<blockquote>
<p>A Cluster is a Group of Sectors on the Hard Drive that have information in them. &nbsp;
A 16K Cluster has 32 Sectors in it (512*32=16384).&nbsp; Each Cluster is given a spot in
the FAT Table.&nbsp; When you look at an Entry in the FAT, the number there tells you
whether or not that cluster has data in it, and if so, if it is the end of the data or
there is another cluster after it.&nbsp; All Data on a Partition starts with Cluster #2
(Right after Root Directory). &nbsp;&nbsp; If the FAT Entry is 0, then there is no data in
that cluster.&nbsp; If the FAT Entry is FFFFh, then it is the last entry in the
chain.&nbsp; </p>
</blockquote>
<div align="left">
<table border="1" width="430" height="78">
<tr>
<td width="247" height="19">FAT Code Range</td>
<td width="171" height="19">Meaning</td>
</tr>
<tr>
<td width="247" height="11">0000h</td>
<td width="171" height="11">Available Cluster</td>
</tr>
<tr>
<td width="247" height="10">0002h-FFEFh</td>
<td width="171" height="10">Used, Next Cluster in File</td>
</tr>
<tr>
<td width="247" height="7">FFF0h-FFF6h</td>
<td width="171" height="7">Reserved Cluster</td>
</tr>
<tr>
<td width="247" height="4">FFF7h</td>
<td width="171" height="4">BAD Cluster</td>
</tr>
<tr>
<td width="247" height="9">FFF8h-FFFF</td>
<td width="171" height="9">Used, Last Cluster in File</td>
</tr>
</table>
</div>
<p><u><strong>Directory Table</strong></u></p>
<blockquote>
<p>Another aspect when looking at a File System at Low Level is the Directory Table.
&nbsp; The Directory Table is what stores all of the File and Directory Entries.
&nbsp;Someone else has already written a good resource for this information on the net, so
go <a href="http://home.teleport.com/~brainy/lfn.htm">here</a> to look at it.&nbsp; The
link doesn't work anymore, but luckily I saved the page a while back, so i'll just post it
on my site.</p>
</blockquote>
<p>&nbsp;</p>
<p>Footnotes</p>
<p>1 - LBA = Logical Block Addressing - Uses the Int 13h Extensions built into newer
BIOS's to access data above the 8GB
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
barrier, or to access strickly in LBA mode, instead of CHS (Cylinder, Head, Sector).</p>
<p align="center"><a href="http://home.teleport.com/~brainy">Home</a> <a
href="http://home.teleport.com/~brainy/rps.html">Reference Point Software</a> <a
href="http://home.teleport.com/~brainy/fat32.htm">FAT32 Structure Information</a> FAT16
Structure Information <a href="http://home.teleport.com/~brainy/diskaccess.htm">Disk Access
Information</a> <br>
<a href="http://home.teleport.com/~brainy/bio.html">About Me</a> <a
href="http://home.teleport.com/~brainy/links.html">Links</a> <a
href="http://home.teleport.com/~brainy/dobiash.html">Dobiash?</a></p>
</body>
</html>

1304
references/FAT16/FAT32 Structure Information.html

File diff suppressed because it is too large

580
references/FAT16/Long Filename Specification.html

@ -0,0 +1,580 @@
<!doctype html public "-//w3c//DTD HTML 3.2//EN">
<html>
<!-- http://home.teleport.com/~brainy/lfn.htm -->
<!-- http://members.aol.com/vindaci/pub/doc/lfn/lfn.html -->
<!-- Copyright (c)1996-1998 vinDaci -->
<head>
<title>Long Filename Specification</title>
</head>
<body>
<h2 align="center">Long Filename Specification</h2>
<font size="-1">
<p align="center">by vinDaci</font> <font size="-2"><br>
fourth release</font> <font size="-1"><br>
First Release: November 18th, 1996</font> <font size="-1"><br>
Last Update: January 6th, 1998 (Document readability update)</font> </p>
<hr>
<h3>Compatibility</h3>
<p>Long filename (here on forth referred to as &quot;LFN&quot;) design for Windows95 is
designed to be 99% compatible with the old DOS 8.3 format. The 1% discripency comes in
when old DOS programs can detect the <em>presence</em> of LFN (but unfortunately not the
LFN itself), which in no way interferes with regular program operations except for perhaps
low-level disk utility programs (such as disk error fixing programs, disk optimization
programs, anti-virus program, etc.) <a name="background"></p>
<hr>
<h3>DOS 8.3 Filename Background</h3>
<p>I trust that anyone who wish to know the details of LFN has at least a small knowledge
in DOS 8.3 filename specification. In this document, however, I'll assume you know very
little about the 8.3 filename specs, however. What you need to know in order to understand
this documentation is that 8.3 filenames are stored in a place on the disk called the <dfn>directory
table</dfn>. This place contains the list of filenames and other information associated
with each file, such as the file date, time, size, attributes, etc. (Note: Contrary to
some belief, the directory table is <em>not</em> the same as the FAT -- e-mail me if you
wish to know what FAT is.) </p>
<p>The file attributes, mentioned above, play some big roles in LFN. It is important to
note that a file's attributes are may consist of one or more of the following: </p>
<div align="center"><center>
<table width="50%" border="1">
<tr>
<td><code>Archive</code> </td>
</tr>
<tr>
<td><code>Read-Only</code> </td>
</tr>
<tr>
<td><code>System</code> </td>
</tr>
<tr>
<td><code>Hidden</code> </td>
</tr>
<tr>
<td><code>Directory</code> </td>
</tr>
<tr>
<td><code>Volume</code> </td>
</tr>
</table>
</center></div>
<p>Most programmers are aware of the Archive, Read-Only, System, and Hidden attrbiutes,
but for those of you who don't know, please allow me to explain what each of these
attributes is/does:
<ul>
<li>The <dfn>Archive attribute</dfn> tells that a file has been backed up (though most
programs just ignore this). </li>
<li>The <dfn>Read-Only attribute</dfn> keeps a file from accidentally getting overwritten;
note that any program can unset this attribute should it know how to detect this attribute
and unset it -- that's why it is used just to keep a file from <em>accidentally</em>
getting overwritten. </li>
<li>The <dfn>System attribute</dfn> tells that the file is used for some important operation
so it should not be messed with except by the program that created it; any file with this
attribute cannot be seen with the <kbd>DIR</kbd> command except with the <kbd>/a</kbd> or <kbd>/as</kbd>
arguments in DOS 5 and above. </li>
<li>The <dfn>Hidden</dfn> attribute tells that a file should normally be hidden from the
user's view. Any file with this attribute cannot be seen with <kbd>DIR</kbd> command
either, except with the <kbd>/a</kbd> or <kbd>/ah</kbd> arguments in DOS 5 and above. </li>
</ul>
<p>And the explanation of the other attributes (the <em>really</em> important ones):
<ul>
<li>The <dfn>Directory attribute</dfn> is used to tell that a file is not actually a file
but a directory. This type of file contains a pointer to a part of the disk that contains
another directory table; this directory table that's pointed to is the subdirectory of the
directory that has the pointer. In another words, when you &quot;CD&quot; to that file,
you go into the directory table the file points to, making it look as though you are
&quot;inside&quot; that directory. In reality, you only switch the directory tables. </li>
<li>The <dfn>volume attribute</dfn> too is used to tell that a file is not actually a file.
This attribute is used to indicate the volume label of the drive (the name of the disk). A
file with this attribute can never be displayed with the <kbd>DIR</kbd> command.
Furthermore, there can be only one file with this attribute on the entire disk, and this
file must be in the root directory of the disk. <br>
&nbsp;&nbsp;&nbsp;&nbsp; The volume attribute has a funny story attached to it -- There
not only exists a file with the volume attribute, but a copy of the volume label is also
located in the boot sector (the very beginning of the disk that has weird code and disk
info on it) as a readable text. But when you view a directory with the <kbd>DIR</kbd>
command, the one that actually gets displayed is the volume attributed file's name, not
the volume label in the boot sector. Furthermore, even though files with volume attribute
is hidden from the <kbd>DIR</kbd> command, programs, when retrieving filenames, can
retrieve volume labels.</a> All these factors about volume attributes come into a big
factor when we look at Long Filenames. </li>
</ul>
<p>As an addendum, it might be interesting to note that each 8.3 file entry is 32 bytes
long but that not all 32 bytes are used to store data -- some of them are plainly left as
blank bytes. In Windows95 version of the directory table, however, all 32 bytes are used. </p>
<hr>
<h3>General Specification</h3>
<p>Just like DOS 8.3 filenames, Windows95 LFNs are also stored on directory tables,
side-by-side with DOS 8.3 filenames. On top of that, to achieve compatibility with old DOS
programs Microsoft designed LFN in a way so it resembles the old DOS 8.3 format.
Furthermore, an 8.3 format version of LFN (<code>tttttt~n.xxx</code>) is also present next
to each LFN entry for compatibility with non-LFN supporting programs. <a
name="organization"></p>
<hr>
<h3>Organization</h3>
<p>From a low-level point-of-view, a normal directory table that only contains 8.3
filenames look like this: </p>
<div align="center"><center>
<table width="50%" border="1">
<tr>
<td><code>...</code> </td>
</tr>
<tr>
<td><code>8.3 entry</code> </td>
</tr>
<tr>
<td><code>8.3 entry</code> </td>
</tr>
<tr>
<td><code>8.3 entry</code> </td>
</tr>
<tr>
<td><code>8.3 entry</code> </td>
</tr>
</table>
</center></div>
<p>If you look at a directory table that contains LFN entries, however, this is what you
will see: </p>
<div align="center"><center>
<table width="50%" border="1">
<tr>
<td><code>...</code> </td>
</tr>
<tr>
<td><code>LFN entry 3</code> </td>
</tr>
<tr>
<td><code>LFN entry 2</code> </td>
</tr>
<tr>
<td><code>LFN entry 1</code> </td>
</tr>
<tr>
<td><code>8.3 entry (tttttt~n.xxx)</code> </td>
</tr>
</table>
</center></div>
<p>Notice that Long Filenames can be pretty long, so LFN entries in a 8.3 directory
structure can take up several 8.3 directory entry spaces. This is why the above file entry
has several LFN entries for a single 8.3 file entry. </p>
<p>Despite taking up 8.3 filename spaces, Long Filenames do not show up with the <kbd>DIR</kbd>
command or with any other program, even the ones that do not recognize the LFN. How, then,
do LFN entries get hidden from DOS? The answer is quite simple: By giving LFN entries
&quot;Read-only, System, Hidden, and Volume&quot; attributes. (If you do not know details
about file attributes, read the above text about </a><a href="#background">DOS 8.3
Filename Background</a>.) </p>
<p>A special attention should be given to the fact that this combination of attributes --
Read-only, System, Hidden, Volume -- is not possible to make under normal circumstances
using common utilities found in the market place (special disk-editing programs, such as
Norton Disk Editor, is an exception.) </p>
<p>This technique of setting Read-only, System, Hidden, Volume attributes works because
most programs ignore files with volume attributes altogether, and even if they don't, they
won't display any program that has system or hidden attributes set. And since the
Read-only attribute is set, programs won't write anything over it. However, you can view
&quot;parts&quot; of the LFN entries if any program is designed to show Volume attributed
files. </p>
<a name="storage">
<hr>
<h3>Storage Organization</h3>
<p>To understand the LFN storage organization within a directory table, it is important to
understand the 8.3 storage organization. This is mainly due to the fact that LFN entries
are stored similar to 8.3 filenames to avoid conflicts with DOS applications. </p>
<p>The format of the traditional DOS 8.3 is as follows: </p>
<div align="center"><center>
<table width="80%" border="1">
<tr>
<th width="15%" align="center">Offset </th>
<th width="15%" align="center">Length </th>
<th width="*" align="left">&nbsp;&nbsp;Value </th>
</tr>
<tr>
<td align="center">0 </td>
<td align="center">8 bytes </td>
<td align="left">&nbsp;&nbsp;Name </td>
</tr>
<tr>
<td align="center">8 </td>
<td align="center">3 bytes </td>
<td align="left">&nbsp;&nbsp;Extension </td>
</tr>
<tr>
<td align="center">11 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Attribute (<code>00ARSHDV</code>) <br>
&nbsp;&nbsp;<code>0</code>: unused bit <br>
&nbsp;&nbsp;<code>A</code>: archive bit, <br>
&nbsp;&nbsp;<code>R</code>: read-only bit <br>
&nbsp;&nbsp;<code>S</code>: system bit <br>
&nbsp;&nbsp;<code>D</code>: directory bit <br>
&nbsp;&nbsp;<code>V</code>: volume bit </td>
</tr>
<tr>
<td align="center">22 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Time </td>
</tr>
<tr>
<td align="center">24 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Date </td>
</tr>
<tr>
<td align="center">26 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Cluster (desc. below) </td>
</tr>
<tr>
<td align="center">28 </td>
<td align="center">dword </td>
<td align="left">&nbsp;&nbsp;File Size </td>
</tr>
</table>
</center></div>
<p align="center">Note: <dfn>WORD</dfn> = 2 bytes, <dfn>DWORD</dfn> = 4 bytes </p>
<p>Everything above you should know what they are except perhaps for the cluster. The
cluster is a value representing another part of the disk, normally used to tell where the
beginning of a file is. In case of a directory, it is the cluster that tells where the
subdirectory's directory table starts. </p>
<p>You may not know this, but LFN specification not only added the capability of having
longer filenames, but it also improved the capability of 8.3 filenames as well. This new
8.3 filename improvements are accomplished by using the unused directory table spaces
(Remember how I told you that 8.3 filenames take up 32 bytes but not all 32 bytes are
used? Now it's all used up!) This new format is as follows -- try comparing it with the
traditional format shown above!: </p>
<div align="center"><center>
<table width="80%" border="1">
<tr>
<th width="15%" align="center">Offset </th>
<th width="15%" align="center">Length </th>
<th width="*" align="left">&nbsp;&nbsp;Value </th>
</tr>
<tr>
<td align="center">0 </td>
<td align="center">8 bytes </td>
<td align="left">&nbsp;&nbsp;Name </td>
</tr>
<tr>
<td align="center">8 </td>
<td align="center">3 bytes </td>
<td align="left">&nbsp;&nbsp;Extension </td>
</tr>
<tr>
<td align="center">11 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Attribute (<code>00ARSHDV</code>) </td>
</tr>
<tr>
<td align="center">12 </td>
<td align="center">byte </td>
<td align="left" nowrap>&nbsp;&nbsp;NT (Reserved for WindowsNT; <br>
&nbsp;&nbsp;always 0) </td>
</tr>
<tr>
<td align="center">13 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Created time; millisecond portion </td>
</tr>
<tr>
<td align="center">14 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Created time; hour and minute </td>
</tr>
<tr>
<td align="center">16 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Created date </td>
</tr>
<tr>
<td align="center">18 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Last accessed date </td>
</tr>
<tr>
<td align="center">20 </td>
<td align="center">word </td>
<td align="left" nowrap>&nbsp;&nbsp;Extended Attribute <br>
&nbsp;&nbsp;(reserved for OS/2; always 0) </td>
</tr>
<tr>
<td align="center">22 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Time </td>
</tr>
<tr>
<td align="center">24 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Date </td>
</tr>
<tr>
<td align="center">26 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Cluster </td>
</tr>
<tr>
<td align="center">28 </td>
<td align="center">dword </td>
<td align="left">&nbsp;&nbsp;File Size </td>
</tr>
</table>
</center></div>
<p>In any case, this new 8.3 filename format is the format used with the LFN. As for the
LFN format itself (seen </a><a href="#organization">previously</a>) is stored
&quot;backwards&quot;, with the first entry toward the bottom and the last entry at the
top, right above the new 8.3 filename entry. </p>
<p>Each LFN entry is stored as follows: </p>
<div align="center"><center>
<table width="80%" border="1">
<tr>
<th width="15%" align="center">Offset </th>
<th width="15%" align="center">Length </th>
<th width="*" align="left">&nbsp;&nbsp;Value </th>
</tr>
<tr>
<td align="center">0 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Ordinal field (desc. below) </td>
</tr>
<tr>
<td align="center">1 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 1 (desc. below) </td>
</tr>
<tr>
<td align="center">3 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 2 </td>
</tr>
<tr>
<td align="center">5 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 3 </td>
</tr>
<tr>
<td align="center">7 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 4 </td>
</tr>
<tr>
<td align="center">9 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 5 </td>
</tr>
<tr>
<td align="center">11 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Attribute </td>
</tr>
<tr>
<td align="center">12 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Type (reserved; always 0) </td>
</tr>
<tr>
<td align="center">13 </td>
<td align="center">byte </td>
<td align="left">&nbsp;&nbsp;Checksum (desc. below) </td>
</tr>
<tr>
<td align="center">14 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 6 </td>
</tr>
<tr>
<td align="center">16 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 7 </td>
</tr>
<tr>
<td align="center">18 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 8 </td>
</tr>
<tr>
<td align="center">20 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 9 </td>
</tr>
<tr>
<td align="center">22 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 10 </td>
</tr>
<tr>
<td align="center">24 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 11 </td>
</tr>
<tr>
<td align="center">26 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Cluster (unused; always 0) </td>
</tr>
<tr>
<td align="center">28 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 12 </td>
</tr>
<tr>
<td align="center">30 </td>
<td align="center">word </td>
<td align="left">&nbsp;&nbsp;Unicode character 13 </td>
</tr>
</table>
</center></div>
<p>Throughout this entry, you see &quot;unicode characters&quot;. Unicode characters are
2-byte long characters (as opposed to ASCII characters that are 1-byte long each) that
support not only traditional latin alphabet characters and arabic numbers but they also
support the languages of the rest of the world, including the CJK trio (Chinese, Japanese,
Korean), Arabic, Hebrew, etc. Plus you have some space left over for more math and science
symbols. Unicode characters are still going through revisions (on their second revision as
I am writing, I believe) but Windows95 has left spaces to more fully support unicodes in
the future. You can keep up with the Unicode development by visiting the Unicode webpage
at <a href="http://www.unicode.org/">www.unicode.org</a>. Note that, in the 2-byte unicode
character, the first byte is always the character and the second byte is always the blank,
as opposed to having the first byte blank and the second byte blank. There is a perfectly
logical explanation for this but it's kind of long to get into at the moment so e-mail me
if you are curious. (If you have a computer dictionary, look up &quot;little endian&quot;
and it'll explain everything.) For our purposes, though, just treat every other word as an
ASCII character as long as the following byte is a blank character. Anyways, notice that,
in order to maintain the compatibility with older programs, the attribute byte and the
cluster word had to be kept. Because of this, each unicode character had to be scattered
throughout the entry. </p>
<p>By now you probably noticed that there is no file information (size, date, etc.) stored
in the LFN entry. Any information about the file itself is stored in the 8.3 filename,
located below all the LFN entries (as <a href="#organization">mentioned before</a>). </p>
<p>The checksum is created from the shortname data. The steps/equation used to calculate
this checksum is as follows: </p>
<div align="center"><center>
<table width="80%" border="1">
<tr>
<th>Step # </th>
<th>Task </th>
</tr>
<tr>
<td align="center">1 </td>
<td align="left">&nbsp;&nbsp; Take the ASCII value of the first character. This is your
first sum. </td>
</tr>
<tr>
<td align="center">2 </td>
<td align="left">&nbsp;&nbsp; Rotate all the bits of the sum rightward by one bit. </td>
</tr>
<tr>
<td align="center">3 </td>
<td align="left">&nbsp;&nbsp; Add the ASCII value of the next character with the value
from above. This is your next sum. </td>
</tr>
<tr>
<td align="center">4 </td>
<td align="left">&nbsp;&nbsp; Repeat steps 2 through 3 until you are all through with the
11 characters in the 8.3 filename. </td>
</tr>
</table>
</center></div>
<p align="center">In C/C++, the above steps look like this: </p>
<div align="center"><center>
<table width="80%" border="0">
<tr>
<td><br>
<code>for (sum = i = 0; i &lt; 11; i++) {</code> <br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;sum = (((sum &amp; 1) &lt;&lt; 7) | ((sum &amp; 0xfe)
&gt;&gt; 1)) + name[i];</code> <br>
<code>}</code> </td>
</tr>
</table>
</center></div>
<p>This resulting checksum value is stored in each of the LFN entry to ensure that the
short filename it points to indeed is the currently 8.3 entry it should be pointing to. </p>
<p>Also, note that any file with a name that does not fill up the 8.3 spaces completely
leaves a trace of space characters (ASCII value 32) in the blank spaces. These blank
spaces do go into the calculation of the checksum and does not get left out of the
calculation. </p>
<p>I'm sure you're dying to know what the ordinal field is. This byte of information tells
the order of the LFN entries (1st LFN entry, 2nd LFN entry, etc.) If it's out of order,
something is wrong! How Windows95 would deal with LFN when such a thing happen is a
mystery to me. <br>
&nbsp;&nbsp; An example of how ordinal field work: The first LFN entry, located at the
very bottom as we have <a href="#organization">seen before</a>, has an ordinal field value
1; the second entry (if any -- remember that a LFN doesn't always have to be tens of
characters long), located just before the first entry, has an ordinal field value of 2;
etc. As an added precaution, the last entry has a marking on the ordinal field that tells
that it is the last entry. This marking is done by setting the 6th bit of the ordinal
field. </p>
<p>That is basically all there is to long filenames. But before we end this conversation
(while we're on the subject of LFN,) I think it would be interesting to note that, since
any long filename can be up to 255 bytes long and each entry can hold up to 13 characters,
there can only be up to 20 entries of LFN per file. That means it only needs 5 bits (0th
bit to 4th bit) of the ordinal field. And with the 6th bit used to mark the last entry,
two bits are left for open usage -- the 5th and the 7th bit. Whether or not Microsoft is
going to do anything with these bits -- or why Microsoft used the 6th bit to indicate the
last entry instead of 7th or 5th bit and limited the file length to 255 bits -- remains to
be a mystery only Microsoft will keep to itself. </p>
<hr>
<h3>Credit</h3>
<p><font size="-1">Much the information in this documentation has been gathered from
Norton Utilities for Windows95 user's manual. Detailed researches were done using Norton
Utilities Disk Edit. The checksum calculation was graciously donated by Jacob Verhoeks to <code>comp.os.msdos.programmer</code>
Newsgroup as a reply to my request. Apparently the file Mr. Verhoeks used to get me the
checksum code, <code>vfat.txt</code>, that comes with newer Linux operating systems have
some good information on Windows95 LFN. BTW, I just (like, right now) found out that
checksum algorithm is also in Ralf Brown's Interrupt List. </font></p>
<hr>
<p>Copyright ©1996-1998 vinDaci </p>
</body>
</html>

BIN
references/FAT16/MS_fatgen102.pdf

Binary file not shown.

319
references/FAT16/Maverick FAT16 reference/Maverick - FAT16 - LFN.html

@ -0,0 +1,319 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- http://www.maverick-os.dk/FileSystemFormats/VFAT_LongFileNames.html -->
<HTML LANG="en">
<HEAD>
<TITLE>Maverick - The Operating System</TITLE>
<META NAME="author" CONTENT="Lasse Krogh Thygesen">
<META NAME="copyright" CONTENT="(C) 1999 Lasse Krogh Thygesen">
<META NAME="keywords" CONTENT="maverick,operating system,os,x86,intel,ata,ide,eide,atapi,pic,pit,dma,protected mode,pmode">
<META NAME="description" CONTENT="">
<LINK REL="stylesheet" TYPE="text/css" HREF="Maverick.css">
</HEAD>
<BODY>
<DIV CLASS="MiniMenu">
[<A HREF="FAT32_FileSystem.html" TITLE="FAT32 File System">Previous</A>]
- [<A HREF="../Mainmenu_NoFrames.html" TITLE="Go to main menu">Main menu</A>]
- [<A HREF="../FileFormats/FileFormatID.html" TITLE="File Format ID">Next</A>]<BR>
</DIV>
<H1 CLASS="PreTitle">Specifications</H1>
<H1>VFAT Long File Names</H1>
<H1 CLASS="SubTitle">Usage: Stores long filenames (LFN) for Windows</H1>
<HR>
<DIV ID="Introduction">
<H2>Introduction</H2>
This isn't a file system in itself, but a kind of sub file system, which can be placed over a FAT12, FAT16 or FAT32 file system. The VFAT system is a way of hiding long file names in the directory structure of the FAT file systems.<BR>
<BR>
The filenames are stored using unicode characters which are 16 bit long.<BR>
<BR>
<BR>
</DIV>
<DIV ID="CoexistenceWithFAT">
<H2>Coexistence with FAT12, FAT16 & FAT32</H2>
Depending on the length of the long filename, the system will create a number of invalid 8.3 entries in the Directory Table, these are the LFN (Long Filename) entries. These <ABBR TITLE="Long Filename">LFN</ABBR> entries are stored with the with the last LFN entry topmost, and the first LFN entry just above a valid Directory Entry. So when looked upon from the top and down, the Directory Table looks something like this:<BR>
<BR>
<DIV ID="DirectoryExample" CLASS="Centered">
<TABLE WIDTH="90%" SUMMARY="Directory Example">
<CAPTION>
Directory Example
</CAPTION>
<COLGROUP>
<COL WIDTH="20%" ALIGN="Center" VALIGN="Top">
<COL WIDTH="40%" ALIGN="Center" VALIGN="Top">
<COL WIDTH="40%" ALIGN="Center" VALIGN="Top">
</COLGROUP>
<THEAD>
<TR>
<TH ALIGN="Center" VALIGN="Middle">Entry Nr.</TH>
<TH ALIGN="Center" VALIGN="Middle">Without LFN Entries</TH>
<TH ALIGN="Center" VALIGN="Middle">With LFN Entries</TH>
</TR>
</THEAD>
<TBODY>
<TR><TD>...</TD><TD>...</TD><TD>...</TD></TR>
<TR><TD>n</TD><TD>Normal 1</TD><TD>Normal 1</TD></TR>
<TR><TD>n+1</TD><TD>Normal 2</TD><TD>LFN for Normal 2 - Part 3</TD></TR>
<TR><TD>n+2</TD><TD>Normal 3</TD><TD>LFN for Normal 2 - Part 2</TD></TR>
<TR><TD>n+3</TD><TD>Normal 4</TD><TD>LFN for Normal 2 - Part 1</TD></TR>
<TR><TD>n+4</TD><TD>Normal 5</TD><TD>Normal 2</TD></TR>
<TR><TD>n+5</TD><TD>Normal 6</TD><TD>Normal 3</TD></TR>
<TR><TD>...</TD><TD>...</TD><TD>...</TD></TR>
</TBODY>
</TABLE>
</DIV>
<BR>
The LFN entries have the Volume Name, Hidden, System and the Read-Only flags set. So most programs won't display them because of the Volume Name flag (Volume entries are rarely displayed), and they won't be overwridden because of the Read-Only flag.<BR>
<BR>
<BR>
</DIV>
<DIV ID="DirectoryEntries">
<H2>Directory Entries</H2>
The VFAT Directory Format, can coexist on a normal FATxx system. The LFN entries are hidden from normal programs, and available to those who know how to read them. But in addition to the LFN entries the VFAT Directory Format enhances the original structure of the Directory Table as found in FAT16. The Directory Table can still be read by older applications, but all the unused space from the FAT16 format, is now used to store some additional information. This is the format of the VFAT Directory entries:<BR>
<BR>
<DIV ID="DirectoryEntryStructure" CLASS="Centered">
<TABLE WIDTH="90%" SUMMARY="Structure of the VFAT Directory Entries">
<CAPTION>
Structure of the VFAT Directory Entries
</CAPTION>
<COLGROUP>
<COL WIDTH="15%" ALIGN="Center" VALIGN="Top">
<COL WIDTH="15%" ALIGN="Center" VALIGN="Top">
<COL WIDTH="70%" ALIGN="Left" VALIGN="Top">
</COLGROUP>
<THEAD>
<TR>
<TH ALIGN="Center" VALIGN="Middle">Offset</TH>
<TH ALIGN="Center" VALIGN="Middle">Size</TH>
<TH ALIGN="Center" VALIGN="Middle">Description</TH>
</TR>
</THEAD>
<TBODY>
<TR><TD>00h</TD><TD>8 bytes</TD><TD>Filename</TD></TR>
<TR><TD>08h</TD><TD>3 bytes</TD><TD>Filename extension</TD></TR>
<TR><TD>0Bh</TD><TD>1 bytes</TD><TD><A HREF="#FlagByte">Flag byte</A></TD></TR>
<TR><TD>0Ch</TD><TD>1 bytes</TD><TD>NT - Reserved for Windows NT - Should always be 0000h</TD></TR>
<TR><TD>0Dh</TD><TD>1 bytes</TD><TD>Creation Time - Millisecond</TD></TR>
<TR><TD>0Eh</TD><TD>2 bytes</TD><TD>Creation Time - Hour & Minute</TD></TR>
<TR><TD>10h</TD><TD>2 bytes</TD><TD>Created Date</TD></TR>
<TR><TD>12h</TD><TD>2 bytes</TD><TD>Last Accessed Data</TD></TR>
<TR><TD>14h</TD><TD>2 bytes</TD><TD>Starting cluster (High word) on FAT32 file systems, else 0000h</TD></TR>
<TR><TD>16h</TD><TD>2 bytes</TD><TD>Time</TD></TR>
<TR><TD>18h</TD><TD>2 bytes</TD><TD>Date</TD></TR>
<TR><TD>1Ah</TD><TD>2 bytes</TD><TD>Starting cluster (Low word)</TD></TR>
<TR><TD>1Ch</TD><TD>4 bytes</TD><TD>File size in bytes</TD></TR>