Week 1 Flashcards
What is an OS?
An OS is a software that manages computer resources and offers abstractions
What is the Kernel?
Central part of OS
Runs all time on the computer
Functionality depends on OS design
What is the Kernel Mode? (Or privileged mode)
Where the kernel runs
CPU has full access to system resources
What is User Mode?
It’s where applications run
CPU has restricted access to system resources
How does the OS switch between kernel and user mode
To switch to kernel mode the trap mode bit is triggered and set to 0, after the task has been performed in kernel mode the return mode bit is set to 1 which brings it back to OS
What is a Monolithic Structure?
Large kernel with most of OS services run in kernel mode
What are the pros and cons of a monolithic structure?
Pros:
Fast performance
Cons:
Stability and Security
Maintenance and Debugging
What is are the pros and cons of a Microkernel Structure?
Pros:
Stability and Security
Cons:
Poor Performance
What are the pros and cons of a Microkernel Structure?
Pros:
Stability and Security
Cons:
Poor Performance
What is a Layered Structure?
OS broken into hierarchy layers
Communication with above and below
Implemented into computer networks (TCP/IP)
What are the pros and cons of a Layered Structure?
Pros:
Easy to maintain debug and test
Security and Stability
Cons:
Poor performance
Design challenges
What is a Modular Structure?
Combines aspects of Monolithic and Microkernels
Start with small kernel
additional services are loaded on demand via modules
What are the pros and cons of a Modular Structure?
Pros:
Fast Performance
Flexibility and Extensibility
Cons:
Monolithic as more modules loaded
Fact
OS’s combine different structures
What is a file?
A file is a named collection of related data stored on non-volatile storage
What are magic numbers in files?
Sequence of bytes at beginning of file
What are examples of meta data?:
Name
Identifier
Type
Location
Size
Timestamps
Permissions
Where is Meta Data stored in linux?
In an Inode
What are the 2 features of Linux Files?
Everything is a file
Files represented by tree-like inode pointer structures
What are some examples of Linux file types?
Regular files
Special files (character of block)
Directories
Pipes
Links (soft or hard)
What is a hard link?
Another name for an existing file
points directly to inode of file
If file is moved/deleted the link will still work
what is a soft link?
A pointer to filename
If file is moved/deleted, the link will not work
How is the storage space divided for files?
Filesystems divide storage space into fixed-size blocks
Typical block size is 4096 bytes (4KB)
What can a file be broken down into?
into chunks that fit into blocks
What are magnetic disks?
Use magnetic fields to store data
eg. HDD or floppy disks
What are magnetic disks organised into?
Platters - Circular disks
Read/Write Heads
For reading and writing the head senses/ changes the magnetism of a sector
At bit level: magnetism in one direction represents a 1
magnetism in other direction represents a 0
How are the platters of a Magnetic Disk organised?
Each platter is divided into circular tracks
Each track is divided into sectors - each sector has fixed size
Set of all tracks are immediately above one another make up a cylinder
How does a magnetic disk work?
Read/ Written by moving the arms in and out of required cylinder
All heads/ arms move together
Platters rotate; rotation speed is related to data transfer rate
What is a Solid State Disk?
No moving parts and instead stores data using flash memory
What are the components in an SSD?
Controller (embedded processor)
Buffer memory (volatile memory)
Flash Memory - divided into pages that are grouped into blocks
What are the read, write and erase speeds of an SSD?
Read - Fast
Write to empty drive - Fast
Erase - Slow
How is an SSD read?
- Copying flash memory page into the buffer
- Reading data from the page in the buffer
How is an SSD overwritten?
- Copying memory block into buffer
- Erasing block in the flash memory
- Modifying block in the buffer
- Writing block from the buffer to the flash memory
What are the Pros and Cons of SSDs compared to magnetic?:
Pros:
SSDs are faster
SSDs more reliable
SSDs are more power efficient
Cons:
SSDs more expensive
SSDs deteriorate with every write
What is a wear levelling?
A process that is designed to extend the life of solid state devices
What is dynamic wear levelling?
New data written to least-recently-used block
Avoid wearing out certain blocks by writing to the same ones again and again
problem: “cold” data is not moved
What is Static-wear-levelling?
Same as dynamic besides:
Periodically moves existing data to least-recently-used block
Therefore we avoid wearing out certain blocks while blocks with cold data is never moved
What is the benefit of wear levelling?
A block will fail once it reaches a critical amount of writes
Thanks to wear-levelling, we spread the writes evenly among the blocks