File Systems

Total Page:16

File Type:pdf, Size:1020Kb

File Systems File systems Gaël Thomas # 1 CSC4508 – Operating Systems 2020–2021 File systems Outlines 1 Device and device driver . 3 2 TheI/Ocache................................................................9 # 2 3 The log.......................................................................16 4 Partitions and file systems . 29 5 UFS/xv6 file system. .34 6 Xv6 I/O stack . 42 7 What you must remember . 49 Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 2/49 File systems 1 Device and device driver 1.1 Device and device driver . 4 # 3 1.2 Devices in UNIX . 5 1.3 2 types of peripherals . 6 1.4 Block devices in xv6 . 7 1.5 Principle of the iderw algorithm . 8 Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 3/49 File systems 1 Device and device driver 1.1 Device and device driver ■ Device = hardware component other than CPU and memory # 4 ■ Device driver = software allowing access to a device ♦ 1 data structure giving the status of the device ♦ 1 input / output function allowing access to the device ♦ The driver is usually found in the kernel Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 4/49 File systems 1 Device and device driver 1.2 Devices in UNIX ■ A device is identified by a number called dev ♦ Most significant bits (major): driver number I # 5 For example: 8 = ssd hard drive driver ■ Least significant bits (minor): device number ♦ For example: 0 = disk 1, 1 = disk 1 / part 1, 2 = disk 1 / part 2 ■ The kernel contains a table which associates a driver number with the driver (access function + status) Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 5/49 File systems 1 Device and device driver 1.3 2 types of peripherals ■ “character”devices ♦ Read / write byte by byte ♦ Generally access via MMIO or input / output bus → blocks the CPU during the I/O operation ♦ # 6 Keyboard, printer, sound card ... ■ “block”devices ♦ Read / write by data blocks (typically 512 bytes) ♦ The device is therefore seen as an array of blocks ♦ Usually access via DMA → does not block the CPU during the I / O operation ♦ Hard disk, DVD player ... Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 6/49 File systems 1 Device and device driver 1.4 Block devices in xv6 ■ A single block device driver in xv6 ♦ Manages IDE hard disks ♦ Function iderw () in ide.c ■ iderw() takes a buf (buf.h) structure as a parameter # 7 ♦ buf.flags : I B_VALID: if false, read operation requested I B_DIRTY: if true, write operation requested ♦ buf.dev/blockno: access to block blockno from disk dev ♦ buf.data: data read or written I If read, the output of iderw, data = data read I If write, the input of iderw, data = data to write Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 7/49 File systems 1 Device and device driver 1.5 Principle of the iderw algorithm ■ iderw mainly performs the following actions: ♦ Start the DMA transfer (see lecture #5) I From memory to disk if write request I From disk to memory if read request # 8 ♦ Sleep the process with the sleep function (see lecture #4) → switch to another ready process ■ Once the transfer is complete ♦ The disk generates an interrupt ♦ The interrupt is handled by the ideintr function ♦ ideintr calls wakeup to wake up the sleeping process Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 8/49 File systems 2 The I / O cache 2.1 The I/O cache . 10 2.2 Principle of an I/O cache . 11 # 9 2.3 The xv6 buffer cache . 12 2.4 How the buffer cache works (1/3). .13 2.5 How the buffer cache works (2/3). .14 2.6 How the buffer cache works (3/3). .15 Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 9/49 File systems 2 The I / O cache 2.1 The I/O cache ■ Disk access is very slow compared to memory access ♦ Hard disk drive: several milliseconds ♦ SSD disk: x10, hundreds of microseconds # 10 ♦ NVMe disk: x100, microseconds ♦ Memory: x100, dozens of nanoseconds ■ I/O cache improves the performance of block type devices ♦ Keeps frequently or recently used blocks in memory ♦ Managed by the operating system kernel Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 10/49 File systems 2 The I / O cache 2.2 Principle of an I/O cache ■ The system manages a set of buffers in memory ■ To read a block (read operation) ♦ If the block is not yet in the cache 1. Remove an unused buffer from the cache # 11 2. Copy the contents of the disk block to this buffer ♦ Otherwise, simply return the buffer associated with the block ■ To modify a block (write operation) 1. Read the block (call the read operation) 2. Modifies the contents of the buffer in memory 3. Mark buffer as modified (written to disk later) Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 11/49 File systems 2 The I / O cache 2.3 The xv6 buffer cache ■ buffer cache = xv6 I/O cache ♦ Made up of a finite set of buf structures ♦ Each buf structure is associated with a block of a disk # 12 ■ Three possible states ♦ ! B_VALID: read operation incomplete rightarrow requires read ♦ B_VALID and ! B_DIRTY: data in memory and buffer is unmodified ♦ B_VALID and B_DIRTY : data in memory and buffer is modified → need to be written to disk before leaving the cache → in iderw(), ! B_VALID ⇔ read and B_DIRTY ⇔ write Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 12/49 File systems 2 The I / O cache 2.4 How the buffer cache works (1/3) ■ The buf structures form a circular double linked list, the head is the most recently used block ■ struct buf* bget(uint dev, uint blkno) : return a locked buffer associated to (dev, blkno) # 13 ♦ If there is already an buffer associated with (dev,blkno) I Increments a reference counter associated with the buffer I Locks the buffer I Return the buffer ♦ Otherwise I Search for a buffer with counter == 0 and with the state ! B_DIRTY I Associate the buffer with (dev, blkno) (+ cpt = 1 and lock the buffer) Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 13/49 File systems 2 The I / O cache 2.5 How the buffer cache works (2/3) ■ struct buf* bread(uint dev, uint blkno) ♦ Return a locked buffer in the B_VALID state ♦ Call bget() # 14 ♦ If the buffer is ! B_VALID, call iderw() ■ void bwrite(struct buf* b) ♦ Writes the contents of b to disk ♦ Mark the buffer B_DIRTY ♦ Call iderw() to write the buffer Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 14/49 File systems 2 The I / O cache 2.6 How the buffer cache works (3/3) ■ void brelse(struct buf* b) # 15 ♦ Release the lock associated with b ♦ Decreases the reference counter ♦ Move the buffer to the head of the list (most recently used) Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 15/49 File systems 3 The log 3.1 Operation versus writing to disk. .17 3.2 Consistency issues . 18 3.3 Bad solutions . 19 3.4 First idea: transactions . 20 3.5 Second idea: log . 21 # 16 3.6 Third idea: parallel log . 22 3.7 log structure . 23 3.8 Log algorithm principle . 24 3.9 Using the log . 25 3.10 Implementation in xv6 (1/3). .26 3.11 Implementation in xv6 (2/3). .27 3.12 Implementation in xv6 (3/3). .28 Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 16/49 File systems 3 The log 3.1 Operation versus writing to disk ■ A write operation of a process often requires several block writes ♦ File creation requires: I Allocation of a new file I Adding the name to a directory # 17 ♦ Adding data to a file requires: I Writing new blocks to disk I Updating the file size ♦ Deleting a file requires: I Deleting the data blocks from the file I Deleting the name from the directory ♦ ... Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 17/49 File systems 3 The log 3.2 Consistency issues ■ The system can crash anytime → Inconsistency if it stops in the middle of an operation I A name in a directory references a non-existent file I Data added to a file but size not updated # 18 I ... ■ operations must be propagated in the order in which they were performed → Inconsistency if propagation in random order I Adding a file then deleting =⇒ the file does not exist at the end I Deleting a file then adding =⇒ the file exists at the end I Similarly, adding data then truncating (size should be 0) I ... Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 18/49 File systems 3 The log 3.3 Bad solutions ■ No cache when writing (directly propagate write operations) ♦ Very inefficient because each write becomes very (very!) slow # 19 ■ Recovery in the case of a crash ♦ Recovering a file system is slow I examples: FAT32 on Windows or ext2 on Linux ♦ Recovering is not always possible → a crash makes the filesystem unusable! Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 19/49 File systems 3 The log 3.4 First idea: transactions ■ A transaction is a set of write operation that is ♦ Either fully executed ♦ Or not executed at all ■ Principle of implementation # 20 ♦ An operation (coherent set of writes) == a transaction ♦ The writes of a transaction are first written to disk in a "pending" area ♦ Once the operation is complete, the "pending" area is marked as valid (the transaction is complete) ♦ Regularly (or in the event of a crash), validated writes in the pending zone are propagated to the file system Télécom SudParis — Gaël Thomas — 2020–2021 — CSC4508 – Operating Systems 20/49 File systems 3 The log 3.5 Second idea: log ■ To ensure that the entries are propagated in order in which they were executed, the # 21 pending zone is
Recommended publications
  • Allgemeines Abkürzungsverzeichnis
    Allgemeines Abkürzungsverzeichnis L.
    [Show full text]
  • Active@ UNDELETE Documentation
    Active @ UNDELETE Users Guide | Contents | 2 Contents Legal Statement.........................................................................................................5 Active@ UNDELETE Overview............................................................................. 6 Getting Started with Active@ UNDELETE.......................................................... 7 Active@ UNDELETE Views And Windows...................................................................................................... 7 Recovery Explorer View.......................................................................................................................... 8 Logical Drive Scan Result View..............................................................................................................9 Physical Device Scan View......................................................................................................................9 Search Results View...............................................................................................................................11 File Organizer view................................................................................................................................ 12 Application Log...................................................................................................................................... 13 Welcome View........................................................................................................................................14 Using
    [Show full text]
  • Active @ UNDELETE Users Guide | TOC | 2
    Active @ UNDELETE Users Guide | TOC | 2 Contents Legal Statement..................................................................................................4 Active@ UNDELETE Overview............................................................................. 5 Getting Started with Active@ UNDELETE........................................................... 6 Active@ UNDELETE Views And Windows......................................................................................6 Recovery Explorer View.................................................................................................... 7 Logical Drive Scan Result View.......................................................................................... 7 Physical Device Scan View................................................................................................ 8 Search Results View........................................................................................................10 Application Log...............................................................................................................11 Welcome View................................................................................................................11 Using Active@ UNDELETE Overview................................................................. 13 Recover deleted Files and Folders.............................................................................................. 14 Scan a Volume (Logical Drive) for deleted files..................................................................15
    [Show full text]
  • MSD FATFS Users Guide
    Freescale MSD FATFS Users Guide Document Number: MSDFATFSUG Rev. 0 02/2011 How to Reach Us: Home Page: www.freescale.com E-mail: [email protected] USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 [email protected] Europe, Middle East, and Africa: Information in this document is provided solely to enable system and Freescale Halbleiter Deutschland GmbH software implementers to use Freescale Semiconductor products. There are Technical Information Center no express or implied copyright licenses granted hereunder to design or Schatzbogen 7 fabricate any integrated circuits or integrated circuits based on the 81829 Muenchen, Germany information in this document. +44 1296 380 456 (English) +46 8 52200080 (English) Freescale Semiconductor reserves the right to make changes without further +49 89 92103 559 (German) notice to any products herein. Freescale Semiconductor makes no warranty, +33 1 69 35 48 48 (French) representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability [email protected] arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or Japan: incidental damages. “Typical” parameters that may be provided in Freescale Freescale Semiconductor Japan Ltd. Semiconductor data sheets and/or specifications can and do vary in different Headquarters applications and actual performance may vary over time. All operating ARCO Tower 15F parameters, including “Typicals”, must be validated for each customer 1-8-1, Shimo-Meguro, Meguro-ku, application by customer’s technical experts.
    [Show full text]
  • IT Acronyms.Docx
    List of computing and IT abbreviations /.—Slashdot 1GL—First-Generation Programming Language 1NF—First Normal Form 10B2—10BASE-2 10B5—10BASE-5 10B-F—10BASE-F 10B-FB—10BASE-FB 10B-FL—10BASE-FL 10B-FP—10BASE-FP 10B-T—10BASE-T 100B-FX—100BASE-FX 100B-T—100BASE-T 100B-TX—100BASE-TX 100BVG—100BASE-VG 286—Intel 80286 processor 2B1Q—2 Binary 1 Quaternary 2GL—Second-Generation Programming Language 2NF—Second Normal Form 3GL—Third-Generation Programming Language 3NF—Third Normal Form 386—Intel 80386 processor 1 486—Intel 80486 processor 4B5BLF—4 Byte 5 Byte Local Fiber 4GL—Fourth-Generation Programming Language 4NF—Fourth Normal Form 5GL—Fifth-Generation Programming Language 5NF—Fifth Normal Form 6NF—Sixth Normal Form 8B10BLF—8 Byte 10 Byte Local Fiber A AAT—Average Access Time AA—Anti-Aliasing AAA—Authentication Authorization, Accounting AABB—Axis Aligned Bounding Box AAC—Advanced Audio Coding AAL—ATM Adaptation Layer AALC—ATM Adaptation Layer Connection AARP—AppleTalk Address Resolution Protocol ABCL—Actor-Based Concurrent Language ABI—Application Binary Interface ABM—Asynchronous Balanced Mode ABR—Area Border Router ABR—Auto Baud-Rate detection ABR—Available Bitrate 2 ABR—Average Bitrate AC—Acoustic Coupler AC—Alternating Current ACD—Automatic Call Distributor ACE—Advanced Computing Environment ACF NCP—Advanced Communications Function—Network Control Program ACID—Atomicity Consistency Isolation Durability ACK—ACKnowledgement ACK—Amsterdam Compiler Kit ACL—Access Control List ACL—Active Current
    [Show full text]
  • Commonly Used Acronyms
    Commonly Used Acronyms A Amperes AC Alternating Current CLA Carry Look-ahead Adder A/D Analog to Digital CMOS Complementary Metal-Oxide Semicon- ADC Analog to Digital Converter ductor AE Applications Engineer CP/M Control Program / Monitor AI Artificial Intelligence CPI Clocks Per Instruction ALU Arithmetic-Logic Unit CPLD Complex Programmable Logic Device AM Amplitude Modulation CPU Central Processing Unit AMD Advanced Micro Devices, Inc. CR Carriage Return ANSI American National Standards Institute CRC Cyclic Redundancy Code ARQ Automatic Retransmission reQuest CRQ Command Response Queue ASCII American Standard Code for Information CRT Cathode Ray Tube Interchange CS Chip Select / Check-Sum ASEE American Society for Engineering Educa- CSMA Carrier Sense Multiple-Access tion CSMA/CD Carrier Sense Multiple-Access with Colli- ASIC Application Specific Integrated Circuit sion Detect ASPI Advanced SCSI Programming Interface CSR Command Status Register ATDM Asynchronous Time Division Multiplexing CTS Clear To Send ATM Asynchronous Transfer Mode AUI Attached Unit Interface D Dissipation Factor D/A Digital to Analog B Magnetic Flux DAC Digital to Analog Converter BBS Bulletin Board System DAT Digital Audio Tape BCC Block Check Character dB (DB) deciBels BCD Binary Coded Decimal dBm dB referenced to 1 milliWatt BiCMOS Bipolar Complementary Metal-Oxide Semi- DC Direct Current conductor DCD Data Carrier Detect BIOS Basic Input / Output System DCE Data Circuit (Channel) Equipment BNC Bayonet Nut(?) Connector DD Double Density BPS/bps Bytes/bits
    [Show full text]
  • File Systems
    File Systems Tanenbaum Chapter 4 Silberschatz Chapters 10, 11, 12 1 File Systems Essential requirements for long-term information storage: • It must be possible to store a very large amount of information. • The information must survive the termination of the process using it. • Multiple processes must be able to access the information concurrently. 2 File Structure • None: – File can be a sequence of words or bytes • Simple record structure: – Lines – Fixed Length – Variable Length • Complex Structure: – Formatted documents – Relocatable load files • Who decides? 3 File Systems Think of a disk as a linear sequence of fixed-size blocks and supporting reading and writing of blocks. Questions that quickly arise: • How do you find information? • How do you keep one user from reading another’s data? • How do you know which blocks are free? 4 File Naming Figure 4-1. Some typical file extensions. 5 File Access Methods • Sequential Access – Based on a magnetic tape model – read next, write next – reset • Direct Access – Based on fixed length logical records – read n, write n – position to n – relative or absolute block numbers 6 File Structure Figure 4-2. Three kinds of files. (a) Byte sequence. (b) Record sequence. (c) Tree. 7 File Types • Regular Files: – ASCII files or binary files – ASCII consists of lines of text; can be displayed and printed – Binary, have some internal structure known to programs that use them • Directory – Files to keep track of files • Character special files (a character device file) – Related to I/O and model serial I/O devices • Block special files (a block device file) – Mainly to model disks File Types Figure 4-3.
    [Show full text]
  • File Systems: Semantics & Structure What Is a File
    5/15/2017 File Systems: Semantics & Structure What is a File 11A. File Semantics • a file is a named collection of information 11B. Namespace Semantics • primary roles of file system: 11C. File Representation – to store and retrieve data – to manage the media/space where data is stored 11D. Free Space Representation • typical operations: 11E. Namespace Representation – where is the first block of this file 11L. Disk Partitioning – where is the next block of this file 11F. File System Integration – where is block 35 of this file – allocate a new block to the end of this file – free all blocks associated with this file File Systems Semantics and Structure 1 File Systems Semantics and Structure 2 Data and Metadata Sequential Byte Stream Access • File systems deal with two kinds of information int infd = open(“abc”, O_RDONLY); int outfd = open(“xyz”, O_WRONLY+O_CREATE, 0666); • Data – the contents of the file if (infd >= 0 && outfd >= 0) { – e.g. instructions of the program, words in the letter int count = read(infd, buf, sizeof buf); Metadata – Information about the file • while( count > 0 ) { e.g. how many bytes are there, when was it created – write(outfd, buf, count); sometimes called attributes – count = read(infd, inbuf, BUFSIZE); • both must be persisted and protected } – stored and connected by the file system close(infd); close(outfd); } File Systems Semantics and Structure 3 File Systems Semantics and Structure 4 Random Access Consistency Model void *readSection(int fd, struct hdr *index, int section) { struct hdr *head = &hdr[section];
    [Show full text]
  • Allegato 2 Formati Di File E Riversamento
    Formati di file e riversamento Allegato 2 al documento “Linee Guida sulla formazione, gestione e conservazione dei documenti informatici”. Sommario 1.1 Definizioni fondamentali 3 1.1.1 File, flussi digitali e buste-contenitori 4 1.1.2 Filesystem e metadati 5 1.1.3 Metadati e identificazione del formato 8 1. 2 Tassonomia 9 1.2.1 Tipologie di formati 9 1.2.2 Classificazione di formati 11 1.2.3 Formati generici e specifici 14 2.1 Documenti impaginati 21 2.1.1 Raccomandazioni per la produzione di documenti 33 2.2 Ipertesti 34 2.2.1 Raccomandazioni per la produzione di documenti 41 2.3 Dati strutturati 42 2.3.1 Raccomandazioni per la produzione di documenti 52 2.4 Posta elettronica 53 2.4.1 Raccomandazioni per la produzione di documenti 55 2.5 Fogli di calcolo e presentazioni multimediali 55 2.5.1 Raccomandazioni per la produzione di documenti 59 2.6 Immagini raster 60 2.6.1 Raccomandazioni per la produzione di documenti 74 2.7 Immagini vettoriali e modellazione digitale 77 2.7.1 Raccomandazioni per la produzione di documenti 84 2.8 Caratteri tipografici 84 2.8.1 Raccomandazioni per la produzione di documenti 86 2.9 Audio e musica 87 2.9.1 Raccomandazioni per la produzione di documenti 92 2.10 Video 93 2.10.1 Raccomandazioni per la produzione di documenti 102 2.11 Sottotitoli, didascalie e dialoghi 103 2.11.1 Raccomandazioni per la produzione di documenti 108 2.12 Contenitori e pacchetti di file multimediali 108 2.12.1 Raccomandazioni per la produzione di documenti 131 2.13 Archivi compressi 132 2.13.1 Raccomandazioni per la produzione di documenti 138 2.14 Documenti amministrativi 138 2.15 Applicazioni e codice sorgente 142 2.16 Applicazioni crittografiche 142 3.1 Valutazione di interoperabilità 147 3.2 Indice di interoperabilità 149 3.3 Riversamento 150 1 Introduzione 1.
    [Show full text]
  • Part 2 FILE SYSTEM SPECIFICATION
    SD Memory Card Specifications Part 2 FILE SYSTEM SPECIFICATION Version 1.0 February 2000 Standard SD Group Matsushita Electric Industrial Co., Ltd. (MEI) SanDisk Corporation ToshibaMicrosystems Corporation CONFIDENTIAL Standard Microsystems SD Memory Card Specifications / Part 2. File System Specification Version 1.0 Conditions for publication Publisher and Copyright Holder SD Group(MEI, SanDisk, Toshiba) Confidentiality This document shall be treated as confidential under the Non Disclosure Agreement which has been signed by the obtainer. Reproduction in whole or in part is prohibited without prior written permission of SD Group. Exemption None will be liable for any damages from use of this document. Standard Microsystems DO NOT COPY ã2000 SD Group (MEI, SanDisk, Toshiba). FS-0 CONFIDENTIAL SD Memory Card Specifications / Part 2. File System Specification Version 1.0 This page is intentionally left blank. Standard Microsystems DO NOT COPY ã2000 SD Group (MEI, SanDisk, Toshiba). CONFIDENTIAL SD Memory Card Specifications / Part 2. File System Specification Version 1.0 Part2 FILE SYSTEM SPECIFICATION 1. General.............................................................................................................................................................. FS-1 1.1 Scope ..................................................................................................................................................................... 1 1.2 Normative References .......................................................................................................................................
    [Show full text]
  • File Allocation Table - Wikipedia, the Free Encyclopedia Page 1 of 22
    File Allocation Table - Wikipedia, the free encyclopedia Page 1 of 22 File Allocation Table From Wikipedia, the free encyclopedia File Allocation Table (FAT) is a file system developed by Microsoft for MS-DOS and is the primary file system for consumer versions of Microsoft Windows up to and including Windows Me. FAT as it applies to flexible/floppy and optical disc cartridges (FAT12 and FAT16 without long filename support) has been standardized as ECMA-107 and ISO/IEC 9293. The file system is partially patented. The FAT file system is relatively uncomplicated, and is supported by virtually all existing operating systems for personal computers. This ubiquity makes it an ideal format for floppy disks and solid-state memory cards, and a convenient way of sharing data between disparate operating systems installed on the same computer (a dual boot environment). The most common implementations have a serious drawback in that when files are deleted and new files written to the media, directory fragments tend to become scattered over the entire disk, making reading and writing a slow process. Defragmentation is one solution to this, but is often a lengthy process in itself and has to be performed regularly to keep the FAT file system clean. Defragmentation should not be performed on solid-state memory cards since they wear down eventually. Contents 1 History 1.1 FAT12 1.2 Directories 1.3 Initial FAT16 1.4 Extended partition and logical drives 1.5 Final FAT16 1.6 Long File Names (VFAT, LFNs) 1.7 FAT32 1.8 Fragmentation 1.9 Third party
    [Show full text]
  • Implementing File I/O Functions Using Microchip's Memory Disk Drive File
    AN1045 Implementing File I/O Functions Using Microchip’s Memory Disk Drive File System Library have two electrically determined signals, card detect Author: Peter Reen and write-protect, that allow the user to determine if the Microchip Technology Inc. card is physically inserted and/or write-protected. The MMC does not have a physical write-protect INTRODUCTION signal, but most card connectors will default to a non-write-protected state in this case. This application note covers the usage of file I/O func- ® tions using Microchip’s memory disk drive file system More information about interfacing PIC microcontrol- library. Microchip’s memory disk drive file system is: lers to SD cards or MMCs is included in AN1003, “USB Mass Storage Device Using a PIC® MCU” (DS01003), • Based on ISO/IEC 9293 specifications available from the Microchip web site. • Known as the FAT16 file system, used on earlier ® DOS operating systems by Microsoft Corporation CARD FILE SYSTEM • Most popular file system with SD card, CF card and USB thumb drive Important: It is the user’s responsibility to obtain a Most SD cards and MMCs, particularly those sized copy of, familiarize themselves fully below 2 gigabytes (GB), use this standard. This appli- with, and comply with the requirements cation note presents a method to read and/or write to and licensing obligations applicable to these storage devices through a microcontroller. This third party tools, systems and/or speci- data can be read by a PC and data written by a PC can fications including, but not limited to, Flash-based media and FAT file sys- be read by a microcontroller.
    [Show full text]