Mobile Operating Systems Symbian The Symbian OS  home page shows the demand paging. http:// www.symbian.com/symbianos/inde...
CMT603 Lecture 10 File Systems
Contents <ul><li>Files </li></ul><ul><ul><li>File Attributes </li></ul></ul><ul><ul><li>File Operations </li></ul></ul><ul...
Files <ul><li>A file is a named collection of related information that is recorded on secondary storage. </li></ul><ul><ul...
File attributes <ul><li>File attributes typically include </li></ul><ul><ul><li>Name -- human readable name </li></ul></ul...
File Operations <ul><li>A file is an abstract data type and is associated with operations. </li></ul><ul><ul><li>Basic ope...
Access Control <ul><li>Read Write Execute </li></ul><ul><ul><li>drwxrwxrwx </li></ul></ul><ul><li>ls -l </li></ul><ul><li>...
File System Mounting File Sys A Sub sub B Sub sub A Sub Dir B Sub Dir A File A File Sys B Sub sub B Sub Dir B Sub Dir A Fi...
File System Mounting File Sys A Sub sub B Sub sub A Sub Dir B Sub Dir A File A File Sys B Sub sub B Sub Dir B Sub Dir A Fi...
Linux <ul><li>Log into lapis (or any cslx machine) </li></ul><ul><ul><li>You are in your directory (scm????) </li></ul></u...
Mounting Local drives XP <ul><li>From “My Computer” </li></ul><ul><ul><li>Right Click > Manage </li></ul></ul><ul><ul><li>...
Access to files <ul><li>Sequential Access </li></ul><ul><li>Direct Access </li></ul>
Allocation Methods <ul><li>How to allocate space to files so that disk space is utilized effectively and file can be acces...
Contiguous Allocation <ul><li>Each file occupies a set of contiguous blocks of disk. </li></ul>1 0 2 3 4 6 5 7 8 9 11 10 1...
Contiguous Allocation <ul><li>Benefits: </li></ul><ul><ul><li>Quick and easy calculation of block holding data. </li></ul>...
Linked Allocation <ul><li>Each file is a linked list of disk blocks which may be scattered anywhere in the disk. </li></ul...
Linked Allocation <ul><li>Benefits </li></ul><ul><ul><li>solves all the problems of contiguous allocation. </li></ul></ul>...
Linked Allocation with a File Allocation Table (FAT) <ul><li>Use a file allocation table (FAT) </li></ul><ul><ul><li>The t...
Linked Allocation with a File Allocation Table (FAT) R A O U N A Y I C T 9 L T F 3 A O P L 2 1 0 2 3 4 6 5 7 8 9 11 10 12 ...
Linked Allocation with a File Allocation Table (FAT) <ul><li>Benefit </li></ul><ul><ul><li>direct access time is improved....
Indexed Allocation <ul><li>Each file has its own index block, which is an array of disk-block addresses. The ith entry in ...
Indexed Allocation <ul><li>Benefits </li></ul><ul><ul><li>Solves all the problems of contiguous allocation. </li></ul></ul...
Unix <ul><li>Directory holds file name and pointer to the inode </li></ul><ul><li>inode </li></ul><ul><ul><li>File informa...
Fat 32 <ul><li>Directory holds small attributes </li></ul><ul><ul><li>Permissions  </li></ul></ul><ul><ul><li>Date etc </l...
NTFS <ul><li>Volumes can be split over physical drives </li></ul><ul><li>Uses Clusters, size of cluster configured at form...
NTFS <ul><li>Master File Table (MFT) </li></ul><ul><li>Structured Object </li></ul><ul><ul><li>Contains attributes </li></...
Many Many Many More <ul><li>See internet  </li></ul><ul><ul><li>as a starting point </li></ul></ul><ul><ul><ul><li>http://...
Free Space Management <ul><li>Stored in a free space list </li></ul><ul><ul><li>Commonly a bit vector </li></ul></ul><ul><...
Linked List <ul><li>Keep PTR to Head </li></ul><ul><li>Traversing list not efficient  </li></ul><ul><ul><li>Not done much ...
Summary <ul><li>Files </li></ul><ul><ul><li>File Attributes </li></ul></ul><ul><ul><li>File Operations </li></ul></ul><ul>...
Course Summary <ul><li>How does it work? </li></ul><ul><ul><li>Modern OS are interrupt driven. </li></ul></ul><ul><ul><li>...
Course Summary <ul><li>Why schedule processes? </li></ul><ul><li>Preemption </li></ul><ul><li>Scheduling Algorithms </li><...
Course Summary <ul><li>Addressing and Address binding </li></ul><ul><li>Logical - Physical Addressing </li></ul><ul><li>Me...
Exam <ul><li>5 questions,:- </li></ul><ul><li>Compulsory : </li></ul><ul><li>1 mixed (MJWM, MWD, IMC) </li></ul><ul><li>Ch...
Exam <ul><li>What is …. [2] </li></ul><ul><li>State …. [1] </li></ul><ul><li>Briefly describe … . [2] </li></ul><ul><li>Ex...
Past Questions (a) CPU scheduling algorithms are designed to keep a computer system running efficiently in a multiprogramm...
Past Question <ul><li>(c) Describe the meaning of the term virtual memory? Briefly distinguish between paging and segmenta...
Upcoming SlideShare
Loading in …5
×

Mobile Operating Systems Symbian The Symbian OS home page ...

1,591 views

Published on

  • Be the first to comment

  • Be the first to like this

Mobile Operating Systems Symbian The Symbian OS home page ...

  1. 1. Mobile Operating Systems Symbian The Symbian OS home page shows the demand paging. http:// www.symbian.com/symbianos/index.html Developer pages. http://www.forum.nokia.com/info/sw.nokia.com/id/dbb8841d-832c-43a6-be13- f78119a2b4cb.html Android. Open Handset Alliance --- Android Google mobile OS based on Linux. http:// code.google.com /android/ SW stack http://code.google.com/android/what-is-android.html SDK tools http://code.google.com/android/intro/hello-android.html Hardware -- Paging Paging System for Pentium - - 4K pages and 4Mpages http://www.rcollins.org/ddj/May96/
  2. 2. CMT603 Lecture 10 File Systems
  3. 3. Contents <ul><li>Files </li></ul><ul><ul><li>File Attributes </li></ul></ul><ul><ul><li>File Operations </li></ul></ul><ul><li>Access control </li></ul><ul><li>File System Mounting </li></ul><ul><li>Allocation methods </li></ul><ul><ul><li>Contiguous </li></ul></ul><ul><ul><li>Linked </li></ul></ul><ul><ul><li>indexed </li></ul></ul><ul><li>Real file systems </li></ul><ul><ul><li>FAT </li></ul></ul><ul><ul><li>UFS </li></ul></ul><ul><ul><li>NTFS </li></ul></ul>
  4. 4. Files <ul><li>A file is a named collection of related information that is recorded on secondary storage. </li></ul><ul><ul><li>It is the smallest logical storage unit. </li></ul></ul><ul><ul><ul><li>Data to be stored has to be in a file </li></ul></ul></ul><ul><ul><li>It has a certain defined structure, which depends on its type. </li></ul></ul><ul><ul><ul><li>Text files, source files, executable files, object files, etc. </li></ul></ul></ul>
  5. 5. File attributes <ul><li>File attributes typically include </li></ul><ul><ul><li>Name -- human readable name </li></ul></ul><ul><ul><li>Identifier -- non-human-readable name </li></ul></ul><ul><ul><li>Type -- is need for those systems that supports different types of files </li></ul></ul><ul><ul><li>Location -- a pointer to the location </li></ul></ul><ul><ul><li>Size -- the current size </li></ul></ul><ul><ul><li>Protection -- access control information </li></ul></ul><ul><ul><li>Time, date, and user identification. </li></ul></ul><ul><li>They are kept in the directory structure. </li></ul>
  6. 6. File Operations <ul><li>A file is an abstract data type and is associated with operations. </li></ul><ul><ul><li>Basic operations </li></ul></ul><ul><ul><ul><li>Creating a file </li></ul></ul></ul><ul><ul><ul><li>Writing a file </li></ul></ul></ul><ul><ul><ul><li>Reading a file </li></ul></ul></ul><ul><ul><ul><li>Repositioning within a file </li></ul></ul></ul><ul><ul><ul><li>Deleting a file </li></ul></ul></ul><ul><ul><ul><li>Truncating a file </li></ul></ul></ul><ul><ul><li>Other two common operations </li></ul></ul><ul><ul><ul><li>Appending to a file </li></ul></ul></ul><ul><ul><ul><li>Renaming a file </li></ul></ul></ul>
  7. 7. Access Control <ul><li>Read Write Execute </li></ul><ul><ul><li>drwxrwxrwx </li></ul></ul><ul><li>ls -l </li></ul><ul><li>chmod [ references ][ operator ][ modes ] file </li></ul><ul><ul><li>References u-user, g-group, o-others, a-all </li></ul></ul><ul><ul><li>Operator +, -, = </li></ul></ul><ul><ul><li>Modes r,w,x </li></ul></ul><ul><li>Example </li></ul><ul><ul><li>chmod ug+rw text.txt </li></ul></ul>
  8. 8. File System Mounting File Sys A Sub sub B Sub sub A Sub Dir B Sub Dir A File A File Sys B Sub sub B Sub Dir B Sub Dir A File A Sub sub A
  9. 9. File System Mounting File Sys A Sub sub B Sub sub A Sub Dir B Sub Dir A File A File Sys B Sub sub B Sub Dir B Sub Dir A File A Sub sub A
  10. 10. Linux <ul><li>Log into lapis (or any cslx machine) </li></ul><ul><ul><li>You are in your directory (scm????) </li></ul></ul><ul><li>cd .. To the home directory and view the mounted file systems on that specific machine. </li></ul>
  11. 11. Mounting Local drives XP <ul><li>From “My Computer” </li></ul><ul><ul><li>Right Click > Manage </li></ul></ul><ul><ul><li>Click on Disk management. </li></ul></ul><ul><li>From here local drives can be mounted into the directory structure </li></ul>
  12. 12. Access to files <ul><li>Sequential Access </li></ul><ul><li>Direct Access </li></ul>
  13. 13. Allocation Methods <ul><li>How to allocate space to files so that disk space is utilized effectively and file can be accessed quickly? </li></ul><ul><li>Three major methods </li></ul><ul><ul><li>Contiguous </li></ul></ul><ul><ul><li>Linked </li></ul></ul><ul><ul><li>Indexed </li></ul></ul>
  14. 14. Contiguous Allocation <ul><li>Each file occupies a set of contiguous blocks of disk. </li></ul>1 0 2 3 4 6 5 7 8 9 11 10 12 13 14 16 15 17 18 19 Problems? 7 12 C.txt 4 3 B.txt 2 0 A.txt Length Start File
  15. 15. Contiguous Allocation <ul><li>Benefits: </li></ul><ul><ul><li>Quick and easy calculation of block holding data. </li></ul></ul><ul><ul><li>Supports both sequential and direct access. </li></ul></ul><ul><li>Disadvantages: </li></ul><ul><ul><li>Where is the best place to put a new file? </li></ul></ul><ul><ul><li>Problems when the file gets bigger. </li></ul></ul><ul><ul><li>Fragmentation problem. </li></ul></ul><ul><li>IBM VM/CMS </li></ul>
  16. 16. Linked Allocation <ul><li>Each file is a linked list of disk blocks which may be scattered anywhere in the disk. </li></ul>8 5 -1 -1 17 7 -1 ? 11 19 9 0 4 3 18 10 2 8 13 6 1 0 2 3 4 6 5 7 8 9 11 10 12 13 14 16 15 17 18 19 4 15 C.txt 8 1 B.txt 2 12 A.txt End Start File
  17. 17. Linked Allocation <ul><li>Benefits </li></ul><ul><ul><li>solves all the problems of contiguous allocation. </li></ul></ul><ul><li>Disadvantages: </li></ul><ul><ul><li>Potentially terrible performance for direct access. </li></ul></ul><ul><ul><li>Each file needs more space because each block contains a pointer to the next block. </li></ul></ul><ul><ul><li>Reliability problem </li></ul></ul><ul><ul><ul><li>what if one pointer is lost? </li></ul></ul></ul>
  18. 18. Linked Allocation with a File Allocation Table (FAT) <ul><li>Use a file allocation table (FAT) </li></ul><ul><ul><li>The table has one entry for each disk block, and is indexed by block number. </li></ul></ul><ul><ul><li>For each file: </li></ul></ul><ul><ul><ul><li>The directory entry contains the block number of the first block of the file </li></ul></ul></ul><ul><ul><ul><li>The FAT is used as a linked list. </li></ul></ul></ul>
  19. 19. Linked Allocation with a File Allocation Table (FAT) R A O U N A Y I C T 9 L T F 3 A O P L 2 1 0 2 3 4 6 5 7 8 9 11 10 12 13 14 16 15 17 18 19 Directory FAT C.txt 15 B.txt 12 A.txt Start File 7 18 10 19 13 17 -1 16 17 15 9 14 18 13 3 12 16 11 12 10 4 9 2 8 5 7 11 6 14 5 1 4 6 3 19 2 -1 1 8 0
  20. 20. Linked Allocation with a File Allocation Table (FAT) <ul><li>Benefit </li></ul><ul><ul><li>direct access time is improved. </li></ul></ul><ul><li>Disadvantage </li></ul><ul><ul><li>Results in a significant number of disk head seeks. </li></ul></ul><ul><li>What happens if the FAT is cached? </li></ul><ul><ul><li>Must save it occasionally!!!!!! </li></ul></ul>
  21. 21. Indexed Allocation <ul><li>Each file has its own index block, which is an array of disk-block addresses. The ith entry in the index block points to the ith block of the file. </li></ul>O K E L Q B I E H H T N F L W L D 1 0 2 3 4 6 5 7 8 9 11 10 12 13 14 16 15 17 18 19 13 7 17 15 0 4 12 16 1 B.txt 6 A.txt Index File
  22. 22. Indexed Allocation <ul><li>Benefits </li></ul><ul><ul><li>Solves all the problems of contiguous allocation. </li></ul></ul><ul><ul><li>Support direct access, but not as efficient as FAT. </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>Wasted space due to overhead of index block </li></ul></ul>
  23. 23. Unix <ul><li>Directory holds file name and pointer to the inode </li></ul><ul><li>inode </li></ul><ul><ul><li>File information </li></ul></ul><ul><ul><ul><li>Owner </li></ul></ul></ul><ul><ul><ul><li>Size </li></ul></ul></ul><ul><ul><ul><li>Time stamp </li></ul></ul></ul><ul><ul><ul><li>Permissions </li></ul></ul></ul><ul><ul><li>Pointers to file data blocks </li></ul></ul>
  24. 24. Fat 32 <ul><li>Directory holds small attributes </li></ul><ul><ul><li>Permissions </li></ul></ul><ul><ul><li>Date etc </li></ul></ul><ul><ul><li>Pointer to FAT index </li></ul></ul><ul><li>32 bits for the block numbers </li></ul><ul><ul><li>Up to 4 G blocks </li></ul></ul><ul><ul><li>Typically 4K blocks </li></ul></ul><ul><li>Windows XP still supports this. </li></ul>
  25. 25. NTFS <ul><li>Volumes can be split over physical drives </li></ul><ul><li>Uses Clusters, size of cluster configured at format time </li></ul><ul><ul><ul><li>Depends on size of the disk </li></ul></ul></ul><ul><li>Provides recovery mechanism </li></ul><ul><ul><li>Logs the redo and undo info, does the change, commits the change </li></ul></ul><ul><ul><li>Ensures file system is safe not user data </li></ul></ul>
  26. 26. NTFS <ul><li>Master File Table (MFT) </li></ul><ul><li>Structured Object </li></ul><ul><ul><li>Contains attributes </li></ul></ul><ul><ul><li>The file data is an attribute </li></ul></ul><ul><ul><li>Small attributes are stored in the MFT </li></ul></ul><ul><ul><ul><li>Resident attribute </li></ul></ul></ul><ul><ul><li>Large attributes stored in One or more extents </li></ul></ul><ul><ul><ul><li>A pointer to the extents is in the MFT </li></ul></ul></ul><ul><ul><ul><ul><li>If more space is required, pointer to base file record </li></ul></ul></ul></ul><ul><ul><li>Data attribute, if small enough, stored in MFT </li></ul></ul>
  27. 27. Many Many Many More <ul><li>See internet </li></ul><ul><ul><li>as a starting point </li></ul></ul><ul><ul><ul><li>http://en.wikipedia.org/wiki/Comparison_of_file_systems </li></ul></ul></ul>
  28. 28. Free Space Management <ul><li>Stored in a free space list </li></ul><ul><ul><li>Commonly a bit vector </li></ul></ul><ul><ul><li>000110111011111110111101000000010111 </li></ul></ul><ul><ul><li>Modern processors have support for returning the first 1 in a word </li></ul></ul>
  29. 29. Linked List <ul><li>Keep PTR to Head </li></ul><ul><li>Traversing list not efficient </li></ul><ul><ul><li>Not done much </li></ul></ul>A O N A I C T L T A O P 1 0 2 3 4 6 5 7 8 9 11 10 12 13 14 16 15 17 18 19
  30. 30. Summary <ul><li>Files </li></ul><ul><ul><li>File Attributes </li></ul></ul><ul><ul><li>File Operations </li></ul></ul><ul><li>Access control </li></ul><ul><li>File System Mounting </li></ul><ul><li>Allocation methods </li></ul><ul><ul><li>Contiguous </li></ul></ul><ul><ul><li>Linked </li></ul></ul><ul><ul><li>indexed </li></ul></ul><ul><li>Real file systems </li></ul><ul><ul><li>FAT </li></ul></ul><ul><ul><li>UFS </li></ul></ul><ul><ul><li>NTFS </li></ul></ul>
  31. 31. Course Summary <ul><li>How does it work? </li></ul><ul><ul><li>Modern OS are interrupt driven. </li></ul></ul><ul><ul><li>Dual Mode Operation. </li></ul></ul><ul><ul><ul><li>User mode </li></ul></ul></ul><ul><ul><ul><li>System mode </li></ul></ul></ul><ul><ul><li>Timers </li></ul></ul><ul><li>Architectures of Operating Systems </li></ul><ul><ul><li>Monolithic </li></ul></ul><ul><ul><li>Layered </li></ul></ul><ul><ul><li>Kernel </li></ul></ul><ul><ul><li>Microkernel </li></ul></ul><ul><li>Increasing Efficiency </li></ul><ul><ul><li>Multi program </li></ul></ul><ul><ul><li>Multi User </li></ul></ul><ul><li>Processes and Threads. </li></ul><ul><ul><li>Process - Program in execution. </li></ul></ul><ul><ul><li>Thread - Lightweight process </li></ul></ul><ul><li>Context Switching </li></ul><ul><li>Process Queues </li></ul><ul><li>Thread Mappings </li></ul>Ready Blocked Running Creation Termination Interrupt Scheduler Dispatch I/O or Event Wait I/O or Event completion Created Exit
  32. 32. Course Summary <ul><li>Why schedule processes? </li></ul><ul><li>Preemption </li></ul><ul><li>Scheduling Algorithms </li></ul><ul><ul><li>FCFS </li></ul></ul><ul><ul><li>SJF </li></ul></ul><ul><ul><li>Priority scheduling </li></ul></ul><ul><ul><li>Round Robin </li></ul></ul><ul><ul><ul><li>Average Wait Time </li></ul></ul></ul><ul><ul><ul><li>Turnaround time </li></ul></ul></ul><ul><li>Multi Level Queues </li></ul><ul><li>Real Systems </li></ul><ul><ul><li>Linux </li></ul></ul><ul><ul><li>XP </li></ul></ul><ul><li>Process interaction </li></ul><ul><ul><li>Problems - Process interaction </li></ul></ul><ul><li>Software solutions </li></ul><ul><ul><li>Criteria for the solutions </li></ul></ul><ul><ul><ul><li>Mutual exclusion </li></ul></ul></ul><ul><ul><ul><li>Progression </li></ul></ul></ul><ul><ul><ul><li>Bounded wait </li></ul></ul></ul><ul><li>Hardware solutions </li></ul><ul><ul><li>Locks </li></ul></ul><ul><li>OS solutions </li></ul><ul><ul><li>Semaphores </li></ul></ul><ul><ul><ul><li>Uses </li></ul></ul></ul><ul><ul><ul><li>Classical problem </li></ul></ul></ul><ul><li>What is Deadlock? </li></ul><ul><ul><li>Detecting Deadlock </li></ul></ul><ul><ul><li>Preventing Deadlock </li></ul></ul><ul><ul><li>Avoiding Deadlock </li></ul></ul>
  33. 33. Course Summary <ul><li>Addressing and Address binding </li></ul><ul><li>Logical - Physical Addressing </li></ul><ul><li>Memory Management Unit </li></ul><ul><li>Contiguous Addressing </li></ul><ul><ul><li>Fixed Partition </li></ul></ul><ul><ul><li>Variable Partition </li></ul></ul><ul><li>Non-Contiguous Addressing </li></ul><ul><ul><li>Paging </li></ul></ul><ul><ul><li>Segmentation </li></ul></ul><ul><li>Virtual Memory </li></ul><ul><ul><li>Implementation </li></ul></ul><ul><ul><li>Page Faults </li></ul></ul><ul><li>Files </li></ul><ul><ul><li>File Attributes </li></ul></ul><ul><ul><li>File Operations </li></ul></ul><ul><li>Access control </li></ul><ul><li>File System Mounting </li></ul><ul><li>Allocation methods </li></ul><ul><ul><li>Contiguous </li></ul></ul><ul><ul><li>Linked </li></ul></ul><ul><ul><li>indexed </li></ul></ul><ul><li>Real file systems </li></ul><ul><ul><li>FAT </li></ul></ul><ul><ul><li>UFS </li></ul></ul><ul><ul><li>NTFS </li></ul></ul>
  34. 34. Exam <ul><li>5 questions,:- </li></ul><ul><li>Compulsory : </li></ul><ul><li>1 mixed (MJWM, MWD, IMC) </li></ul><ul><li>Choice (2 of 4): </li></ul><ul><li>2 Computer Arch (MJWM) </li></ul><ul><li>1 Networks (MWD) </li></ul><ul><li>1 Operating Systems (IMC) </li></ul><ul><li>Maximum mark obtainable 75 </li></ul>
  35. 35. Exam <ul><li>What is …. [2] </li></ul><ul><li>State …. [1] </li></ul><ul><li>Briefly describe … . [2] </li></ul><ul><li>Explain …. [5] </li></ul><ul><li>Describe …. [6] </li></ul>
  36. 36. Past Questions (a) CPU scheduling algorithms are designed to keep a computer system running efficiently in a multiprogramming environment. Probably the best known criterion for judging the success of a particular scheduling algorithm is to measure the CPU utilization, i.e. the percentage of time that the CPU is busy (i.e. not sitting idle). Briefly describe three other criteria that could be used to measure the efficiency of CPU scheduling algorithms. [6] (b) Outline a scheduling algorithm that you think would be particularly appropriate for maximizing CPU utilization. Why do you consider it to be suitable? Describe scheduling algorithms that you believe would be suited to multiprogramming environments with efficiency measures based on each of the three other criteria from part (a). [8]
  37. 37. Past Question <ul><li>(c) Describe the meaning of the term virtual memory? Briefly distinguish between paging and segmentation, as memory management schemes for computer systems [4] </li></ul><ul><li>(d) Describe the main advantages and disadvantages of using segmentation rather than paging. [3] </li></ul><ul><li>(e) Consider a computer memory management system in which memory contains the following hole sizes in memory order: 10 KB, 4 KB, 20 KB, 18 KB, 7 KB, 9 KB, 12 KB and 15 KB. Which hole is taken for successive segment requests of: 12 KB, 10 KB, 9 KB when each of the following algorithms is used:- </li></ul><ul><li>(i) first fit, [1] </li></ul><ul><li>(ii) best fit, [1] </li></ul><ul><li>(iii) worst fit and [1] </li></ul><ul><li>(iv) next fit. [1] </li></ul>

×