Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 24CS311 – Operating Systems 1 1 CS311 – Lecture 24 Outline Final Exam Study Guide Note: These lecture notes are not intended replace your notes.

Similar presentations


Presentation on theme: "Lecture 24CS311 – Operating Systems 1 1 CS311 – Lecture 24 Outline Final Exam Study Guide Note: These lecture notes are not intended replace your notes."— Presentation transcript:

1 Lecture 24CS311 – Operating Systems 1 1 CS311 – Lecture 24 Outline Final Exam Study Guide Note: These lecture notes are not intended replace your notes. This is what I expect your notes to already look like, but with more explanation as needed. 1

2 Lecture 24CS311 – Operating Systems 1 2 Shell Commands and Utilities shell commands – know all the basic ones with common options. ls, cd, chmod, mkdir, rm, rmdir, cat, echo, ps, sleep, sort, wc, man, mv, cp, pwd, kill, chgrp, chown, newgrp, touch, gcc input and output redirection (, >>) command line pipes like ls | wc built in variables like $#, $1, $2, $USER, $PATH, … 2

3 Lecture 24CS311 – Operating Systems 1 3 Shell Commands and Utilities background processes -- sort $file1 & variable substitution -- Example: echo "$x was entered by the user" command substitution -- Example: listOFiles=`ls` wildcards -- Example: ls *.java What are the 3 steps the shell goes through to find the command? Use of double quotes vs. single quotes vs. back ticks 3

4 Lecture 24CS311 – Operating Systems 1 4 Bash Script Can you write a simple bash script on the exam? – What is the proper shebang line if you want the bash shell to interpret the script? – Can you write an if statement correctly? – Can you use the test command to see if 2 variables are equal or if a file exists? – Can you write a for loop correctly? 4

5 Lecture 24CS311 – Operating Systems 1 5 Powerful Unix Utilities awk – You might be asked to interpret a simple awk program. – awk variables: NR, NF, $0, $1 sed – Can you use sed to delete certain lines? – Can you use sed to substitute occurrences of a regular expression with a string? grep - can you use grep to find a specific pattern 5

6 Lecture 24CS311 – Operating Systems 1 6 Regular Expressions You should know the extended regular expressions –., *, +, ?, ^, $, [...], [^...], \, ( ) – Can you say whether or not a line will match a given regular expression? – Can you say exactly what will match? – Given a description of what to match, can you write a regular expression that works 6

7 Lecture 24CS311 – Operating Systems 1 7 Features of modern operating systems multiprogramming vs. time-sharing Explain why multiprogramming and timesharing are important for modern operating systems. Reproduce the diagram of the organization of Unix. Describe the memory organization of a typical process in a common operating system. What is a context switch? – Ans: It is when a process is switched out of the microprocessor and another is switched in. It is costly in terms of cycles because so much information must be saved so that when the old process is resumed, everything is as it was. 7

8 Lecture 24CS311 – Operating Systems 1 8 Process Management What does a child process inherit from its parent? – I'm looking for things such as: variables, open file descriptors, signal handling. What is different between parent and child? – They have different pid numbers, different parents, different physical memory, different CPU usage statistics What is a zombie? What is an orphan? 8

9 Lecture 24CS311 – Operating Systems 1 9 makefiles I could ask you to look at a makefile and predict what will print to the screen after certain commands from the command line. I could ask you to write a simple makefile. 9

10 Lecture 24CS311 – Operating Systems 1 10 System Calls You will be reading / writing code with any of the following system calls: – open – close – lseek – read – write – dup2 – fork--know what fork returns to the parent and to the child (and what if it fails) – wait or waitpid (What do these functions return?) – exec family of calls - know how to write execlp or execvp for the exam – pipe 10

11 Lecture 24CS311 – Operating Systems 1 11 File System If I give you a sequence of commands (fork, dup2, open, close), can you draw the diagrams of the processes' file descriptor tables, the system file table, and the in-memory i-node table? What information is contained in an i-node? What is NOT in an i-node? How are an i-node's direct, single indirect, double indirect, and triple indirect pointers used to access a file's data blocks? Name some types of files. 11

12 Lecture 24CS311 – Operating Systems 1 12 File System - Hard links and Soft links What is the difference between hard links and soft links? What happens if a user types (draw a picture of directory, inodes, data blocks) ln oldFile newFile What happens if a user types (draw a picture of directory, inodes, data blocks) ln -s oldFile newSoftLinkFile 12

13 Lecture 24CS311 – Operating Systems 1 13 Signals Can you follow code that – creates signal handlers with sigaction? – sends signals with kill? – contains fork()? You will be asked to predict the outcome of typing Ctrl-C at specific times. What is the difference between ignoring a signal and blocking a signal? Can you kill one of my processes? Can you kill one of your own? What is the default action for SIGINT? 13

14 Lecture 24CS311 – Operating Systems 1 14 Version Control Why use version control? Can you set up an SVN repository, check in a file, and check it out for editing? 14


Download ppt "Lecture 24CS311 – Operating Systems 1 1 CS311 – Lecture 24 Outline Final Exam Study Guide Note: These lecture notes are not intended replace your notes."

Similar presentations


Ads by Google