MINIX-by-Clint-Morse-Joe-Paetz-Theresa-Sullivan-&-Angela

Download Report

Transcript MINIX-by-Clint-Morse-Joe-Paetz-Theresa-Sullivan-&-Angela

MINIX
Presented by:
Clinton Morse, Joseph Paetz,
Theresa Sullivan, and Angela Volk
MINIX Presentation Summary
•
•
•
•
•
•
Overview
MINIX Trivia
Processes
Input/Output
Memory Management
File Systems
MINIX Overview
• “MINIX is a free UNIX clone that is available
with all the source code. Due to its small size,
microkernel-based design, and ample
documentation, it is well suited to people who
want to run a UNIX-like system on their personal
computer and learn about how such systems work
inside. It is quite feasible for a person unfamiliar
with operating system internals to understand
nearly the entire system with a few months of use
and study. “
MINIX Overview (cont.)
• “MINIX has been written from scratch, and
therefore does not contain any AT&T code-not in the kernel, the compiler, the utilities,
or the libraries. For this reason the complete
source can be made available (by FTP or via
the WWW).“
MINIX Trivia
• Written by Andrew S. Tanenbaum in 1987
• Modeled after UNIX version 7
• 12,649 lines of code, with over 3,000
comments
• Written in C
Processes
• Overview
– Processes fall into four different “layers”
•
•
•
•
Process management
I/O tasks
Server Processes
User Processes
Processes (cont.)
• Internal Structure of a process
• Process Control Block:
– No data structure specifically called the
“process control block”
– The process control block is an entry in the
process table
Processes (cont.)
• Process Management
– Occurs in layer 1.
– All processes are stored in a tree with the init
process at the root
Processes (cont.)
• Inter-process Communication
– Is handled by the kernel
– A process sends a destination and a message to
the kernel, which then copies the message to
destination process
– A process must be waiting for the message in
order to recieve
Processes (cont.)
• Process Scheduling
– Hybrid round-robin/priority scheduler
– The system sets a time quantum for every
process
– There are three priority settings for every
process
Input/Output
Overview:
• Interrupt Handlers
• Device Drivers
• Device-Independent Software
• User-Level Software
• Deadlock Handling
User Processes
I/O
Request
Device-independent
software
Device drivers
Interrupt handlers
Hardware
I/O Reply
Input/Output (cont.)
• Interrupt Handlers:
– Eventually handled by coding stored in
mpx88.s
– Saves contents in the registers of the current
process
– Creates a message and calls the interrupt
process
– After checking for the ability to send the
message, the message is sent to the accepting
device
Input/Output (cont.)
• Device Drivers:
Processes
File System
Device Driver
User Process
Input/Output (cont.)
• Device-Independent Software:
–
–
–
–
–
–
–
Uniform interfacing for the device drivers
Device naming
Device protection
Providing a device-independent block size
Buffering
Storage allocation on block devices
Error Reporting
Input/Output (cont.)
• User-Level Software:
–
–
–
–
Library procedures present
Ability to make system calls
Ability for conversions/formatting of text
No spooling/daemons present in the system
Input/Output (cont.)
• Deadlock Handling:
– No dedicated I/O devices
– Deadlocks occur only with implicitly shared
resources
– Deadlock is ignored
Memory Management
• Structure
– Records holes
– First Fit
• Reasoning
– Structured for a personal computer
– Able to port with other systems
• Memory Layout
– Not located in Kernel
• Message Handling
– Messaging system used to communicate between
memory manager and kernel
File System
• Responsible for mapping logical file onto physical
drive
– Allocates space
– Manages free space
– Provides file protection
• Self contained C program
• Can be stored on any block device (floppy, hard
drive, etc.)
• Can be used as a network file server
File System (Cont.)
• Accepts 29 different messages
• How it works
–
–
–
–
Loops, waiting for a message
Uses message type to index procedure in a table
Runs procedure
Returns a value indicating failure or success
File System (Cont.)
• The components (always present)
–
–
–
–
–
–
Boot block
Super-block
I-node bit map
Zone bit map
I-node
Block
File System (Cont.)
Super
block
Zone
bit map
Block
…
Boot
block
I-node
bit map
I-nodes
Data
File System (Cont.)
• Block
– Manageable pieces of a file that may or may
not be contiguous
– Standard size is 1K
– Synonymous with zone when both are the same
size (standard is 1K for block and zone)
File System (Cont.)
• I-node
– Each I-node is associated with a single file
– Contains information about the file, such as
owner, file size, and date modified
– Stores the first 7 disk block numbers
– Stores pointers to other blocks if there are more
than 7
– With 1K blocks and 16-bit addresses, can store
up to 64M
File System (Cont.)
• I-node (cont.)
– Read into I-node table when a file is opened
• Only one I-node in the table, no matter how many
instances of the file are open
• A counter in the table is used to keep track of how
many instances of the file are opened
• Modifications are written to disk when the counter
reaches 0
File System (Cont.)
• Boot block
– Very first thing in file system
– Read into memory when the computer is first
booted
– Present even if the device is not bootable
File System (Cont.)
• Super-block
– Describes the layout and structure of the file
system (number of I-nodes, max. file size, etc.)
– On boot or mount, read into the super-block
table
• Stores information not in the super-block, such as
originating device
File System (Cont.)
• I-node / zone bit map
– Read into memory on boot or mount
– When a file is deleted, pointer array is used to
find I-node in bit map, and bit is set to 1
– When a file is created, searches through bit map
to find a free I-node
– If no free I-nodes, a value of 0 is returned (Inode 0 is never used)
File System (Cont.)
• Directory structure
– Root directory
– Paths are looked up one directory at a time
• Protection
– Read, write, and execute bits
– Owner, owner’s group, and others
MINIX: Conclusion
• Multi-user, multi-tasking, single threaded
• Ignores deadlock
• 3 levels of I/O: interrupt handling, device
drivers, device-independent software
• Memory managed in a sorted list of holes
• 6 parts of file system: boot block, superblock, I-node bit map, zone bit map, Inodes, blocks