Week 6 Flashcards

1
Q

Process Abstraction

A

Heavyweight Process:

Each process has a separate virtual address space.
Loads compiled code dynamically from disk.
The OS initializes each process in a new address space.
Lightweight Process (Thread):

Shares the same address space as its parent process.
Suitable for processes that require concurrent execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Program Segments and Memory Regions

A

Text Segment:

Lowest memory region; stores compiled code and constants.
Data Segment:

Follows the text segment; holds initialized global variables.
BSS Segment:

After data segment; holds uninitialized globals, which are set to zero at runtime.
Stack:

Stores activation records for function calls, including local variables.
Heap:

Allocates memory dynamically, persisting beyond specific functions. Processes must explicitly release memory to prevent leaks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Shared Pages and Libraries

A

Instruction Space Sharing (I-space):

Shared instruction pages reduce redundant loading across processes.
Issues arise if a shared page is removed while other processes still use it, leading to page faults.
Shared Libraries:

Shared by processes to avoid multiple copies, linked at runtime.
The linker includes only necessary functions, allowing processes to access common libraries without duplicating code in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Backing Store (Swap Space)

A

Swap Space:
A dedicated partition on disk optimized for paging operations.
Organized as a list of free storage chunks, enabling processes to swap in and out of memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Xinu Memory Management Functions

A

Memory Initialization:

meminit initializes a free list at system start, scanning memory to build the list.
Stack Management:

getstk: Allocates stack space for process creation (found in system/create.c).
freestk: Releases stack space when a process terminates (in system/kill.c).
Heap Management:

getmem: Allocates heap memory by scanning the free list for a block and, if necessary, splitting larger blocks (system/getmem.c).
freemem: Releases heap memory, adding it back to the free list or merging it with adjacent blocks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Low-Level Memory Implementation in Xinu

A

Free Block List:
All free memory blocks are maintained in a linked list.
Blocks are ordered by address, and new allocations scan this list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Long-Term Storage

A

Challenges: Limited RAM, loss of information on process termination, and the need for multi-process access make long-term storage essential.

Solutions: Magnetic disks and SSDs offer persistent storage, organized through the file abstraction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

File System Abstraction

A

Files: Logical units created by processes to manage persistent data.

Operations: Reading, writing, creating, and managing files.
Managed by the OS through the file system.

File Naming:
Names include characters and extensions (e.g., .txt or .exe) to denote types.
Directory paths help locate files (e.g., /usr/local/bin).

File Structure:
Files are byte-based, but structured differently depending on file type and intended program.

File Access:
Files are accessed by bytes; read and seek operations are key for retrieving and navigating data.
The file pointer tracks the current read/write position in the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

File Attributes and Operations

A

Attributes:
Include permissions, size, time stamps, and metadata like file type or protection flags (e.g., read-only or system file).

Operations:
Create/Delete: Reserve and release disk space.
Open/Close: Prepare files for access and release resources afterward.
Read/Write/Append: Access or modify file data.
Seek: Repositions the file pointer for random access.
Rename: Changes a file’s name without duplication.
Linking/Unlinking: Create/remove file references in directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Directory Structures

A

Single-Level Directory:

All files exist in a single directory, making it simple but difficult for large systems.
Hierarchical Directory:

A tree-like structure suitable for organizing numerous files and subdirectories.
Paths can be absolute (from root, e.g., /home/user/docs) or relative (from the current directory).
Special Directory Entries:

. (current directory), .. (parent directory), and ~ (home directory).
Directory Operations:

Create/Delete: Initializes a directory or removes an empty one.
Open/Read/Close: Open and read entries, close when done.
Link/Unlink: Adds/removes a hard link to a file in a directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

File System Implementation

A

Master Boot Record (MBR):

Located in sector 0, containing partition tables and the initial boot loader.
File System Layout:

Superblock: Contains filesystem parameters.
Free Space Management: Bitmaps or pointer lists track available blocks.
I-nodes: Store file metadata and disk addresses.
Root Directory: The top of the filesystem hierarchy.
UEFI and GUID Partition Table:

UEFI uses GUIDs for partition management, with a backup at the last block.
ESP (EFI System Partition) supports boot processes using a filesystem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

File Allocation Methods

A

Contiguous Allocation:

Simple and efficient for reading but can lead to fragmentation.
Linked-List Allocation:

Files are linked list blocks, avoiding fragmentation but impacting random access speed.
File Allocation Table (FAT):

Moves pointers to memory for faster access but increases memory usage as disk grows.
I-nodes:

Each file has an i-node, linking to its attributes and disk location. Only active files load i-nodes into memory, allowing a cap on open files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Directory Implementation

A

Directory Entries:
Option 1: Fixed-size entries containing file name, attributes, and disk location.
Option 2: Entries link to i-nodes containing attributes, offering a more efficient design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly