Weekly Notes for Week 08
- In the lecture on February, 18th I will finish with Chapter 2: “System Structures”. I will show examples of how to use kernel instrumentation and debugging tools (dtrace, bpftrace, systemstap, perf). See the weekly notes for week 07 for details. In the lecture on February, 20th I will give an introduction to the 1st mandatory assignment and if time allows, start with the Chapter 3: “Processes”.
- The 1st mandatory assignment will be made available on the course homepage during week 8.
Tutorial Session Week 08
Prepare for the Tutorial Session in Week 08 from Chapter 2 the following exercises
- What is the purpose of system calls?
- What system calls have to be executed by a command interpreter or shell in order to start a new process on a UNIX system?
- What is the purpose of system programs?
- What is the main advantage of the layered approach to system design? What are the disadvantages of the layered approach?
- List five services provided by an operating system, and explain how each creates convenience for users. In which cases would it be impossible for user-level programs to provide these services? Explain your answer.
- How could a system be designed to allow a choice of operating systems from which to boot? What would the bootstrap program need to do?
- What are the advantages and disadvantages of using the same system-call interface for manipulating both files and devices?
- Describe why Android uses ahead-of-time (AOT) rather than just-in-time (JIT) compilation.
- How are iOS and Android similar? How are they different?
- What are the two models of interprocess communication? What are the strengths and weaknesses of the two approaches?
- What is the main advantage of the microkernel approach to system design? How do user programs and system services interact in a micro-kernel architecture? What are the disadvantages of using the microkernel approach?
Some more C programming exercises:
- The following is the code to allocate memory for a 2-dimensional array of fixed size 8×8.
#include <stdio.h> int main() { int x; int y; int array[8][8]; for ( x = 0; x < 8; x++ ) { for ( y = 0; y < 8; y++ ) array[x][y] = x * y; } }
- Where in the memory is the matrix stored?
- Provide the code for a variant of the code that allocated the memory dynamically.
- Where is your dynamically allocated memory stored?
- What is the output of the following C program?
- Discuss the following C program, and put it in relation to the function declaration as found by the man page of the library function for sorting an array:
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
- Discuss the result of the following C program. If possible, try it on different machines. In order to understand the results, find out what a sequence point is.
- Follow the C-tutorial for FILE I/O on https://www.cprogramming.com/tutorial/cfileio.html and answer the quiz questions.