What ROM stands for in this class
What is Relocatable Object Module?
The name of the process that your code calls so that it can interact with files
What is the Operating System Kernel?
The definition of abstraction
What is a high level view, ignoring the gritty low level details?
0101 & 1001
What is 0001?
The file size in bytes of a text file that has 300 characters in it
What is 300?
The input and output of the assembler
What is assembly code, and ROM?
A non-negative integer that is associated with a file that is currently opened
What is a File Descriptor?
The things defined in the header file of an ADT
The purpose the header file serves in the program translation process
What are public functions?
What is to allow the driver code to compile but not link?
0110 in decimal,
and (0110 << 1) in decimal
What are 6, and 12?
The definition of system calls
What is the interface between your process and the OS?
The purpose of the semantic analyzer, its inputs, and its outputs
What is type checking and implicit casting?
What is a syntax tree, and symbol table?
What is a semantically correct syntax tree?
The reason why calling write() in your program doesn't always immediately write to hardware
What is buffering of output by the Operating System Kernel?
The interface of a hypothetical Car Abstract Data Type
What is start(), accelerate(), brake(), steer(), getSpeed(), and getFuelLevel()?
Show an example of how to flip a number to negative in two's complement.
Flip all of the bits and add 1.
e.x., 0110 becomes 1010
Write C code that has a memory leak
Anything that loses a pointer to an allocated heap block
The output of running the preprocessor on this file:
#define name
#ifdef name
some good text here
#else
some bad text here
#endif
What is "some good text here"?
The three basic modes for opening a file and what they do, and what adding "b" does
How is the structure of the data in the ADT hidden from the driver code?
The header file does not contain the definition of the structure of the data.
Show the c code to turn on the 4th bit of an integer, x. Assume that x is already defined.
x |= 1 << 3;
What this code prints:
int f() { return 12; }
int g() { return 42; }
int main() {
int x = f(), g();
printf("x is %d\n", x);
}
What is "x is 12"?
The overall process of program translation, starting from C program, and ending with Code running in Memory
What is
Come up with a real world analogy that illustrates why buffering speeds up I/O
Anything that illustrates filling up a buffer that can hold many things, and a long travel time between the process and the file.
Draw a picture showing the files (driver.c, ADT.h, ADT.c), showing what happens at the preprocessor step, compiler step, and linker step. Show inputs and outputs of each step in terms of the files.
Draw the truth table for AND, OR, and XOR
AND is 1 when both inputs are 1, otherwise 0.
OR is 0 when both inputs are 0, otherwise 1.
XOR is 1 when the inputs are different, otherwise 0.
Write a struct called packed_data that stores the following values as compactly as possible:
- 3 boolean flags f1, f2, f3 (3 bits)
- an unsigned integer "type", in the range 0 - 255 (8 bits)
- and an unsigned integer "index", in the range 0 - 10,000 (17 bits)
struct packed_data {
unsigned int : 4; // unnamed variable indicates unused bits
unsigned int f1 : 1;
unsigned int f2 : 1;
unsigned int f3 : 1;
unsigned int type : 8;
unsigned int index : 17;
};