CST 334 Week 7 - Home stretch
1. Topics Covered in Class
·
I/O
devices and system architecture
·
Device
drivers
·
Device
registers and memory-mapped I/O
·
Canonical
I/O protocol
·
Polling
·
Interrupts
·
Direct
Memory Access (DMA)
·
Blocking
vs. non-blocking I/O
·
Hard
disk drive (HDD) structure
·
Disk
access time (seek time, rotational delay, transfer time)
·
Disk
scheduling basics
·
Files
·
Directories
·
Directory
hierarchy and pathnames
·
File
system interface (open, read, write, close)
·
File
descriptors
·
Open
file table
·
File
offsets
·
File
sharing (fork, dup)
·
Inodes
·
File
metadata
·
File
system layout
·
Data
blocks
·
Free
space management
·
Bitmaps
for free space tracking
2.
Explanation of Each Topic
·
I/O
Devices and System Architecture - I/O
devices allow the computer to interact with the outside world, such as disks,
keyboards, and displays. The OS organizes these devices within a layered
architecture so slower devices do not block faster components like the CPU and
memory.
·
Device
Drivers - Device
drivers are software components that act as a bridge between the OS and
hardware devices. They hide hardware-specific details and provide a consistent
interface for the OS.
·
Device
Registers and Memory-Mapped I/O - Devices
expose control and status registers that the OS reads and writes to communicate
with hardware. With memory-mapped I/O, these registers appear as regular memory
addresses.
·
Canonical
I/O Protocol - The
canonical I/O protocol defines a standard way for the OS to communicate with
devices: check status, issue commands, and transfer data. This keeps device
interaction predictable and structured.
·
Polling
- Polling
repeatedly checks a device to see if it is ready. While simple, polling wastes
CPU time and is inefficient for slow devices.
·
Interrupts
- Interrupts allow
devices to notify the CPU when they need attention. This lets the CPU do other
work instead of constantly checking device status.
·
Direct
Memory Access (DMA) - DMA
allows devices to transfer data directly to and from main memory without CPU
involvement. This improves performance and reduces overhead for large data
transfers.
·
Blocking
vs. Non-Blocking I/O - Blocking
I/O causes a process to wait until the operation completes, while non-blocking
I/O allows the process to continue running. This choice affects responsiveness
and program design.
·
Hard
Disk Drive (HDD) Structure - Hard
disks store data on spinning platters divided into tracks and sectors. A moving
disk arm reads and writes data, which affects access speed.
·
Disk
Access Time - Disk
access time includes seek time, rotational delay, and transfer time. Reducing
these delays is key to improving storage performance.
·
Disk
Scheduling Basics - Disk
scheduling determines the order in which disk requests are served. Good
scheduling reduces seek time and improves throughput.
·
Files
- A file is a
persistent, linear sequence of bytes stored on disk. The OS does not interpret
file contents, only stores and retrieves them reliably.
·
Directories
- Directories map
human-readable names to files or other directories. They organize files into a
hierarchical structure.
·
Directory
Hierarchy and Pathnames - The
directory hierarchy starts at the root directory and branches into
subdirectories. Pathnames specify the location of files within this structure.
·
File
System Interface - The
file system interface provides system calls like open, read, write, and close.
These calls abstract away low-level disk operations.
·
File
Descriptors - A
file descriptor is a small integer that represents an open file in a process.
It is used by the OS to track file access.
·
Open
File Table - The
open file table stores information about each open file, including its offset
and access mode. Multiple file descriptors can reference the same table entry.
·
File
Offsets - A file
offset tracks the current position within a file. Each read or write updates
this offset automatically.
·
File
Sharing (fork, dup) - File
sharing allows multiple file descriptors or processes to refer to the same open
file table entry. This enables coordinated access to files.
·
Inodes
- An inode stores
metadata about a file, such as size, permissions, and block pointers. File
names are stored separately in directories.
·
File
Metadata - Metadata
describes file properties rather than contents, including ownership,
timestamps, and access permissions.
·
File
System Layout - The
file system layout divides disk space into regions like the superblock, inode
table, and data blocks. This structure enables efficient file management.
·
Data
Blocks - Data
blocks store the actual contents of files. Inodes point to these blocks to
locate file data on disk.
·
Free
Space Management - The
OS tracks unused disk space so it can allocate blocks to new or growing files.
Efficient tracking improves performance.
·
Bitmaps
for Free Space Tracking - Bitmaps
use bits to represent whether blocks are free or allocated. This allows fast
identification of available disk space.
3.
Identify least-understood topics — of these topics, which was the hardest for
you to write the descriptions?
The
topic I had the most difficulty with this week was persistence-related
calculations, In theory the calculations seemed easy, but on my first try of the
quiz I forgot that everything was supposed to be in milliseconds and not seconds,
so my answers were way off. While I understood the concepts themselves, working
through the numerical calculations took a little more effort than the
conceptual explanations.
4.
Explain the nature of your confusion — for these difficult topics, what pieces
of them make sense and what pieces are difficult to describe?
I
understood how persistent storage works and why disk access time is broken into
different parts, but I had a little trouble applying the formulas consistently
when calculating total access time. Once I worked through examples step by
step, the calculations became clearer.
5.
Identify “aha” moments — which topic did you find it easiest to write about,
and why did it make sense?
My
main “aha” moment came from learning about file descriptors and the open file
table. Understanding that a file descriptor is simply an index that points to
an entry managed by the OS made file operations much clearer. This helped
connect system calls like open, read, and write to what the operating system is
actually tracking internally.
6.
Ask questions — what do you think will come next? Are there any gaps that don’t
seem to be explained yet?
I
am curious about how modern file systems improve performance and reliability
beyond the basic structures we covered. I would like to learn more about
techniques such as journaling, crash recovery, and how file systems handle
failures while maintaining data consistency.
7.
What connections did you see to other classes and applications — have you
used/heard/thought about these topics before?
These
topics connect strongly to experiences in programming and IT-related courses,
especially when working with files, directories, and storage devices. Concepts
like file descriptors and disk access help explain real-world behavior such as
slow file operations or system lag during heavy I/O. This material also
connects directly to application development, since almost every program relies
on file systems and I/O to function correctly.
Comments
Post a Comment