Operating Systems Flashcards
This module makes me want to kms :3
ALU
Arithmetic Logic Unit
IR
Instruction Register
Contains instruction of last fetched.
MAR
Memory Address Register
Contains memory address for NEXT read/write
MBR
Memory Buffer Register
Holds data temporarily during memory read/write operations.
swap file
portion of the disk used for virtual memory
Command to see size of swap partition
fdisk -l
BUS?
Transfers info between components
Name 3 buses
DATA BUS, ADDRESS BUS, CONTROL BUS
DATA BUS
Transports actual data
ADDRESS BUS
carries memory addresses
CONTROL BUS
coordinates data flow between devices
Purpose of an interrupt?
signals an event that requires immediate attention, interrupting current process.
(It improves processing efficiency)
Interrupt Handler
Program determines nature of interrupt + performs whatever actions are needed.
Process
Program in execution
PID
Process ID: unique id of a process
PPID
Parent Process ID: ID of parent process
CMD
Command used to start process
Memory Tables
Allocation of main and secondary memory to processors.
Protection attributes for access to shared memory regions.
INFO needed to manage virtual memory virtual memory.
I/O Tables
if device is available or assigned.
status of each in-progress I/O operation.
Location in main memory being used as the source or destination of each in-progress I/O Transfer.
File Tables
Existence of files.
location on secondary memory.
current status.
attributes.
Process Tables
Where process is located
attributes necessary for its management.
process ID.
process state.
location in memory.
Daemon
runs in background
automatically starts at boot
no direct user interaction
name Two daemons :3
cron
sshd
Process scheduling
way processed are assigned to processsor
Non Pre-emptive
No interrupts process will continue until completes or blocks
Pre-emptive
process can be interrupted
time-slicing
rapidly switches between task giving each task a short time to run
SPN
Shortest Process Next
shortest time get priority
NON PRE-EMPTIVE
SRT
Shortest Remaining Time
same as SPN BUT IS PRE-EMPTIVE
TT
Turnaround Time
arrival time + waiting time
NTT
Normalized Turnaround Time
TT / service time
:3
ROM
Read Only Mmemory
EROM
Erasable Read Only Memory
PROM
Programmable Read Only Mmeory
passwd file
stores essential info about user accounts
username, password, user ID, group ID, default shell, home directory, user info
Redirection
directs I/O from/to a file instead of console
Used for logging output or saving command results
Piping
Passes output to one command as input to another
Filters data or combines commands
Hard Link
Direct reference to same inode,
{use ln to make a hard link}
ln /etc/passwd name
Soft Link (symbolic link)
Pointer to original file path, like a shortcut
ln -s /etc/passwd name
Name a Linus File system
EXT4
Extended File system 4
Name a windows file system
NTFS New Technology File System
Info held in file system’s superblock?
total partition size
first data addresses
list of free blocks
file system type
Long-Term Scheduling
Decides which jobs enter the ready queue
Medium-Term Scheduling
Swaps process between memory and disk
Short-term memory
determines which process in the ready queue will execute next
Memory Management Requirements
Relocation: allows program to be moved in memory
Protection:
Sharing:
Logical Organiztion: supports modular programming + data segmentation
Physical Organization: organizes available memory
Page
Logical block of a process
Frame
Physical memory block where pages are loaded
Offset
Position within the page/frame
Objectives of an operating system
Convenience for users
secure data access
Efficient use of computing resources Evolution ie OS should enable development of new systems
Sequential Interrupt
next interrupt is handled after the current one completes
Nested interrupt
higher priority can interrupt lower priority interrupt handling
/etc
contains config files
{passwd, group, hosts, fstab}
/bin
contains binaries
{cp, ls grep cat…}
/sbin
contains binaries for admin
{fdisk, ifconfig}
/home
user home directory
Inode contains?
file type, user ID, group ID, permissions, pointers to data blocks, time of last modification
Internal Fragmentation
Unused space within an allocated memory block
External Fragmentation
Unused blocks scattered between allocated memory
PCB
Process Control Block
stores process info needed for context switching
items in PCB
Process ID, program counter, priority level, process state
swap parition
dedicated disk partition used for virtual memory
Resident set
portion of a process currently loaded in physical memory
Thrashing
Excessive swapping due to insufficient memory
Page fault
process tries to access a page not in memory
modify bit
indicates if a page has been changed since loaded
Resident bit
tracks whether a page is currently in physical memory
purpose of shell UWU
command line interpreter
two sheels: zsh, bash
Dispatcher
gives control of CPU to selected process
Command that kills all processs
sudo kill -9 -1
swap space
disk space reserved to temporarily store data that doesnt fit in RAM
Fetch-Execute Cycle
- PC has address of next instruction
-Address copied to MAR
-Contents at address copied to MBR
-instruction copied into IR
-PC incremented
-instruction decoedd+executed
Advantages of Contiguous Allocation
-allows efficient access to files and storage
- simpler to implement
Disadvantages of Contiguous Allocation
- can suffer from external fragmentation
- can be inflexible when resizing files
Advantages of Chained (linked) Allocation
-flexible in file size
-minimizes external fragmentation
Disadvantages of Chained (linked) Allocation
-sequential access overhead
-increased storage overhead
Advantages of Indexed Allocation
-fast access to files
-supports dynamic growth of files
Disadvantages of indexed allocation
- overhead
- limited file size
primary partition
One of up to four main partitions on a disk.
logical parition
Sub-division within an extended partition.