vault backup: 2025-05-05 15:05:48
This commit is contained in:
37
.obsidian/workspace.json
vendored
37
.obsidian/workspace.json
vendored
@ -7,30 +7,6 @@
|
|||||||
"id": "1bd3c6c2ca7655f0",
|
"id": "1bd3c6c2ca7655f0",
|
||||||
"type": "tabs",
|
"type": "tabs",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
|
||||||
"id": "46800597ab6eb156",
|
|
||||||
"type": "leaf",
|
|
||||||
"state": {
|
|
||||||
"type": "image",
|
|
||||||
"state": {
|
|
||||||
"file": "Operating Systems/assets/Pasted image 20250505042548.png"
|
|
||||||
},
|
|
||||||
"icon": "lucide-image",
|
|
||||||
"title": "Pasted image 20250505042548"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "33dc0f1ebcbf4c21",
|
|
||||||
"type": "leaf",
|
|
||||||
"state": {
|
|
||||||
"type": "image",
|
|
||||||
"state": {
|
|
||||||
"file": "Operating Systems/assets/Pasted image 20250505042548.png"
|
|
||||||
},
|
|
||||||
"icon": "lucide-image",
|
|
||||||
"title": "Pasted image 20250505042548"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "565b9e04e8704d81",
|
"id": "565b9e04e8704d81",
|
||||||
"type": "leaf",
|
"type": "leaf",
|
||||||
@ -45,8 +21,7 @@
|
|||||||
"title": "File Systems Management"
|
"title": "File Systems Management"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"currentTab": 2
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
@ -225,13 +200,14 @@
|
|||||||
},
|
},
|
||||||
"active": "565b9e04e8704d81",
|
"active": "565b9e04e8704d81",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Operating Systems/Virtual Memory.md",
|
"Operating Systems/assets/Pasted image 20250505144352.png",
|
||||||
|
"Operating Systems/Inter-Process Communication.md",
|
||||||
"Operating Systems/File Systems Management.md",
|
"Operating Systems/File Systems Management.md",
|
||||||
|
"Operating Systems/Memory Management.md",
|
||||||
|
"Operating Systems/assets/Pasted image 20250505042548.png",
|
||||||
|
"Operating Systems/Virtual Memory.md",
|
||||||
"Operating Systems/Scheduling.md",
|
"Operating Systems/Scheduling.md",
|
||||||
"Operating Systems/Processes and Threads.md",
|
"Operating Systems/Processes and Threads.md",
|
||||||
"Operating Systems/Memory Management.md",
|
|
||||||
"Operating Systems/Inter-Process Communication.md",
|
|
||||||
"Operating Systems/assets/Pasted image 20250505042548.png",
|
|
||||||
"Operating Systems/assets/Pasted image 20250505042419.png",
|
"Operating Systems/assets/Pasted image 20250505042419.png",
|
||||||
"Operating Systems/assets/Pasted image 20250204103541.png",
|
"Operating Systems/assets/Pasted image 20250204103541.png",
|
||||||
"Operating Systems/Overview.md",
|
"Operating Systems/Overview.md",
|
||||||
@ -262,7 +238,6 @@
|
|||||||
"Functional Programming/Proofs.md",
|
"Functional Programming/Proofs.md",
|
||||||
"Functional Programming/Recursion.md",
|
"Functional Programming/Recursion.md",
|
||||||
"Functional Programming/Lists.md",
|
"Functional Programming/Lists.md",
|
||||||
"Functional Programming/Eq and Num.md",
|
|
||||||
"Languages & Machines/assets",
|
"Languages & Machines/assets",
|
||||||
"Languages & Machines",
|
"Languages & Machines",
|
||||||
"Extracurricular/Misc/Proposed Routine Plan.canvas",
|
"Extracurricular/Misc/Proposed Routine Plan.canvas",
|
||||||
|
@ -1,7 +1,125 @@
|
|||||||
|
---
|
||||||
|
type: theoretical
|
||||||
|
backlinks:
|
||||||
|
- "[[Memory Management]]"
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
A file system consists of two parts
|
A file system consists of two parts
|
||||||
- Collection of files
|
- Collection of files
|
||||||
- A directory structure -> provides information about all files in the system
|
- A directory structure -> provides information about all files in the system
|
||||||
|
|
||||||
## File
|
## File
|
||||||
- Logical view -> the unit of storing data
|
- Logical view -> the unit of storing data
|
||||||
Files are mapped by the OS onto physical
|
Files are mapped by the OS onto physical nonvolatile devices
|
||||||
|
|
||||||
|
**Types:**
|
||||||
|
- Data
|
||||||
|
- Numeric
|
||||||
|
- Character
|
||||||
|
- Binary
|
||||||
|
- Program
|
||||||
|
|
||||||
|
|
||||||
|
**Attributes**:
|
||||||
|
- Name
|
||||||
|
- Identifier (unique number)
|
||||||
|
- Type[^2]
|
||||||
|
- Location -> pointer
|
||||||
|
- Size
|
||||||
|
- Protection (permissions)
|
||||||
|
- Datetime and user id
|
||||||
|
|
||||||
|
### Logical Definition
|
||||||
|
- Named collection of related information
|
||||||
|
- Files may have free form (text files) or can be rigidly formatted[^1]
|
||||||
|
|
||||||
|
### Operations
|
||||||
|
- Create
|
||||||
|
- Write
|
||||||
|
- Read
|
||||||
|
- Seek (reposition within file)
|
||||||
|
- Delete
|
||||||
|
- Truncate - shorten or cut off by removing data from the end
|
||||||
|
- Open (load to memory)
|
||||||
|
- Close (unload)
|
||||||
|
|
||||||
|
### Open files
|
||||||
|
Tracked by an **open-file table**, counted by **file-open count**.
|
||||||
|
|
||||||
|
In order to [avoid race conditions](Inter-Process%20Communication.md#Avoiding%20race%20conditions), we need to lock the files somehow.
|
||||||
|
- **Shared lock** -> several processes can acquire concurrently, used for reads
|
||||||
|
- **Exclusive lock** -> writer lock
|
||||||
|
- Mandatory vs. advisory -> access is denied depending on locks held and requested vs. processes can find status of locks and decide what to do
|
||||||
|
|
||||||
|
|
||||||
|
### Structure
|
||||||
|
Could be many:
|
||||||
|
- None
|
||||||
|
- Simple record
|
||||||
|
- Lines
|
||||||
|
- Fixed length
|
||||||
|
- Variable length
|
||||||
|
- Complex
|
||||||
|
- Formatted document
|
||||||
|
- Relocatable load file [^3]
|
||||||
|
|
||||||
|
|
||||||
|
## Directories
|
||||||
|
Collection of nodes containing information about all files. Also resides on disk.
|
||||||
|
|
||||||
|
**Operations**:
|
||||||
|
- Search for a file
|
||||||
|
- Create a file
|
||||||
|
- Delete a file
|
||||||
|
- List a directory
|
||||||
|
- Rename a file
|
||||||
|
- Traverse file system
|
||||||
|
|
||||||
|
### Single level directory
|
||||||
|
A single directory for all users.
|
||||||
|
|
||||||
|
Clearly, we need unique names, which can become a problem real fast. That shit is gonna grow super big.
|
||||||
|
|
||||||
|
### Two-level directory
|
||||||
|
Users have different directories. In Linux -> `/home/user` is separate, allowing for the same file names. Linux, however, uses a multi-level:
|
||||||
|
|
||||||
|
### Tree-Structured Directories
|
||||||
|
- Efficient searching
|
||||||
|
- Grouping
|
||||||
|
- Absolute v. relative path
|
||||||
|
|
||||||
|
### Acyclic-Graph
|
||||||
|
Have shared subdirectories and files. Symlinks achieve this.
|
||||||
|
|
||||||
|
## Symlinks
|
||||||
|
**Hard** vs **Soft**. Hard is a literal copy of the file but keep the same inode info, while soft is just a pointer.
|
||||||
|
|
||||||
|
>[!IMPORTANT]
|
||||||
|
>We only allow links to files to avoid cycles Every time a new link is added we also use a cycle detection algorithm to determine whether it is OK
|
||||||
|
## Disk
|
||||||
|
Can be subdivided into **partitions**.
|
||||||
|
|
||||||
|
Disk/partition can be used **raw** (no file system) or can be **formatted**. The entity containing the file system is known as a volume.
|
||||||
|
|
||||||
|
> [!NOTE]- Typical fs organization
|
||||||
|
> 
|
||||||
|
|
||||||
|
|
||||||
|
## Access lists and groups
|
||||||
|
Read, write and execute.
|
||||||
|
Three classes of users on Linux
|
||||||
|
1. Owner -> 7 (Read Write Execute)
|
||||||
|
2. Group -> 6 (RW)
|
||||||
|
3. Public -> 1 (X)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[^1]: **Columnar**, fixed-format ASCII Files have fixed field lengths, as opposed to **delimited**, i.e. fields can be as large as we want them to
|
||||||
|
|
||||||
|
[^2]: Extension (.pdf, .txt) as opposed to format, which specifies the [grammar](Regular%20languages.md) of the file
|
||||||
|
|
||||||
|
[^3]: contains information about where to place different parts of the program in memory.
|
||||||
|
BIN
Operating Systems/assets/Pasted image 20250505144352.png
Normal file
BIN
Operating Systems/assets/Pasted image 20250505144352.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
Reference in New Issue
Block a user