Operating Systems 2019W Lecture 4
Video
Video from the lecture given on January 16, 2019 is now available.
Notes
Things discussed in lecture
- conducting experiments to understand system behavior vs. reading documentation
- Basic UNIX commands: cat, grep, wc, top
- static and dynamic linking, system calls (hello.c from Tutorial 1)
- /proc/self/exe
- many system calls from strace of hello
- C library (libc)
- static linking includes more than necessary
- dpkg -S to find package containing a file
- ldd to see which dynamic libraries a file depends on
- stand alone shell, sash (called ash in lecture)
- BusyBox
- statically linked
- little version of common parts of UNIX userland
- BusyBox plus Linux kernel = almost complete small Linux system
- disassembly of hello using objdump -d
- functions invoked using call, system calls invoked using syscall
- X Window system versus Wayland
- X Window system: standard way of displaying graphical applications on UNIX-like systems
- Wayland: modern replacement of X used with lots of backwards compatibility
- investigation of what happens when a window is closed (socket connection is terminated, but thought signal was sent)
- signals
- short messages sent to processes
- can be sent by the kill system call (and kill command)
- kill <process ID> sends TERM signal by default
- KILL causes process to die without cleanup (TERM allows for handler to do cleanup)
- have default handlers, most can be changed except for STOP and KILL
- Could catch bad memory access by catching SEGV signal
- can stop and restart processes using signals (STOP and CONT), CONT doesn't always work though