project 4. file system - androbenchcsl.skku.edu/uploads/eee3052f17/project4.pdf · 2017. 12. 4. ·...

13
EEE3052 Introduction to Operating Systems prof. Jinkyu Jeong Project 4. File system 2017.12.4 (Mon.) TAs 안민우([email protected] ) / 송재현( [email protected] )

Upload: others

Post on 23-Jan-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

EEE3052 Introduction to Operating Systemsprof. Jinkyu Jeong

Project 4. File system2017.12.4 (Mon.)

TAs

안민우([email protected]) /

송재현([email protected])

Page 2: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Project plan

▪Total 4 projects1) Process management

- System call- Scheduling

2) Virtual memory- Stack growth - COW(Copy-on-write)

3) Synchronization- Thread implementation- Mutex & Condition variables

4) File system- Multi-level indirection (Due: 12/4 ~ TBD)

Page 3: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Computer system organization

CPU

Memory controller

Disk controller …Other devices

Memory

Core Project 4Storage

Page 4: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Introduction

I want to save“A, B, C, …”

A is saved in 20,B is saved in 26,

C is saved in 42….

B A C

Base 20 26 42

User have to manage entire saved data. Not Kernel!Therefore, user need to have “user’s” mapping table.

Group some data together will be efficient!(e.g. read)FILE!!

Page 5: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Introduction (cont.)

I want to save file“A, B, C, …”

File A is saved in 20,File B is saved in 26,File C is saved in 42

File B File A File C

Base 20 26 42

Even concept of file is applied, “user” have to manage mapping tables of saved files.

# of files increased, it is better to manage filesin kernel.

FILESYSTEM

Page 6: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Big picture: xv6 filesystem

ofile[NOFILE]

struct proc

fd

ip

struct file

struct inode

1

2

3

N

Data blocks

.

.

.Metadata

(ref, valid, …)

addrs(Points to

data block)

Metadata

addrs(Points to

data block)

struct dinodeOn-disk inode

Page 7: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

xv6 filesystem: superblock

bootsuper block

log inodes free bitmap data blocks

Disk Layout of xv6 filesystem

These values are decided at “mkfs”

Page 8: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

xv6 filesystem: indirection

One single indirect block

Metadata

Data segment(Pointer to blocks)

Page 9: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Project 4. Multi-level indirectionaddrs[0]

addrs[1]

addrs[2]

.

.

.

addrs[10]

addrs[11]

addrs[12]

addrs[13]

addrs[14]

Direct

Indirect

2-level indirect

3-level indirect

Page 10: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Submission

• Compress your code as YourStudentID-4.tar.gz

• Send your file to “[email protected]

• PLEASE DO NOT COPY• YOU WILL GET -100 POINTS OF YOUR PROJECT IF YOU

COPIED

• Due date: 12/(Sun.), 23:59:59 PM

Page 11: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Grade policy

• No oral test!

• You have to submit REPORT(.docx or .hwp) withyour code• Your report should include all modification you made

• Not too short, not too long

Page 12: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Tips

• Follow the path of file related system calls• e.g. open, read, write, close …

• Reading xv6-book will helps you a lot• http://csl.skku.edu/uploads/EEE3052F17/book-

rev10.pdf

• Chapter 6. File system (p.71 ~ p.86)

Page 13: Project 4. File system - AndroBenchcsl.skku.edu/uploads/EEE3052F17/Project4.pdf · 2017. 12. 4. · Project plan Total 4 projects 1) Process management - System call - Scheduling

Questions

• If you have “any” questions, please email to TA

• You can also visit Semiconductor Building #400509• Please email TA before visiting