Operating Systems 2019W Lecture 4: Difference between revisions
Created page with "==Video== Video from the lecture given on January 16, 2019 [https://homeostasis.scs.carleton.ca/~soma/os-2019w/lectures/comp3000-2019w-lec04-20190116.m4v is now available]...." |
|||
Line 5: | Line 5: | ||
==Notes== | ==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, [https://en.wikipedia.org/wiki/Stand-alone_shell sash] (called ash in lecture) | |||
* [https://en.wikipedia.org/wiki/BusyBox 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 | |||
* [https://en.wikipedia.org/wiki/X_Window_System X Window system] versus [https://en.wikipedia.org/wiki/Wayland_(display_server_protocol) 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 |
Latest revision as of 20:35, 17 January 2019
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