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

37
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/

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

Page 1: Mobile Operating Systems Symbian The Symbian OS home page ...

Mobile Operating SystemsSymbian

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.htmlAndroid.

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 toolshttp://code.google.com/android/intro/hello-android.html

Hardware -- PagingPaging System for Pentium - - 4K pages and 4Mpages

http://www.rcollins.org/ddj/May96/

Page 2: Mobile Operating Systems Symbian The Symbian OS home page ...

CMT603

Lecture 10

File Systems

Page 3: Mobile Operating Systems Symbian The Symbian OS home page ...

Contents

• Files– File Attributes– File Operations

• Access control• File System Mounting• Allocation methods

– Contiguous– Linked– indexed

• Real file systems– FAT– UFS– NTFS

Page 4: Mobile Operating Systems Symbian The Symbian OS home page ...

Files

• A file is a named collection of related information that is recorded on secondary storage.– It is the smallest logical storage unit.

• Data to be stored has to be in a file

– It has a certain defined structure, which depends on its type.

• Text files, source files, executable files, object files, etc.

Page 5: Mobile Operating Systems Symbian The Symbian OS home page ...

File attributes

• File attributes typically include– Name -- human readable name– Identifier -- non-human-readable name– Type -- is need for those systems that supports

different types of files– Location -- a pointer to the location– Size -- the current size– Protection -- access control information– Time, date, and user identification.

• They are kept in the directory structure.

Page 6: Mobile Operating Systems Symbian The Symbian OS home page ...

File Operations

• A file is an abstract data type and is associated with operations.– Basic operations

• Creating a file• Writing a file• Reading a file• Repositioning within a file• Deleting a file• Truncating a file

– Other two common operations• Appending to a file• Renaming a file

Page 7: Mobile Operating Systems Symbian The Symbian OS home page ...

Access Control

• Read Write Execute– drwxrwxrwx

• ls -l• chmod [references][operator][modes] file

– References u-user, g-group, o-others, a-all– Operator +, -, =– Modes r,w,x

• Example– chmod ug+rw text.txt

Page 8: Mobile Operating Systems Symbian The Symbian OS home page ...

File System Mounting

File Sys A

Sub sub BSub sub A

Sub Dir BSub Dir A

File A

File Sys B

Sub sub B

Sub Dir BSub Dir A

File ASub sub A

Page 9: Mobile Operating Systems Symbian The Symbian OS home page ...

File System Mounting

File Sys A

Sub sub BSub sub A

Sub Dir BSub Dir A

File A File Sys B

Sub sub B

Sub Dir BSub Dir A

File ASub sub A

Page 10: Mobile Operating Systems Symbian The Symbian OS home page ...

Linux

• Log into lapis (or any cslx machine)– You are in your directory (scm????)

• cd .. To the home directory and view the mounted file systems on that specific machine.

Page 11: Mobile Operating Systems Symbian The Symbian OS home page ...

Mounting Local drives XP

• From “My Computer”– Right Click > Manage– Click on Disk management.

• From here local drives can be mounted into the directory structure

Page 12: Mobile Operating Systems Symbian The Symbian OS home page ...

Access to files

• Sequential Access

• Direct Access

Page 13: Mobile Operating Systems Symbian The Symbian OS home page ...

Allocation Methods

• How to allocate space to files so that disk space is utilized effectively and file can be accessed quickly?

• Three major methods– Contiguous– Linked– Indexed

Page 14: Mobile Operating Systems Symbian The Symbian OS home page ...

Contiguous Allocation

• Each file occupies a set of contiguous blocks of disk.

File Start Length

A.txt 0 2

B.txt 3 4

C.txt 12 7

10 2 3 4

65 7 8 9

1110 12 13 14

1615 17 18 19

Problems?

Page 15: Mobile Operating Systems Symbian The Symbian OS home page ...

Contiguous Allocation

• Benefits:– Quick and easy calculation of block holding

data.– Supports both sequential and direct access.

• Disadvantages:– Where is the best place to put a new file?– Problems when the file gets bigger.– Fragmentation problem.

• IBM VM/CMS

Page 16: Mobile Operating Systems Symbian The Symbian OS home page ...

Linked Allocation

• Each file is a linked list of disk blocks which may be scattered anywhere in the disk.

8 5 -1-117

7 -1 ?1119

9 0 4318

10 2 8136

File Start End

A.txt 12 2

B.txt 1 8

C.txt 15 4

10 2 3 4

65 7 8 9

1110 12 13 14

1615 17 18 19

Page 17: Mobile Operating Systems Symbian The Symbian OS home page ...

Linked Allocation

• Benefits– solves all the problems of contiguous

allocation.

• Disadvantages:– Potentially terrible performance for direct

access.– Each file needs more space because each

block contains a pointer to the next block.– Reliability problem

• what if one pointer is lost?

Page 18: Mobile Operating Systems Symbian The Symbian OS home page ...

Linked Allocation with a File Allocation Table (FAT)

• Use a file allocation table (FAT)– The table has one entry for each disk block,

and is indexed by block number.– For each file:

• The directory entry contains the block number of the first block of the file

• The FAT is used as a linked list.

Page 19: Mobile Operating Systems Symbian The Symbian OS home page ...

Linked Allocation with a File Allocation Table (FAT)

File Start

A.txt 12

B.txt 15

C.txt

R A OUN

A Y ICT

9 L TF3

A O PL2

10 2 3 4

65 7 8 9

1110 12 13 14

1615 17 18 19

0 8

1 -1

2 19

3 6

4 1

5 14

6 11

7 5

8 2

9 4

10 12

11 16

12 3

13 18

14 9

15 17

16 -1

17 13

18 7

19 10

Directory

FAT

Page 20: Mobile Operating Systems Symbian The Symbian OS home page ...

Linked Allocation with a File Allocation Table (FAT)

• Benefit– direct access time is improved.

• Disadvantage– Results in a significant number of disk head

seeks.

• What happens if the FAT is cached?– Must save it occasionally!!!!!!

Page 21: Mobile Operating Systems Symbian The Symbian OS home page ...

Indexed Allocation

• 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.

O K EL

Q B IE

H H TNF

L WLD

10 2 3 4

65 7 8 9

1110 12 13 14

1615 17 18 19

File Index

A.txt 6

B.txt 1

137

17150

41216

Page 22: Mobile Operating Systems Symbian The Symbian OS home page ...

Indexed Allocation

• Benefits– Solves all the problems of contiguous

allocation.– Support direct access, but not as efficient as

FAT.

• Disadvantages– Wasted space due to overhead of index block

Page 23: Mobile Operating Systems Symbian The Symbian OS home page ...

Unix

• Directory holds file name and pointer to the inode

• inode– File information

• Owner• Size• Time stamp• Permissions

– Pointers to file data blocks

Page 24: Mobile Operating Systems Symbian The Symbian OS home page ...

Fat 32

• Directory holds small attributes– Permissions – Date etc– Pointer to FAT index

• 32 bits for the block numbers– Up to 4 G blocks– Typically 4K blocks

• Windows XP still supports this.

Page 25: Mobile Operating Systems Symbian The Symbian OS home page ...

NTFS

• Volumes can be split over physical drives

• Uses Clusters, size of cluster configured at format time

• Depends on size of the disk

• Provides recovery mechanism – Logs the redo and undo info, does the

change, commits the change– Ensures file system is safe not user data

Page 26: Mobile Operating Systems Symbian The Symbian OS home page ...

NTFS• Master File Table (MFT)• Structured Object

– Contains attributes– The file data is an attribute– Small attributes are stored in the MFT

• Resident attribute

– Large attributes stored in One or more extents • A pointer to the extents is in the MFT

– If more space is required, pointer to base file record

– Data attribute, if small enough, stored in MFT

Page 27: Mobile Operating Systems Symbian The Symbian OS home page ...

Many Many Many More

• See internet – as a starting point

• http://en.wikipedia.org/wiki/Comparison_of_file_systems

Page 28: Mobile Operating Systems Symbian The Symbian OS home page ...

Free Space Management

• Stored in a free space list– Commonly a bit vector

000110111011111110111101000000010111

– Modern processors have support for returning the first 1 in a word

Page 29: Mobile Operating Systems Symbian The Symbian OS home page ...

Linked List

• Keep PTR to Head

• Traversing list not efficient – Not done much

A ON

A ICT

L T

A O P

10 2 3 4

65 7 8 9

1110 12 13 14

1615 17 18 19

Page 30: Mobile Operating Systems Symbian The Symbian OS home page ...

Summary• Files

– File Attributes– File Operations

• Access control• File System Mounting• Allocation methods

– Contiguous– Linked– indexed

• Real file systems– FAT– UFS– NTFS

Page 31: Mobile Operating Systems Symbian The Symbian OS home page ...

Course Summary• How does it work?

– Modern OS are interrupt driven.

– Dual Mode Operation.• User mode• System mode

– Timers• Architectures of Operating

Systems– Monolithic– Layered– Kernel– Microkernel

• Increasing Efficiency– Multi program– Multi User

• Processes and Threads.– Process - Program in

execution.– Thread - Lightweight process

• Context Switching• Process Queues• Thread Mappings

Ready

Blocked

Running

Creation Termination

Interrupt

Scheduler Dispatch

I/O or EventWait

I/O or Event completion

Created Exit

Page 32: Mobile Operating Systems Symbian The Symbian OS home page ...

Course Summary• Why schedule processes?• Preemption• Scheduling Algorithms

– FCFS– SJF– Priority scheduling– Round Robin

• Average Wait Time• Turnaround time

• Multi Level Queues• Real Systems

– Linux– XP

• Process interaction– Problems - Process interaction

• Software solutions– Criteria for the solutions

• Mutual exclusion• Progression• Bounded wait

• Hardware solutions– Locks

• OS solutions– Semaphores

• Uses• Classical problem

• What is Deadlock?– Detecting Deadlock– Preventing Deadlock– Avoiding Deadlock

Page 33: Mobile Operating Systems Symbian The Symbian OS home page ...

Course Summary

• Addressing and Address binding

• Logical - Physical Addressing• Memory Management Unit• Contiguous Addressing

– Fixed Partition– Variable Partition

• Non-Contiguous Addressing– Paging– Segmentation

• Virtual Memory– Implementation– Page Faults

• Files– File Attributes– File Operations

• Access control• File System Mounting• Allocation methods

– Contiguous– Linked– indexed

• Real file systems– FAT– UFS– NTFS

Page 34: Mobile Operating Systems Symbian The Symbian OS home page ...

Exam

• 5 questions,:-

• Compulsory :• 1 mixed (MJWM, MWD, IMC)

• Choice (2 of 4):• 2 Computer Arch (MJWM)• 1 Networks (MWD)• 1 Operating Systems (IMC)

• Maximum mark obtainable 75

Page 35: Mobile Operating Systems Symbian The Symbian OS home page ...

Exam

• What is …. [2]

• State …. [1]

• Briefly describe … . [2]

• Explain …. [5]

• Describe …. [6]

Page 36: Mobile Operating Systems Symbian The Symbian OS home page ...

(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]

Past Questions

Page 37: Mobile Operating Systems Symbian The Symbian OS home page ...

Past Question• (c) Describe the meaning of the term virtual memory? Briefly distinguish

between paging and segmentation, as memory management schemes for computer systems [4]

• (d) Describe the main advantages and disadvantages of using segmentation rather than paging. [3]

• (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:-

• (i) first fit, [1]• (ii) best fit, [1]• (iii) worst fit and [1]• (iv) next fit. [1]