AN1045

Started by tha, May 05, 2022, 03:04:40 PM

Previous topic - Next topic

tha

Master Boot Record

The MBR บรรจุ information ที่ถูกใช้เพื่อบูท the card, เช่นเดียวกันกับ information เกี่ยวกับ the partitions บน the card. The information ใน the master boot record ถูกโปรแกรมเมื่อ the card ถูกสร้างจากโรงงาน, และความพยายามใดๆเพื่อเขียนไปยัง the MBR อาจทำให้ the disk ใช้งานไม่ได้. สิ่งที่บรรจุอยู่ภายในของ the MBR ถูกแสดงรายการใน Table 1.

         

tha

Partition Entry in the MBR

ข้อมูลเกี่ยวกับ a partition บน the disk ถูกบรจุใน a partition table entry ของ the master boot record. A file system descriptor ถูกรวมใน the entry เพื่อแสดงให้เห็นว่าชนิดไหนของ file system ถูกระบุแล้วเมื่อตอน the partition ถูกฟอร์แมต. The following(ตามมา) file descriptor values แสดงให้เห็น FAT16 formatting: 04h (16-bit FAT, < 32M), 06h (16-bit FAT, ≥ 32M) และ 0Eh (DOS CHS ถูกแมป). SD cards โดยทั่วไปบรรจุ a single active partition. สิ่งที่บรรจุอยู่ภายในของ a partition table entry ถูกแสดงรายการใน Table 2.

         

tha

Boot Sector

The boot sector เป็น the first sector ของ a partition. มันบรรจุ file system information, ตลอดจน pointers ไปยังส่วนสำคัญของ the partition. The first entry ใน the boot sector คือ a command เพื่อ jump ผ่าน the boot information. The complete contents สามารถถูกดูได้ใน Table 3.



tha

Root Directory

The root directory, ถูกวางตำแหน่งอยู่หลัง the FAT region บน the disk, เป็น a table ที่เก็บ file and directory information ใน 32-byte entries. An entry ประกอบด้วย the file name, file size, the first cluster of the file และเวลาที่ the file ถูกสร้างขึ้น และ/หรือถูกแก้ไข.

tha

หมายเหตุ: โดยทั่วไป, a file entry จะสอดคล้องกับ “eight dot three(8.3)” short file name format. มีเพียงตัวเลข 0 ถึง 9, ตัวอักษร A ถึง Z, อักขระช่องว่างและอักขระพิเศษ, ! # $ % & ( ) - @ ^ _ ' { } ~ ', ถูกใช้. แม้จะเป็นเรื่องธรรมดาเพื่อพิจารณา the period (.) และนามสกุลเป็นองค์ประกอบของ the file name, ในกรณีนี้, ไม่มีอักขระใดหลัง the initial name ถูกใช้เป็นส่วนหนึ่งของ the actual file name.

ตัวอย่างเช่น ไฟล์ชื่อ "FILE.TXT" จะมีชื่อไฟล์ว่า "FILE_ _ _ _" ใน the root directory, ด้วย the final 4 characters ถูกแทนที่โดย 4 instances of the space character "20h".

tha

The complete contents of a root directory entry ถูกแสดงใน Table 4.
         
หมายเหตุ 1: อักขระตัวแรกของชื่อไฟล์สามารถรับค่าพิเศษ (ดูตารางที่ 5)


tha

File Allocation Table

The FAT มีพื้นที่สำหรับ one 2-byte entry เพื่อให้ตรงกันกับทุกๆ cluster ใน the data cluster section ของ the partition. ตัวอย่างเช่น, ชุดที่สามของ two bytes ใน the FAT จะตรงกันกับ the first cluster ใน the data region. A value ที่วางในแต่ละ position สามารถแสดงให้เห็นหลายอย่าง. A list of values สามารถถูกพบใน Table 6.

         

tha

ทุกๆ file มีอย่างน้อย one cluster กำหนดให้กับมัน. ถ้าขนาดไฟล์นั้นเล็กกว่าขนาดของ a cluster, the FAT entry สำหรับ cluster นั้นจะบรรจุ the last cluster value, แสดงให้เห็นว่าไม่มี clusters อีกต่อไปกำหนดให้กับไฟล์นั้น. มิฉะนั้น, มันจะบรรจุค่าของ the next cluster of the file. โดยการเชื่อมโยง clusters ในวิธีนี้, the FAT สามารถสร้าง a chain of clusters เพือบรรจุไฟล์ที่ใหญ่ขึ้น, และสามารถจัดสรร clusters ที่ไม่ต่อเนื่องให้กับ a file.