Final Review
COP-3402
Table of Contents
Exam details
| Duration | 2 hours |
| Date and time | Thursday, 04/30, 1000–1200 |
| Location | Lecture room, CB2-207 |
Exam Format
| Category | Points per question | Number of questions | Total points |
|---|---|---|---|
| Multiple choice | 1 | 26 | 26 |
| Short answer | 1 | 5 | 5 |
| Long answer | 5 | 1 | 5 |
| Total | 32 | 36 |
Final score: (Total points) / 3
Multiple choice breakdown
| Material | Questions |
|---|---|
| First-half of course (pre-midterm) | 8 |
| Second-half of course (post-midterm) | 18 |
Mid-term material
File systems
- What is the difference between absolute vs. relative paths?
- How are parent directories referenced in the file system?
- Given a tree, which file is being reference by a given path?
Navigation
- What is the working directory and how do you display it?
- What is the unix standard command to rename a file?
- What unix standard command will show you contents of the current working directory?
- What unix standard command will show you the contents of an entire file system hierarchy?
- What does grep do?
Processes, advanced processes?
- How do you redirect standard (out, in) of bash command to a file? For instance, if I want to redirect grep's (out, in) to the file grep.txt what do I type?
- How do you redirect standard out from one command to another command's standard in? For instance, let's say I want to count the results of find with wc, what do I type?
- If I run a command such as grep without any arguments, how can I tell it to stop reading from stdin?
Version control
- What git command copies commits from the local repository to the remote repository?
- What git command copies commits from the remote repository to the local repository?
- What git command stages a new file?
- What git command creates a log of the change to a staged file to the local repository?
- What git command creates a new local copy of a remote repository?
Signals
- What shell command can be used to send a signal to a program?
- How can I suspend a program?
- How can I resume a suspended program in the background/foreground?
Syscalls
- Use the open syscall (man 2 open, not fopen) to open a path given in the
string char *filepathvariable for writing. - How do you check for and terminate the program on an error with opening a file?
- What syscall can you use to find the size of and number of hard-links to a file?
- What syscall can you use the find the name of a file?
- Write a code snippet that will print all files in a given directory, except do not print the "." and ".." names
- What does the fork system call return? What does it duplicate between a parent and child process?
Second-half material
Compiler basics
- What is a compiler?
- What is an interpreter?
- What is the purpose of a grammar?
- When writing a grammar, what is ambiguity and why is it a problem?
- What are these grammar components: starting symbol, productions, non-terminals, and terminals.
Source code to processes
- Remember the phases of the compilation and program execution toolchain, and their ordering
- Preprocessing
- Compilation
- Assembly
- Linking
- Loading
- What does each stage do?
- What is a program's true entry-point?
Arithmetic
- Understand and write both SimpleIR and assembly code for arithmetic.
- What assembly instructions perform arithmetic?
- How are division instructions different from other assembly arithmetic instructions?
- Translate to/from SimpleIR and assembly.
Branching
- Understand and write both SimpleIR and assembly code for branching
- What assembly instructions perform branching?
- Translate to/from SimpleIR and assembly.
Pointers
- Understand and write both SimpleIR and assembly code for pointers.
- Write equivalent assembly code
- Translate to/from SimpleIR and assembly.
Functions, ABI, and the stack
- What does an application binary interface specify?
- How and why can we call functions defined in C code from within SimpleIR?
- What are the contents of the stack frame in the x86 64 System V ABI?
- How are parameters passed in the x86 64 System V ABI?
- What actions do the
callandret(and push and pop) assembly instructions do? - How are variables represented and accessed in memory?
- How is the stack frame managed?
- What do the function prologue and epilogue do?
- How are values returned from a function in the x86 64 System V ABI?
- In what direction does the stack grow?
- What register(s) must a callee preserve the value of in order to follow the x86 64 System V ABI?