Housekeeping (Lecture 12-6/26/2018)

Size: px
Start display at page:

Download "Housekeeping (Lecture 12-6/26/2018)"

Transcription

1 Operating Systems - CSCI 42 Housekeeping (Lecture 12-6/26/218) Cheating on roll sheet signing constitutes academic dishonesty and will result in an F in the class Kernel 1 is due at 11:45pm this Tuesday, 6/26/218 if you have code from current or a previous semester, do not look at/copy/share any code from it it s best if you just get rid of it Grading guidelines is the ONLY way we will grade read it carefully and send me questions if you are not sure don t run kshell in a separate process tests in sections (C) and (D) of the grading guidelines must run in the "foreground" and show correct printout if you are confused about "SELF-checks", send me After submission, make sure you Verify Your Kernel Submission Do GDB Assignment #2 you need to be familiar with how to debug the kernel 1

2 Midterm exam is Thursday, next week, on 7/5/218 (DEN section) 9:3am - 1:5am in SGM 124 (PM section) 12:45pm - 2:5pm in KAP 144 midterm is worth a lot, so you should study Kernel 2 implementation timeline read and step into the code in ramfs to understand polymorphism before next Wednesday, implement basic functionalities read comment blocks above functions, read Linux man pages keep in mind that weenix and Linux are not the same thing keep in mind that what s in comment blocks may not be our requirements our requirements are the spec and the grading guidelines after next Wednesday, fix your code to pass all tests in "vfstest.c" (and then "faber_fs_test.c") make sure you don t have any reference counting bugs Operating Systems - CSCI 42 Housekeeping (Lecture 12-6/26/218) 2

3 Look Up Inode Number Of A Path Operating Systems - CSCI 42 Ex: how do figure out the inode number of "/home/bc/foo.c"? this process is called pathname resolution / /home home 18 bc? /home/bc foo.c? 3

4 Operating Systems - CSCI 42 Why link() cannot be used on a directory? to avoid cycles Unix directory hierarchy can be viewed as a directed acyclic graph (DAG) straight-forward algorithm to traverse directory hierarchy efficiently Directory Hierarchy Unix and many other OSes allow limited deviation from trees hard links reference to a file (not a directory) in one directory that also appears in another using the link() system call or the "ln" shell command soft links or symbolic links a special kind of file containing the name of another file or directory using the symlink() system call or the "ln -s" shell command 4

5 % ln /unix /etc/image create "image" in "/etc" to link to "/unix" unix etc home proc dev motd bc Hard Links... unix etc home proc dev Operating Systems - CSCI unix... directory inode lecture1 lecture motd 33 file inode 5

6 % ln /unix /etc/image create "image" in "/etc" to link to "/unix" unix etc home proc dev image motd bc Hard Links... unix etc home proc dev Operating Systems - CSCI unix... directory inode file inode lecture1 lecture motd 33 image 117 6

7 Soft Links % ln -s /unix /home/bc/mylink create "mylink" in "/home/bc" to soft-link to "/unix" Operating Systems - CSCI 42 unix etc home proc dev image motd bc unix... directory inode lecture1 lecture2 file inode 7

8 Soft Links % ln -s /unix /home/bc/mylink create "mylink" in "/home/bc" to soft-link to "/unix" Operating Systems - CSCI 42 unix etc home proc dev image motd bc unix... mylink directory inode lecture1 lecture2 "/unix" file inode 8

9 Soft Links Operating Systems - CSCI 42 % ln -s /unix /home/bc/mylink % ln -s /home/bc /etc/bc create "bc" in "/etc" to soft-link to "/home/bc" unix etc home proc dev image motd bc unix... mylink directory inode lecture1 lecture2 "/unix" file inode 9

10 Soft Links Operating Systems - CSCI 42 % ln -s /unix /home/bc/mylink % ln -s /home/bc /etc/bc create "bc" in "/etc" to soft-link to "/home/bc" unix etc home proc dev image motd bc bc "/home/bc" unix... mylink directory inode lecture1 lecture2 "/unix" file inode 1

11 Soft Links Operating Systems - CSCI 42 % ls -l /etc/bc/unix/lecture1 same as "ls -l /home/bc/unix/lecture1", or is it? yes for the "root" account, may be no for the "bc" account see "access protection" later unix etc home proc dev image motd bc bc "/home/bc" unix... mylink directory inode lecture1 lecture2 "/unix" file inode 11

12 Working Directory Operating Systems - CSCI 42 When you ssh to nunki.usc.edu and you type "ls" how does the login shell know what directory content to list? Working Directory: maintained in kernel for each process paths not starting from "/" start with the working directory get by using the getcwd() system call set by using the chdir() system call displayed (via shell) using "pwd" 12

13 Kernel 2 Operating Systems - CSCI 42 Now you have everything you need to complete kernel 2 if you are not familiar with a function, look at Linux man page keep in mind that weenix is not Linux your goal is to pass all the tests in the grading guidelines New things in kernel 2 reference counting (not as easy as it sounds) if you have a reference counting bug, will get a kernel panic C++ polymorphism implemented in C the VFS layer is AFS-independent Can the VFS layer read data from disk? no way it needs to ask AFS to do it because only AFS knows what data structure is used on disk need to invoke AFS in a FS-independent way read the ramfs code read kernel 2 FAQ 13

14 Access Protection Operating Systems - CSCI 42 OS needs to make sure that only authorized processes are allowed access to system resources various ways to provide this Unix (and many other systems, such as Windows) associates with files some indication of which security principals are allowed access along with what sort of access is allowed A security principal is normally a user or a group of users a file typically contains two pieces of information which user owns the file (uid) which group owns the file (gid) each running process can have several security principals associated with it for Sixth-Edition Unix, one user ID and one group ID a process in some other OSes can have more than one group IDs 14

15 Access Protection Operating Systems - CSCI 42 Each file has associated with it a set of access permissions there are 3 classes of security principals: user: owner of the file group: group owner of the file others: everyone else for each of the 3 classes of principals, specify what sorts of operations on the file are allowed the operations are grouped into 3 classes: read: can read a file or directory write: can write a file or directory execute: one must have execute permission for a directory in order to follow a path through it Rules for checking permissions 1) determines the smallest class of principals the requester belongs to (user being smallest and others being largest) 2) then it checks for appropriate permissions with that class 15

16 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 1) Q: May andy list the contents of directory A? 16

17 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 1) Q: May andy list the contents of directory A? A: No 17

18 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 2) Q: May andy read A/x? 18

19 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 2) Q: May andy read A/x? A: Yes 19

20 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 3) Q: May trina list the contents of directory B? 2

21 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 3) Q: May trina list the contents of directory B? A: Yes 21

22 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 4) Q: May trina modify B/y? 22

23 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 4) Q: May trina modify B/y? A: No 23

24 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 5) Q: May bill modify B/x? 24

25 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 5) Q: May bill modify B/x? A: No 25

26 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 6) Q: May bill read B/y? 26

27 Permissions Example Operating Systems - CSCI 42 % ls -lr.: total 2 drwxr-x--x 2 bill adm 124 Dec 17 13:34 A drwxr bill adm 124 Dec 17 13:34 B./A: total 1 -rw-rw-rw- 1 bill adm./b: total 2 -r--rw-rw- 1 bill adm -rw----rw- 1 trina adm 593 Dec 17 13:34 x 446 Dec 17 13:34 x 446 Dec 17 13:45 y Suppose that bill and trina are members of the adm group and andy is not 6) Q: May bill read B/y? A: No 27

28 Open Operating Systems - CSCI 42 #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int open(const char *path, int options [, mode_t mode]) options O_RDONLY open for reading only O_WRONLY open for writing only O_RDWR open for reading and writing O_APPEND set the file offset to end of file prior to each write O_CREAT if the file does not exist, then create it, setting its mode to mode adjusted by umask O_EXCL: if O_EXCL and O_CREAT are set, then open fails if the file exists O_TRUNC delete any previous contents of the file O_NONBLOCK don t wait if I/O cannot be done immediately some options are not compatible with other options 28

29 Setting File Permissions #include <sys/types.h> #include <sys/stat.h> int chmod(const char *path, mode_t mode) Operating Systems - CSCI 42 sets the file permissions of the given file to those specified in mode only the owner of a file and the superuser may change its permissions nine combinable possibilities for mode (read/write/execute for user, group, and others) S_IRUSR (4), S_IWUSR (2), S_IXUSR (1) S_IRGRP (4), S_IWGRP (2), S_IXGRP (1) S_IROTH (4), S_IWOTH (2), S_IXOTH (1) note: numeric prefix of means the number is in octal format 29

30 Creating a File The mode parameter helps specify the permissions of the newly created file permissions = mode & ~umask Operating Systems - CSCI 42 Use either open or creat open(const char *pathname, int flags, mode_t mode) flags must include O_CREAT creat(const char *pathname, mode_t mode) open is preferred 3

31 Umask Standard programs create files with "maximum needed permissions" as mode compilers: 777 editors: 666 Operating Systems - CSCI 42 Per-process parameter, umask, used to turn off undesired permission bits e.g., turn off all permissions for others, write permission for group: set umask to 27 compilers: permissions = 777 & ~(27) = 75 editors: permissions = 666 & ~(27) = 64 set with umask() system call or (usually) umask shell command 31

32 Midterm Exam Coverage Operating Systems - CSCI 42 Midterm exam covers everything from the beginning of the semester to this slide Ch 1 through Ch 4 only final exam coverage will not overlap midterm coverage since the topics covered by the final exam is not independent of the midterm coverage, we say the final exam "focuses" on Ch 5 plus everything beyond this slide 32

33 Operating Systems - CSCI Beyond A Simple OS Extensions New Functionality 33

34 Operating Systems - CSCI 42 CS42 Exams Bill Cheng 34

35 Purpose Of Exams Operating Systems - CSCI 42 Some people think that an exam is a learning experience not really it s more like SAT, GRE, and TOFEL tests it s an assessment because I need to give you a fair grade you are being tested for materials you have learned in this class it s not about testing your general OS knowledge you are tested on knowledge + "critical thinking" 35

36 Calculation-type questions Question Types Operating Systems - CSCI 42 Short answers give the best answer for a question if the question says, "In N words or less,...", it s just a hint to tell you approximately how many words we expect you can write more words exception: when it s a fill-in-the-blank question (N would be small) then you must not use more than N words you get credit for including the right answer you get deduction for saying something wrong must not answer a general (high-level) question by giving an example must not answer a specific question by giving a general (high-level) answer 36

37 Question Types Operating Systems - CSCI 42 Multiple-choice unless explicitly stated, every multiple-choice question has one or more correct answers even if the question asks, "which statements are correct", it can have one or more correct answers please ignore minor grammatical and spelling mistakes if you select all the correct choices, you get 2 points if only one correct answer, it s worth 2 points if two correct answers, each is worth 1 point if three correct answers, first one is worth 1 point, the rest worth.5 point each if four correct answers, each is worth.5 point for every wrong answer you have selected, you lose 1 point best not to guess! please note that if a statement is inconsistent or incorrect, it should be considered to be a "false" statement Total points for a problem cannot go negative 37

38 Question Types Operating Systems - CSCI 42 Correct/best answers to most questions in the exam are the ones on lecture slides please understand that exams are about materials in this class it doesn t matter what you have read anywhere else if you disagree with what s on a lecture slide or my posts to the class Google Group, you need to complain to me now to set things straight once the exam starts, it s too late to say that you don t like the answers on the lecture slides or my posts I reserve the right to ask about things that I think you should know and not on lecture slides Therefore, you should focus on studying lecture slides although it should be clear that for multiple-choice questions, the "wrong answers" are not on lecture slides so you need to figure out why some answers are wrong you need to understand lecture slides 38

39 Midterm Exam Logistics Thu 7/5/218, 8 minutes DEN lecture will start at 11am (no roll sheets) Operating Systems - CSCI 42 Closed book, closed notes, and closed everything No calculators, cell phones, or any electronic gadgets are allowed bring a photo ID - will be collected at the beginning of the exam and will be returned to you when you turn in your exam There will be assigned seating you must sit in your assigned seat Covers Ch 1 through Ch 4 that have been covered in lectures so far Ch 5 is not part of midterm coverage also warmup1, warmup2, kernel1 (specs, FAQs, my post to class Google Group) will not ask you to write code, but can ask you about code in specs and FAQs 39

40 General Rules Read problem descriptions very carefully you may not receive any credit if you answer the wrong question if a question has multiple parts, make sure you answer every part and clearly label which answer is for which part We will give partial credit if applicable no guarantee that you will get partial credit Operating Systems - CSCI 42 Do not just draw pictures to answer questions (unless the question asked you to draw pictures) pictures will not be considered for grading unless they are clearly explained with words Weenix questions if a question does not mention weenix explicitly, you must not give a weenix-specific answer 4

41 General Rules Operating Systems - CSCI 42 During the exam, please only ask questions to clarify problems please do not ask for hints or ask if "it s okay to answer this way" if you ask a non-clarification type question, we are not responsible for the answer that you think we gave during regrade, you cannot say, "But the TA told me that it s okay to answer it this way" I will not answer questions regarding multiple choice questions because it gives answers away read the question carefully and choose carefully need to select all the right answers and not select any of the wrong answers 41

42 Rules About Regrades Operating Systems - CSCI 42 In order to be fair to all, we must stick to the 15-minute timeslot if you have been assigned a timeslot from X to Y, your appointment must be done at Y be on time and spend your time wisely again, this is not a "learning experience" We can only grade based on what you wrote it cannot be based on "what you meant" please do not argue about what you meant and focus on "what you wrote" Please keep the following in mind regarding regrades: regrades is about whether the TA has made a mistake or not it s not about arguing for points there is no point arguing, because: everyone who answered the same way got the same score you cannot argue about anything that s not written on your exam paper 42

43 Operating Systems - CSCI 42 Ch 6: File Systems Bill Cheng 43

44 Files Operating Systems - CSCI 42 Memory Disk Disk 44

45 Requirements Permanent storage resides on disk (or alternatives) survives software and hardware crashes (including loss of disk?) Operating Systems - CSCI 42 Quick, easy, and efficient satisfies needs of most applications how do applications use permanent storage? 45

46 Software development text editors linkers and loaders source-code control Applications Operating Systems - CSCI 42 Document processing editing browsing Web stuff serving browsing Program execution paging 46

47 Directories convenient naming fast lookup Needs Operating Systems - CSCI 42 sequential is very common! File access "random access" is relatively rare 47

48 Operating Systems - CSCI The Basics of File Systems UNIX s S5FS Disk Architecture Problems with S5FS Improving Performance 48

49 S5FS A simple file system slow not terribly tolerant to crashes reasonably efficient in space no compression Operating Systems - CSCI 42 Concerns on-disk data structures file representation recall that AFS translates an inode number to disk address free space 49

50 S5FS Layout Operating Systems - CSCI 42 Boot block Superblock I-list Data Region A disk is simply an array of blocks of 1KB each (old Unix: 512B) a disk block is a logical unit (usually multiple of page size) A "linear view" (1-D array of blocks) of the disk I-list Data Region 5

51 Operating Systems - CSCI 42 S5FS Layout Boot block Superblock I-list where are the "free space"? inodes can be free or not data block can be free or not Data Region The superblock describes the layout of the rest of the file system contains the head of the free list The i-list is an array of index nodes (inodes) each representing a file 51

52 S5FS: Inode Operating Systems - CSCI 42 Device Inode Number File Type Mode (Protection) Link Count Owner, Group Size missing from textbook (but in weenix) Disk Map 52

53 Disk Map Operating Systems - CSCI 42 assuming blocksize = 1KB Disk Map contains 13 disk block pointers a disk block points is just a block number 53

54 Disk Map Operating Systems - CSCI 42 assuming blocksize = 1KB up to 1KB Disk Map contains 13 disk block pointers a disk block points is just a block number Some blocks in the data region contains data 54

55 max entries Disk Map Operating Systems - CSCI 42 assuming blocksize = 1KB up to 1KB+256KB Disk Map contains 13 disk block pointers a disk block points is just a block number Some blocks in the data region contains data some blocks in the data region contains data structures 55

56 max entries Disk Map 256 max entries Operating Systems - CSCI 42 assuming blocksize = 1KB up to 1KB+256KB+64MB 256 max entries 256 max entries 56

57 max entries Disk Map 256 max entries Operating Systems - CSCI 42 assuming blocksize = 1KB up to 1KB+256KB+64MB+16GB limit set at 2GB 256 max entries 256 max entries 256 max entries 256 max entries 256 max entries 256 max entries 57

58 Disk Map Operating Systems - CSCI File "Metadata" 256 max entries 256 max entries Content of File (i.e., File "Data") 256 max entries 256 max entries 256 max entries 256 max entries 256 max entries 256 max entries 58

59 Operating Systems - CSCI File "Metadata" 256 max entries 256 max entries Disk Map Content of File (i.e., File "Data") 256 max entries 256 max entries 256 max entries for a directory inode, the lookup table is the "content of file" 256 max entries 256 max entries 256 max entries 59

60 S5FS Free List Operating Systems - CSCI 42 free list Free Disk Block Super Block The superblock contains the addresses of up to 1 free disk blocks the last of these disk blocks contains 1 pointers to additional free disk blocks, etc. can find all the free disk blocks this way

61 S5FS Free List Operating Systems - CSCI 42 free list Free Disk Block Super Block Need a free block return first available block in first node of the free list (in superblock)

62 S5FS Free List Operating Systems - CSCI 42 return this block free list Free Disk Block Super Block Need a free block return first available block in first node of the free list (in superblock)

63 S5FS Free List Operating Systems - CSCI 42 free list NULL NULL NULL NULL 99 Free Disk Block Super Block Need a free block return first available block in first node of the free list (in superblock) if no free block in first node first copy 1 pointers into the superblock with one disk access

64 Free Me S5FS Free List Operating Systems - CSCI 42 free list NULL Free Disk Block Super Block When a disk block is freed that block s address is added to the list of free blocks in the superblock if the list is full write it out and update superblock

65 Free Disk Block S5FS Free List Operating Systems - CSCI 42 free list Free Disk Block Super Block When a disk block is freed that block s address is added to the list of free blocks in the superblock

66 Free Me S5FS Free List Operating Systems - CSCI 42 free list Free Disk Block Super Block When a disk block is freed that block s address is added to the list of free blocks in the superblock if the list is full write it out and update superblock

67 S5FS Free Inode List Operating Systems - CSCI 42 inode cache Super Block Inodes (in the i-list) are marked free or not free I-list use a "bitmap" to store this no additional organization in the i-list the superblock caches free inodes (i.e., in the inode cache)

68 S5FS Free Inode List Operating Systems - CSCI 42 inode cache Super Block The inode cache to allocate an inode, simply I-list mark it not free and remove it from the inode cache to free an inode, simply mark it free and add to the inode cache if there is room

69 S5FS Free Inode List Operating Systems - CSCI 42 inode cache Super Block The inode cache to allocate an inode, simply I-list mark it not free and remove it from the inode cache to free an inode, simply mark it free and add to the inode cache if there is room

70 S5FS Free Inode List Operating Systems - CSCI 42 inode cache Super Block If the inode cache is empty scan the i-list to refill it I-list to help out with the scan, the inode cache contains the index of the first free inode in the i-list need to maintain this entry when necessary 7

71 S5FS Free Inode List Operating Systems - CSCI 42 inode cache Super Block To create a file get a free block update free list get a free inode update i-list and inode cache I-list 71

72 S5FS Free Inode List Operating Systems - CSCI 42 inode cache Super Block To delete a file add disk block(s) to free list I-list mark inode free in i-list and may be update inode cache

73 S5FS Summary Operating Systems - CSCI 42 In designing a file system, one tries to minimize the number of disk operations read vs. write sequential access vs. random access S5FS gives O(1) number of disk operations for random access 73

CS 33. Files Part 2. CS33 Intro to Computer Systems XXI 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

CS 33. Files Part 2. CS33 Intro to Computer Systems XXI 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. CS 33 Files Part 2 CS33 Intro to Computer Systems XXI 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. Directories unix etc home pro dev passwd motd twd unix... slide1 slide2 CS33 Intro to Computer

More information

CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19

CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19 CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19 User and Group IDs Ref: Chapter 3 of [HGS]. Each user is given an ID (integer) called uid. (Most system programs use uid instead of the

More information

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CSC209H Lecture 1. Dan Zingaro. January 7, 2015 CSC209H Lecture 1 Dan Zingaro January 7, 2015 Welcome! Welcome to CSC209 Comments or questions during class? Let me know! Topics: shell and Unix, pipes and filters, C programming, processes, system calls,

More information

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O CS162 Operating Systems and Systems Programming Lecture 18 Systems October 30 th, 2017 Prof. Anthony D. Joseph http://cs162.eecs.berkeley.edu Recall: How do we Hide I/O Latency? Blocking Interface: Wait

More information

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand File Systems Basics Nima Honarmand File and inode File: user-level abstraction of storage (and other) devices Sequence of bytes inode: internal OS data structure representing a file inode stands for index

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18 I/O & Storage Layers CS162 Operating Systems and Systems Programming Lecture 18 Systems April 2 nd, 2018 Profs. Anthony D. Joseph & Jonathan Ragan-Kelley http://cs162.eecs.berkeley.edu Application / Service

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

File Systems Part 1. Operating Systems In Depth XIV 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

File Systems Part 1. Operating Systems In Depth XIV 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. File Systems Part 1 Operating Systems In Depth XIV 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. Files Memory Disk Disk Operating Systems In Depth XIV 2 Copyright 2018 Thomas W. Doeppner. All

More information

Lecture files in /home/hwang/cs375/lecture05 on csserver.

Lecture files in /home/hwang/cs375/lecture05 on csserver. Lecture 5 Lecture files in /home/hwang/cs375/lecture05 on csserver. cp -r /home/hwang/cs375/lecture05. scp -r user@csserver.evansville.edu:/home/hwang/cs375/lecture05. Project 1 posted, due next Thursday

More information

CptS 360 (System Programming) Unit 6: Files and Directories

CptS 360 (System Programming) Unit 6: Files and Directories CptS 360 (System Programming) Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2019 Motivation Need to know your way around a filesystem. A properly organized filesystem

More information

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls Lecture 3 Introduction to Unix Systems Programming: Unix File I/O System Calls 1 Unix File I/O 2 Unix System Calls System calls are low level functions the operating system makes available to applications

More information

How do we define pointers? Memory allocation. Syntax. Notes. Pointers to variables. Pointers to structures. Pointers to functions. Notes.

How do we define pointers? Memory allocation. Syntax. Notes. Pointers to variables. Pointers to structures. Pointers to functions. Notes. , 1 / 33, Summer 2010 Department of Computer Science and Engineering York University Toronto June 15, 2010 Table of contents, 2 / 33 1 2 3 Exam, 4 / 33 You did well Standard input processing Testing Debugging

More information

Preview. System Call. System Call. System Call. System Call. Library Functions 9/20/2018. System Call

Preview. System Call. System Call. System Call. System Call. Library Functions 9/20/2018. System Call Preview File Descriptors for a Process for Managing Files write read open close lseek A system call is a request for the operating system to do something on behalf of the user's program. The system calls

More information

CS 241 Data Organization. August 21, 2018

CS 241 Data Organization. August 21, 2018 CS 241 Data Organization August 21, 2018 Contact Info Instructor: Dr. Marie Vasek Contact: Private message me on the course Piazza page. Office: Room 2120 of Farris Web site: www.cs.unm.edu/~vasek/cs241/

More information

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O Sections 8.2-8.5, Bryant and O'Hallaron PROCESS CONTROL (CONT.) CMSC 216 - Wood, Sussman, Herman, Plane 2 Signals

More information

Implementation should be efficient. Provide an abstraction to the user. Abstraction should be useful. Ownership and permissions.

Implementation should be efficient. Provide an abstraction to the user. Abstraction should be useful. Ownership and permissions. File Systems Ch 4. File Systems Manage and organize disk space. Create and manage files. Create and manage directories. Manage free space. Recover from errors. File Systems Complex data structure. Provide

More information

File Systems Ch 4. 1 CS 422 T W Bennet Mississippi College

File Systems Ch 4. 1 CS 422 T W Bennet Mississippi College File Systems Ch 4. Ë ¾¾ Ì Ï ÒÒ Ø Å ÔÔ ÓÐÐ 1 File Systems Manage and organize disk space. Create and manage files. Create and manage directories. Manage free space. Recover from errors. Ë ¾¾ Ì Ï ÒÒ Ø Å

More information

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto For more information please consult Advanced Programming in the UNIX Environment, 3rd Edition, W. Richard Stevens and

More information

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES Your name: SUNet ID: In accordance with both the letter and the spirit of the Stanford Honor Code, I did not cheat on this exam. Furthermore,

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 100 points Due Date: Friday, September 14, 11:59 pm (midnight) Late deadline (25% penalty): Monday, September 17, 11:59 pm General information This assignment is to be

More information

CS 4284 Systems Capstone

CS 4284 Systems Capstone CS 4284 Systems Capstone Disks & File Systems Godmar Back Filesystems Files vs Disks File Abstraction Byte oriented Names Access protection Consistency guarantees Disk Abstraction Block oriented Block

More information

To understand this, let's build a layered model from the bottom up. Layers include: device driver filesystem file

To understand this, let's build a layered model from the bottom up. Layers include: device driver filesystem file Disks_and_Layers Page 1 So what is a file? Tuesday, November 17, 2015 1:23 PM This is a difficult question. To understand this, let's build a layered model from the bottom up. Layers include: device driver

More information

Operating System Concepts Ch. 11: File System Implementation

Operating System Concepts Ch. 11: File System Implementation Operating System Concepts Ch. 11: File System Implementation Silberschatz, Galvin & Gagne Introduction When thinking about file system implementation in Operating Systems, it is important to realize the

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004 Lecture 18: Naming, Directories, and File Caching 18.0 Main Points How do users name files? What is a name? Lookup:

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2002 Lecture 18: Naming, Directories, and File Caching 18.0 Main Points How do users name files? What is a name? Lookup:

More information

CS16 Midterm Exam 2 E02, 09F, Phill Conrad, UC Santa Barbara Wednesday, 11/18/2009

CS16 Midterm Exam 2 E02, 09F, Phill Conrad, UC Santa Barbara Wednesday, 11/18/2009 CS16 Midterm Exam 2 E02, 09F, Phill Conrad, UC Santa Barbara Wednesday, 11/18/2009 Name: Umail Address: @ umail.ucsb.edu Circle Lab section: 8AM 10AM 11AM noon Link to Printer Friendly PDF Version Answer

More information

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry:

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry: Logical Diagram VFS, Continued Don Porter CSE 506 Binary Formats RCU Memory Management File System Memory Allocators System Calls Device Drivers Networking Threads User Today s Lecture Kernel Sync CPU

More information

CSci 4061 Introduction to Operating Systems. File Systems: Basics

CSci 4061 Introduction to Operating Systems. File Systems: Basics CSci 4061 Introduction to Operating Systems File Systems: Basics File as Abstraction Naming a File creat/open ( path/name, ); Links: files with multiple names Each name is an alias #include

More information

VFS, Continued. Don Porter CSE 506

VFS, Continued. Don Porter CSE 506 VFS, Continued Don Porter CSE 506 Logical Diagram Binary Formats Memory Allocators System Calls Threads User Today s Lecture Kernel RCU File System Networking Sync Memory Management Device Drivers CPU

More information

CS61 Scribe Notes Lecture 18 11/6/14 Fork, Advanced Virtual Memory

CS61 Scribe Notes Lecture 18 11/6/14 Fork, Advanced Virtual Memory CS61 Scribe Notes Lecture 18 11/6/14 Fork, Advanced Virtual Memory Roger, Ali, and Tochi Topics: exploits fork shell programming rest of course announcements/ending (for later info) final (not as time

More information

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1

CST8207: GNU/Linux Operating Systems I Lab Six Linux File System Permissions. Linux File System Permissions (modes) - Part 1 Student Name: Lab Section: Linux File System Permissions (modes) - Part 1 Due Date - Upload to Blackboard by 8:30am Monday March 12, 2012 Submit the completed lab to Blackboard following the Rules for

More information

Announcements. Persistence: Crash Consistency

Announcements. Persistence: Crash Consistency Announcements P4 graded: In Learn@UW by end of day P5: Available - File systems Can work on both parts with project partner Fill out form BEFORE tomorrow (WED) morning for match Watch videos; discussion

More information

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University File I/O Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Unix Files A Unix file is a sequence of m bytes: B 0, B 1,..., B k,..., B m-1 All I/O

More information

CMPSC 311- Introduction to Systems Programming Module: Input/Output

CMPSC 311- Introduction to Systems Programming Module: Input/Output CMPSC 311- Introduction to Systems Programming Module: Input/Output Professor Patrick McDaniel Fall 2014 Input/Out Input/output is the process of moving bytes into and out of the process space. terminal/keyboard

More information

Arvind Krishnamurthy Spring Implementing file system abstraction on top of raw disks

Arvind Krishnamurthy Spring Implementing file system abstraction on top of raw disks File Systems Arvind Krishnamurthy Spring 2004 File Systems Implementing file system abstraction on top of raw disks Issues: How to find the blocks of data corresponding to a given file? How to organize

More information

FS Consistency & Journaling

FS Consistency & Journaling FS Consistency & Journaling Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) Why Is Consistency Challenging? File system may perform several disk writes to serve a single request Caching

More information

Introduction to File Systems

Introduction to File Systems Introduction to File Systems CS-3013 Operating Systems Hugh C. Lauer (Slides include materials from Slides include materials from Modern Operating Systems, 3 rd ed., by Andrew Tanenbaum and from Operating

More information

CS 167 Final Exam Solutions

CS 167 Final Exam Solutions CS 167 Final Exam Solutions Spring 2018 Do all questions. 1. [20%] This question concerns a system employing a single (single-core) processor running a Unix-like operating system, in which interrupts are

More information

ECE 598 Advanced Operating Systems Lecture 18

ECE 598 Advanced Operating Systems Lecture 18 ECE 598 Advanced Operating Systems Lecture 18 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 5 April 2016 Homework #7 was posted Project update Announcements 1 More like a 571

More information

Virtual File System. Don Porter CSE 506

Virtual File System. Don Porter CSE 506 Virtual File System Don Porter CSE 506 History ò Early OSes provided a single file system ò In general, system was pretty tailored to target hardware ò In the early 80s, people became interested in supporting

More information

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell

More information

CSC369 Lecture 9. Larry Zhang, November 16, 2015

CSC369 Lecture 9. Larry Zhang, November 16, 2015 CSC369 Lecture 9 Larry Zhang, November 16, 2015 1 Announcements A3 out, due ecember 4th Promise: there will be no extension since it is too close to the final exam (ec 7) Be prepared to take the challenge

More information

Virtual File System. Don Porter CSE 306

Virtual File System. Don Porter CSE 306 Virtual File System Don Porter CSE 306 History Early OSes provided a single file system In general, system was pretty tailored to target hardware In the early 80s, people became interested in supporting

More information

The UNIX File System

The UNIX File System The UNIX File System Magnus Johansson May 9, 2007 1 UNIX file system A file system is created with mkfs. It defines a number of parameters for the system, such as: bootblock - contains a primary boot program

More information

Summer June 15, 2010

Summer June 15, 2010 Summer 2010 Department of omputer Science and Engineering York University Toronto June 15, 2010 1 / 33 Table of contents 1 2 3 2 / 33 Plan 1 2 3 3 / 33 Exam summary You did well Standard input processing

More information

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission Filesystem Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Directory A special file contains (inode, filename) mappings Caching Directory cache Accelerate to find inode

More information

File System Internals. Jo, Heeseung

File System Internals. Jo, Heeseung File System Internals Jo, Heeseung Today's Topics File system implementation File descriptor table, File table Virtual file system File system design issues Directory implementation: filename -> metadata

More information

Recall: Address Space Map. 13: Memory Management. Let s be reasonable. Processes Address Space. Send it to disk. Freeing up System Memory

Recall: Address Space Map. 13: Memory Management. Let s be reasonable. Processes Address Space. Send it to disk. Freeing up System Memory Recall: Address Space Map 13: Memory Management Biggest Virtual Address Stack (Space for local variables etc. For each nested procedure call) Sometimes Reserved for OS Stack Pointer Last Modified: 6/21/2004

More information

File System Implementation

File System Implementation Introduction to Operating Systems File System Implementation John Franco Electrical Engineering and Computing Systems University of Cincinnati Layered File System Application Programs Logical File System

More information

CSCI 102L - Data Structures Midterm Exam #2 Spring 2011

CSCI 102L - Data Structures Midterm Exam #2 Spring 2011 CSCI 102L - Data Structures Midterm Exam #2 Spring 2011 (12:30pm - 1:50pm, Thursday, March 24) Instructor: Bill Cheng ( This exam is closed book, closed notes, closed everything. No cheat sheet allowed.

More information

Systems Programming. COSC Software Tools. Systems Programming. High-Level vs. Low-Level. High-Level vs. Low-Level.

Systems Programming. COSC Software Tools. Systems Programming. High-Level vs. Low-Level. High-Level vs. Low-Level. Systems Programming COSC 2031 - Software Tools Systems Programming (K+R Ch. 7, G+A Ch. 12) The interfaces we use to work with the operating system In this case: Unix Programming at a lower-level Systems

More information

Homework # 7 DUE: 11:59pm November 15, 2002 NO EXTENSIONS WILL BE GIVEN

Homework # 7 DUE: 11:59pm November 15, 2002 NO EXTENSIONS WILL BE GIVEN Homework #6 CS 450 - Operating Systems October 21, 2002 Homework # 7 DUE: 11:59pm November 15, 2002 NO EXTENSIONS WILL BE GIVEN 1. Overview In this assignment you will implement that FILES module of OSP.

More information

CSE506: Operating Systems CSE 506: Operating Systems

CSE506: Operating Systems CSE 506: Operating Systems CSE 506: Operating Systems Block Cache Address Space Abstraction Given a file, which physical pages store its data? Each file inode has an address space (0 file size) So do block devices that cache data

More information

Lecture 19: File System Implementation. Mythili Vutukuru IIT Bombay

Lecture 19: File System Implementation. Mythili Vutukuru IIT Bombay Lecture 19: File System Implementation Mythili Vutukuru IIT Bombay File System An organization of files and directories on disk OS has one or more file systems Two main aspects of file systems Data structures

More information

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi. Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 18 Tries Today we are going to be talking about another data

More information

412 Notes: Filesystem

412 Notes: Filesystem 412 Notes: Filesystem A. Udaya Shankar shankar@cs.umd.edu December 5, 2012 Contents 1 Filesystem interface 2 2 Filesystem implementation 3 3 FAT (mostly from Wikepedia) 5 4 UFS (mostly from Wikepedia)

More information

The bigger picture. File systems. User space operations. What s a file. A file system is the user space implementation of persistent storage.

The bigger picture. File systems. User space operations. What s a file. A file system is the user space implementation of persistent storage. The bigger picture File systems Johan Montelius KTH 2017 A file system is the user space implementation of persistent storage. a file is persistent i.e. it survives the termination of a process a file

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 22 File Systems Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Disk Structure Disk can

More information

Files and the Filesystems. Linux Files

Files and the Filesystems. Linux Files Files and the Filesystems Linux Files The file is the most basic and fundamental abstraction in Linux. Linux follows the everything-is-a-file philosophy. Consequently, much interaction occurs via reading

More information

File Systems Management and Examples

File Systems Management and Examples File Systems Management and Examples Today! Efficiency, performance, recovery! Examples Next! Distributed systems Disk space management! Once decided to store a file as sequence of blocks What s the size

More information

File System Structure. Kevin Webb Swarthmore College March 29, 2018

File System Structure. Kevin Webb Swarthmore College March 29, 2018 File System Structure Kevin Webb Swarthmore College March 29, 2018 Today s Goals Characterizing disks and storage media File system: adding order and structure to storage FS abstractions (files, directories,

More information

Logical disks. Bach 2.2.1

Logical disks. Bach 2.2.1 Logical disks Bach 2.2.1 Physical disk is divided into partitions or logical disks Logical disk linear sequence of fixed size, randomly accessible, blocks disk device driver maps underlying physical storage

More information

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University File System Internals Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics File system implementation File descriptor table, File table

More information

Computer Systems Laboratory Sungkyunkwan University

Computer Systems Laboratory Sungkyunkwan University File System Internals Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics File system implementation File descriptor table, File table

More information

The UNIX File System

The UNIX File System The UNIX File System Magnus Johansson (May 2007) 1 UNIX file system A file system is created with mkfs. It defines a number of parameters for the system as depicted in figure 1. These paremeters include

More information

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files!

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files! Motivation Operating Systems Process store, retrieve information Process capacity restricted to vmem size When process terminates, memory lost Multiple processes share information Systems (Ch 0.-0.4, Ch.-.5)

More information

Chapter 11: Implementing File Systems

Chapter 11: Implementing File Systems Silberschatz 1 Chapter 11: Implementing File Systems Thursday, November 08, 2007 9:55 PM File system = a system stores files on secondary storage. A disk may have more than one file system. Disk are divided

More information

This exam contains 7 pages (including this cover page) and 4 questions. Once we tell you to start, please check that no pages are missing.

This exam contains 7 pages (including this cover page) and 4 questions. Once we tell you to start, please check that no pages are missing. Computer Science 5271 Fall 2015 Midterm exam October 19th, 2015 Time Limit: 75 minutes, 4:00pm-5:15pm This exam contains 7 pages (including this cover page) and 4 questions. Once we tell you to start,

More information

CISC 220 fall 2011, set 1: Linux basics

CISC 220 fall 2011, set 1: Linux basics CISC 220: System-Level Programming instructor: Margaret Lamb e-mail: malamb@cs.queensu.ca office: Goodwin 554 office phone: 533-6059 (internal extension 36059) office hours: Tues/Wed/Thurs 2-3 (this week

More information

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Midterm Exam October 23, 2012, Duration: 80 Minutes (10 pages, 12 questions, 100 Marks) Instructor: Dr. Kamran Sartipi Question 1 (Computer Systgem)

More information

Final Examination CS 111, Fall 2016 UCLA. Name:

Final Examination CS 111, Fall 2016 UCLA. Name: Final Examination CS 111, Fall 2016 UCLA Name: This is an open book, open note test. You may use electronic devices to take the test, but may not access the network during the test. You have three hours

More information

Operating Systems (ECS 150) Spring 2011

Operating Systems (ECS 150) Spring 2011 Operating Systems (ECS 150) Spring 2011 Raju Pandey Department of Computer Science University of California, Davis CA 95616 pandey@cs.ucdavis.edu http://www.cs.ucdavis.edu/~pandey Course Objectives After

More information

CSC Operating Systems Fall Lecture - I Introduction. Tevfik Ko!ar. Louisiana State University. August 25 th, Contact Information

CSC Operating Systems Fall Lecture - I Introduction. Tevfik Ko!ar. Louisiana State University. August 25 th, Contact Information CSC 4103 - Operating Systems Fall 2009 Lecture - I Introduction Tevfik Ko!ar Louisiana State University August 25 th, 2009 1 Contact Information Instructor: Prof. Tevfik Kosar Office: 292 Coates (also

More information

Chapter 6. File Systems

Chapter 6. File Systems Chapter 6 File Systems 6.1 Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems 350 Long-term Information Storage 1. Must store large amounts of data 2. Information stored must

More information

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers A Big Step Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Copyright 2006 2009 Stewart Weiss What a shell really does Here is the scoop on shells. A shell is a program

More information

PERSISTENCE: FSCK, JOURNALING. Shivaram Venkataraman CS 537, Spring 2019

PERSISTENCE: FSCK, JOURNALING. Shivaram Venkataraman CS 537, Spring 2019 PERSISTENCE: FSCK, JOURNALING Shivaram Venkataraman CS 537, Spring 2019 ADMINISTRIVIA Project 4b: Due today! Project 5: Out by tomorrow Discussion this week: Project 5 AGENDA / LEARNING OUTCOMES How does

More information

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission 1

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission 1 Filesystem Disclaimer: some slides are adopted from book authors slides with permission 1 Storage Subsystem in Linux OS Inode cache User Applications System call Interface Virtual File System (VFS) Filesystem

More information

CSC 271 Software I: Utilities and Internals

CSC 271 Software I: Utilities and Internals CSC 271 Software I: Utilities and Internals Lecture 13 : An Introduction to File I/O in Linux File Descriptors All system calls for I/O operations refer to open files using a file descriptor (a nonnegative

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2017 Lecture 17: File System Crash Consistency Ryan Huang Administrivia Lab 3 deadline Thursday Nov 9 th 11:59pm Thursday class cancelled, work on the lab Some

More information

CSC116: Introduction to Computing - Java

CSC116: Introduction to Computing - Java CSC116: Introduction to Computing - Java Course Information Introductions Website Syllabus Computers First Java Program Text Editor Helpful Commands Java Download Intro to CSC116 Instructors Course Instructor:

More information

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager Points Possible: 100 Submission via Canvas No collaboration among groups. Students in one group should NOT share any project

More information

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1 Files (review) and Regular Expressions Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 midterms (Feb 11 and April 1) Files and Permissions Regular Expressions 2 Sobel, Chapter 6 160_pathnames.html

More information

Introduction to Computer Systems

Introduction to Computer Systems Introduction to Computer Systems Web Page http://pdinda.org/ics Syllabus See the web page for more information. Class discussions are on Piazza We will make only minimal use of Canvas (grade reports, perhaps

More information

UNIX Structure. Operating Systems In Depth VII 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

UNIX Structure. Operating Systems In Depth VII 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. UNIX Structure Operating Systems In Depth VII 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. The Unix Address Space stack dynamic bss data text Operating Systems In Depth VII 2 Copyright 2018

More information

File Systems. CSE 2431: Introduction to Operating Systems Reading: Chap. 11, , 18.7, [OSC]

File Systems. CSE 2431: Introduction to Operating Systems Reading: Chap. 11, , 18.7, [OSC] File Systems CSE 2431: Introduction to Operating Systems Reading: Chap. 11, 12.1 12.4, 18.7, [OSC] 1 Contents Files Directories File Operations File System Disk Layout File Allocation 2 Why Files? Physical

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Fall 2017 Miniassignment 1 50 points Due Date: Monday, October 16, 11:59 pm (midnight) Late deadline (25% penalty): Tuesday, October 17, 11:59 pm General information This assignment is to be

More information

CSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes

CSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes CSci 4061 Introduction to Operating Systems IPC: Basics, Pipes Today Directory wrap-up Communication/IPC Test in one week Communication Abstraction: conduit for data exchange between two or more processes

More information

(Refer Slide Time: 06:01)

(Refer Slide Time: 06:01) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 28 Applications of DFS Today we are going to be talking about

More information

This lecture is covered in Section 4.1 of the textbook.

This lecture is covered in Section 4.1 of the textbook. This lecture is covered in Section 4.1 of the textbook. A Unix process s address space appears to be three regions of memory: a read-only text region (containing executable code); a read-write region consisting

More information

CS 241 Data Organization using C

CS 241 Data Organization using C CS 241 Data Organization using C Fall 2018 Instructor Name: Dr. Marie Vasek Contact: Private message me on the course Piazza page. Office: Farris 2120 Office Hours: Tuesday 2-4pm and Thursday 9:30-11am

More information

CS 300. Data Structures

CS 300. Data Structures CS 300 Data Structures Start VirtualBox Search or Windows Run C:\CS300 Launches CS 300/360 Virtual Machine (Eventually) Logon with Zeus password Syllabus http://zeus.cs.pacificu.edu/chadd/cs300f18/syllabus.html

More information

Hints for Instructors

Hints for Instructors APPENDIX C Hints for Instructors This appendix is addressed to faculty members and graduate students teaching Math 473. Most of it should apply to other Math courses that use computers, with suitable changes.

More information

AC109/AT109 UNIX & SHELL PROGRAMMING DEC 2014

AC109/AT109 UNIX & SHELL PROGRAMMING DEC 2014 Q.2 a. Explain the principal components: Kernel and Shell, of the UNIX operating system. Refer Page No. 22 from Textbook b. Explain absolute and relative pathnames with the help of examples. Refer Page

More information

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017 ECE 550D Fundamentals of Computer Systems and Engineering Fall 2017 The Operating System (OS) Prof. John Board Duke University Slides are derived from work by Profs. Tyler Bletsch and Andrew Hilton (Duke)

More information

COMP 530: Operating Systems File Systems: Fundamentals

COMP 530: Operating Systems File Systems: Fundamentals File Systems: Fundamentals Don Porter Portions courtesy Emmett Witchel 1 Files What is a file? A named collection of related information recorded on secondary storage (e.g., disks) File attributes Name,

More information

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell

More information

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University File System Case Studies Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics The Original UNIX File System FFS Ext2 FAT 2 UNIX FS (1)

More information

CS1 Lecture 13 Feb. 13, 2019

CS1 Lecture 13 Feb. 13, 2019 CS1 Lecture 13 Feb. 13, 2019 Exam 1, Thursday evening, 2/21, 6:30-8:00pm, W290 CB Email about make-ups will be sent tomorrow HW4 Q1 available. Q2 Q4 tomorrow. For Q1 only, Academic Honesty policy does

More information

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University File System Case Studies Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics The Original UNIX File System FFS Ext2 FAT 2 UNIX FS (1)

More information