Other aspects of an OS
- The shell
- This is a special purpose program designed to interact with the user.
- It is sometimes called a command interpreter
- The log in process.
- Some long running process, called a daemon listens for you to log in.
- You provide your credentials to this process and it eventually starts your shell.
- This shell is called a login shell
- If we wish, we can trace back to what happened.
- Each process has a unique process id
- This is a positive integer.
- PID 1 is reserved for a system start up process.
- ps -ef will display both the pid and ppid
- pstree will display a tree.
- Linux has a number of shells available
- The bourne shell (sh) is very old.
- The c-shell (csh) was constructed to mimic aspects of the C programming language.
- The korn shell (ksh) combined sh and csh
- The Bourne again shell (bash) is gnu's implementation of sh.
- Shells also frequently offer command interpreters.
- The shell usually supports variables, control structures and functions of a full programming language.
- But they tend to be picky, strange and just a bit hard to use.
- But they are really great for quick os level tasks.
- Users and groups
- On a linux system a user is just a number, the UID
- This is established in /etc/passwd
- An associated lin in /etc/shadow
- And, hopefully, at least one directory owned by the user.
- A group is a another construct
- A group number
- A list of members.
- /etc/group
- Somewhat weak.
- The superuser
- Identified by UID 0
- Typically called root.
- Can execute privileged commands.
- Example: int setuid(uid_t uid);
- Can send any signal to any process
- Can write to any file.
- Discuss using the root account.
- Discuss sudo
- The file system
- Is a tree like structure.
- The "root" of the tree is at the top. (/)
- relative paths.
- Absolute paths.
- Tilde paths.
- make a symbolic link.
- make a hard link.
- The file I/O model
- The principle of universality of I/O means that the same system calls work on all file types.
- read, write, open, close, seek, ...
- Processes
- Created via fork
- Have an effective user id, who the process is running as.
- Have a parent.
- Process exit, parents and zombies
- Init the ultimate zombie hunter.
- Signals
- Messages sent to processes by the kernel
- Or possibly other processes
- Inform the process that a major event has occurred.