100% SOLVED SOLUTIONS!!
1 of
83
Ter
m
What are two common types of system calls?
Give this one a try
later!
File I/O
Source and destination sizes
Creating/Terminating
don't match
new processes
, A file that contains binary The variables/functions that need
code (instructions) and DATA to be resolved/relocated.
Don't know?
2 of 83
Term
Static functions are essentially private functions, so why do
they need linker symbols?
Give this one a try later!
Enables process to interact
with OS No, this is a struct, not a union!
Returns to Inext
Short answer:
Address of &myArray[3][4][5] May not need resolution,
= 0+ 4*[3*10*15 + 4*15 + 5] but may still need
relocation
=2060
Don't know?
3 of 83
Term
int func(int val);
int x = 34;
int main()
{ int y;
, y = func(x);
return 0;
}
Where can the value of variable x be found?
How about the symbol for variable x?
Give this one a try later!
Corresponds to sum = sum + n These are both globals, so bss or
Does not correspond to sum data
+= n arr is uninitialized, so bss
p is initialized, so data
Value: Global, so data
or bss, initialized so %ax isn't valid, memory address
data Symbol: Symtab needs to be 4 bytes, not 2
Don't know?
4 of 83
Term
What does .rel.text and .rel.data contain?
Give this one a try later!
Translates assembler to machine code (ROF)
shared and readable object files
, 1. Put the service number (what specific system call we're doing) in %EAX
2. Put the system call arguments in the remaining registers
3. Run int $0x80, this runs the exception x80 or exception 120 which
is the system call
Code/data that ,when moved to a place, need to be updated (maybe
cause have address offsets which need to be updated when relocated
during linking)
1. Shell creates a child process (duplicate of shell parent process to
be edited)
2. Child process invokes loader
3. Loader creates a new runtime image
4. Loader jumps to first address(
Don't know?
5 of 83
Term
What's a processor mode?
There are 2 modes, what are they?
Give this one a try later!
Different privilege levels
a process can run at
1=Kernel/Supervisor (no %ax isn't valid, memory
restrictions) address needs to be 4 bytes,
not 2
0=User (restricted)