Uploaded by Yimo Ning

Discussion Session 06

advertisement
Discussion Session 06
Structural Induction on Lists
Data List a = Cons a (List a)
| Empty
Step 1: base case
• Need to prove [] ++ [] == []
Step 2 Successor Case
• Need to prove (x:xs) ++ [] = (x:xs)
• We can assume xs ++ [] == xs (Induction Hypothesis)
Q.E.D
Kernel
• What is a kernel
o Runs as an infinite loop in the background
o Provides a set of system calls
• What are some example of system calls?
o Program execution
o Memory management
o File system management
o IO device management
• Linux is a kernel, A LOT OF different OS’s build with it, including
o Ubuntu
o NixOS
o Android
o Arch Linux
Unix System
• Unix is a standard (some consider a philosophy)
o All unix-like operating system have similar file system layouts, similar
ways of handling processes, similar sets of fundamental system
programs, etc.
• Command line interface on all Unix-like system feel very similar
• Examples of systems in the unix-family
o All linux based systems
o macOS
o Except windows
GUI (graphical User Interface)
• Display consists of root window and other windows and objects are placed
within it (according to the windows management)
• User interacts with combination of mouse and keyword
• GUI handles the events that occur
Command line interface (CLI)
Display consists of a single text-oriented
Advantage:
• More direct way of interacting with your OS (better for “power user”)
• Takes up less resources
• Commands can be put into a script and automated
Disadvantage:
• Not very intuitive for new users
• Difficult to learn/use
Files
• A Finite sequence of data stored on a persistent storage device
• Text files (ASCII or Unicode)
o Meant to be read/written to directly
o A simple sequence of bytes
• What are binary files
o Not meant to be read / written to directly. Not all bytes correspond to a
character
o Example
Exe, doc, doc, pdf
• What are executable files?
o Special types of binary file, meant to contain computer instructions ( in
machine code format) for the CPU to execute
• What’s a file system
o A recursive structure called a file tree consisting of
Files
Directories
File Path
• What’s a absolute (Full) Path
o Starts with /
• What’s a relative path?
o Depends on where you currently are
o Does not start with /
Download