Off-line Direct Disk Access System

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

File Management.
Operating Systems File Management.
File Management.
File Systems.
Allocation Methods - Contiguous
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
File Management Systems
Operating Systems File Systems (in a Day) Ch
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
Operating Systems File Systems (Select parts of Ch 6)
1 File Management in Representative Operating Systems.
Operating Systems File systems
Wince File systems. File system on embedded File system choice on embedded is important –File system size can be an issue –Different media are used –
Chapter 10 File System Interface
 FILE S SYSTEM  DIFFERENT FILE SYSTEMS  FILE SYSTEM COMPONENTS  FILE OPERATIONS  LOG STRUCTERD FILE SYSTEM  FILE EXAMPLES.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
File Systems and Disk Management. File system Interface between applications and the mass storage/devices Provide abstraction for the mass storage and.
1Fall 2008, Chapter 11 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials– 8 th Edition Chapter 10: File System Implementation.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Lecture 10 Page 1 CS 111 Summer 2013 File Systems Control Structures A file is a named collection of information Primary roles of file system: – To store.
THE FILE SYSTEM Files long-term storage RAM short-term storage Programs, data, and text are all stored in files, which is stored on.
Lecture 19 Linux/Unix – File System
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
File Systems - Part I CS Introduction to Operating Systems.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
W4118 Operating Systems Instructor: Junfeng Yang.
File organization Secondary Storage Devices Lec#7 Presenter: Dr Emad Nabil.
COMP 3500 Introduction to Operating Systems Directory Structures Block Management Dr. Xiao Qin Auburn University
File Systems and Disk Management
Day 28 File System.
File System Implementation
Introduction to Kernel
Chapter 2: The Linux System Part 4
Guide to Linux Installation and Administration, 2e
Chapter 11: File System Implementation
Chapter 11: Implementing File Systems
Chapter 12: File System Implementation
Day 27 File System.
File System Structure How do I organize a disk into a file system?
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
Operating Systems (CS 340 D)
Operating System I/O System Monday, August 11, 2008.
Lecture 45 Syed Mansoor Sarwar
File Management.
Subject Name: Operating Systems Subject Code:10CS53
File Structure 2018, Spring Pusan National University Joon-Seok Kim
CS510 Operating System Foundations
Chapter 11: File System Implementation
Overview Continuation from Monday (File system implementation)
File Systems and Disk Management
Overview: File system implementation (cont)
Lecture 15 Reading: Bacon 7.6, 7.7
File Systems and Disk Management
Chapter 2: Operating-System Structures
Chapter 2: The Linux System Part 5
Chapter 16 File Management
File Systems and Disk Management
Chapter 11: File System Implementation
Chapter 2: Operating-System Structures
Department of Computer Science
SE350: Operating Systems Lecture 12: File Systems.
Chapter 14: File System Implementation
The File Manager Implementation issues
Presentation transcript:

Off-line Direct Disk Access System CSE 237A Alan Del Tredici adeltred@ucsd.edu

Motivation Number of portable digital devices increasing Audio recorders Cameras Currently, data transferred to PC for Editing Storage / media transfer Network portal Requires 1. Boot PC 2. Transfer the data 3. Shut down PC

Proposed Solution Direct transfer to disk without booting PC Offline Access Module

Project Goals Demonstrate off-line disk access procedure Write data to disk Without standard file I/O calls Without corrupting existing data Retrieve data via standard file I/O Proof-of-concept stage is software only

Development Choices Chose to use Linux as native OS Widely used, source code available, and free! Use “Second Extended File System” (Ext2) Unix-style file system De facto standard for Linux Basis from which other file systems extend

Development Choices (cont.) Make use of disk partitions Make 1 large disk look like several small Provides efficiency, modularity In Linux, floppy-disk accessed just like a hard-disk partition Use floppy disk as test target No change in concept Safer for development!

Off-line Access Strategy: 1. Directly access disk to determine existing file system configuration 2. Add data, maintaining file system structure. 3. When booted, Linux will find the data

Development Approaches Write code to directly access disk Linux has strong protection – user can’t access hardware! Linux provides raw block read/write calls… Want access to device in terms of file-system components This is provided by libext2fs. Basic functions to access file system structures Still requires us to know how to use the pieces

Ext2 – Partition Components Boot sector 1 or more Groups Super block Group descriptor Block usage map I-node usage map I-node table Data blocks Redundant copies Disk is an array of “blocks” – organized by these conventions

Ext2 – Boot Sector Boot sector 1 or more Groups Boot code Super block Group descriptor Block usage map I-node usage map I-node table Data blocks Boot code May be unused Partition tables List start of partitions

Ext2 – Super Block Boot sector 1 or more Groups Basic parameters Group descriptor Block usage map I-node usage map I-node table Data blocks Basic parameters Block size (1 kB typ) Block counts Version info

Ext2 – Group Descriptor Boot sector 1 or more Groups Super block Group descriptor Block usage map I-node usage map I-node table Data blocks Map & table locations Handy counters

Ext2 – Usage Maps Boot sector 1 or more Groups Super block Group descriptor Block usage map I-node usage map I-node table Data blocks Bit-maps where each bit indicates used/unused item A 1 kB block holds 8k bits Supports 8,192 entries

Ext2 – Index nodes (i-nodes) Boot sector 1 or more Groups Super block Group descriptor Block usage map I-node usage map I-node table Data blocks Ext2 i-node = 128 bytes struct ext2_inode { U32 size U32 Block count U32 Time stamps : U32 Block pointer[0] U32 Block pointer[1] U32 Block pointer[11] U32 Indirect block pointer U32 2x-indirect block pointer U32 3x-indirect block pointer }

Ext2 – I-node Block Pointers

Ext2 – Data Blocks Boot sector 1 or more Groups Super block Group descriptor Block usage map I-node usage map I-node table Data blocks All remaining blocks in the group

Off-line Access Example Initialized Disk: I-node table: 23 blocks Root directory: Directory is a type of ‘file’ Index to other i-nodes by name Root = i-node #2 “lost+found” reserve: 12 blocks Block map I-node map Group data Super block Boot block : 2 3 1 4 5 27 28 40 41 29 1439 I-node table Root directory “lost+found” 1st free data block

Off-line Access Steps Read configuration information Super block Block size (1 kbyte) I-node count (184 on fd) Block count (1440 on fd) Group block Location of maps Location of i-node table Block map I-node map Group data Super block Boot block : 2 3 1 4 5 27 28 40 41 29 1439 I-node table Root directory “lost+found” 1st free data block

File Creation Read the i-node and block maps Find the next available i-node and data block Block map I-node map Group data Super block Boot block : 2 3 1 4 5 27 28 40 41 29 1439 I-node table Root directory “lost+found” 1st free data block

File Creation (continued) Add entry to specified directory File name File type I-node number Perform i-node “accounting” Mark bit in i-node map Block map I-node map Group data Super block Boot block : 2 3 1 4 5 27 28 40 41 29 1439 I-node table Root directory “lost+found” 1st free data block

File Creation (continued) Write data to data blocks Update i-node with block numbers Allocate indirect blocks from data block area as needed Block map I-node map Group data Super block Boot block : 2 3 1 4 5 27 28 40 41 29 1439 I-node table Root directory “lost+found” Our data!

File Creation (continued) Finish configuring the i-node Set permissions Size of data written Time stamp When Linux reads this file system, our data will appear! Block map I-node map Group data Super block Boot block : 2 3 1 4 5 27 28 40 41 29 1439 I-node table Root directory “lost+found” Our data!

Accomplishments Met the technical objectives Data stored to hard disk without file I/O calls Linux can later retrieve data Documented pertinent Ext2 operation Extracted details from source code & by testing Created working proof-of-concept application Available on web site: http://ieng9.ucsd.edu/~adeltred/offline_access.htm

Future Work Test on hard disk with large files Implement on stand-alone hardware Atmel AT89C5132: A mass storage device controlling data exchange between various Flash modules, HDD and CD-ROM.

Off-line Disk Access Questions?

Off-line Disk Access Thank you!