00. Overview. Syscall → utility → shell → script → service
Reprise: operating system goals
unification of resources interface
separation of resources access
logging (accounting) of resources utilization
(aka u/s/l)
Resources:
- CPU time
- RAM
- Devices
E. g.:
- Concurrent multitasking
- Scheduling
- Virtual memory
- Filesystems and file permissions
- Video rendering, sound, other input/output devices
- Networking
- …
Interfaces and tools
Supervisor mode (kernel space) and user mode (user space):
- hardware access restrictions
- virtual memory
- elimination of atomic resource concurrent usage
Interface levels:
Kernel: syscalls. Used primarily inside kernel code (∃ klibc, in fact). E. g. clone (in fact, huge amount of u/s/l) or in libc library.
Libc: library calls. Used when programming userspace utilities. E. g. fork or daemon, or exec.
Utilities: programs to perform syscalls, with goodies. E. g. env, xargs
- Shell: scripting utilities usage. I/O redirection, process manupulation, programming language.
- Services (daemons): task is too complex/too slow for shell scripting; back to programming
Also: daemons
True Socrate's daemon
«Flower architecture»
- Thick circle is kernel space:
- Kernel
- Modules
- Outside is userspace
- Utilities
- Applications
- Daemons
Shell (intro)
If there's time
Interface basecs:
- Control and data I/O flows
- Human readable
Human writeable
- Data flow / control flow separation problem
So:
- Readable/writeable text is (almost) universal format
- Data /control join
- Interactive QA scenario
⇒ Command line interface (CLI)
Shell:
- CLI
- High-level domain-specific programming language
- Application integration shell (I/O streams and signals)
Shell commands:
- Internal (about some dozen)
- Utilities (thousands)
Command line conventions ...
Additional topics to discuss
- OS architecture: monolith/modular/mixed
- Packages et al
- ...