Operating Systems 2017F Lecture 8

From Soma-notes
Jump to navigation Jump to search

Notes

This class was review of older classes and answering questions (No new topics)


User mode: only mode available to us as users.

Kernel: Abstracts hardware so we can use it. eg. we request memory, kernel handles the actual allocation, etc.


What is a process: a running program, set of the instructions, given to the CPU to execute line by line

Command line/shell/terminal: This is how we can interact with the OS without a desktop environment.

How do processes communicate with each other ? They send signals to each other. eg. Child sends a signal to parent when it has finished execution.

Orphan process: parent has finished executing and terminated, leaving an "orphaned" child process who's parent process will now be a process from a higher level (grandfather process).

Zombie process: Process that has finished executing but its entry still exists in the process list. In this case, the parent is still up and running.


File system: managing/organizing the hard drive, control how data is stored/retrieved. Writing and reading from/to a file etc. examples of special files like /proc, etc.

inode is a data structure in linux that is used to store file metadata information like size of file, timestamps, type of file, etc. (however, it does NOT store the name or actual data of the file).


Environment: where we are working.

Environment variable: is where configurations/information about the system/current environment are stored. eg. username, type of terminal being used, prompt, etc.

"echo $USER" in terminal to check the value of "user" environment variable.


Difference between static and dynamic compilation:

Dynamically linked file: loads code from libraries as it needed.

Libraries are dynamically loaded into memory versus when they are loaded statically.

Statically linked file: loads relevant code into the binary during compilation so no library calls are made during runtime. This is why ltrace gives error.


Commands:

lspci: shows you which hardware you are working with

ps : to find a process ID , coming from the kernel

ps – aux

pstree: displayes the family tree

systemd : first one , always wait on the child and checks if the child has to report something to prevent zombie processes.

Man pages are helpful… "Man man" for more information