Skip to content

Commit

Permalink
note update
Browse files Browse the repository at this point in the history
os
  • Loading branch information
xy-241 committed Dec 20, 2023
1 parent 9d4b8f4 commit 8ceb63c
Show file tree
Hide file tree
Showing 28 changed files with 181 additions and 224 deletions.
6 changes: 3 additions & 3 deletions content/DSA/Data Structure/Array/Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Author Profile:
tags:
- dsa
Creation Date: 2023-10-08T20:10:00
Last Date: 2023-12-12T10:24:35+08:00
Last Date: 2023-12-20T16:19:21+08:00
References:
---
## Abstract
Expand Down Expand Up @@ -34,8 +34,8 @@ References:
>- However, it is Θ(1), Theta(1) to insert/delete
>[!info] Performance comparison with [[Linked List]] when going through all elements
>- Array is much faster if there is [[Cache]], otherwise it will be slightly slower (Because Array has to calculate the address of the next element, while [[Linked List]] is already calculated)
>- Array faster with [[Cache]] is because it is stored in a [[Data Structure#Continuous Memory]] manner, and can take advantage of [[Cache Locality (Locality of Reference)]]
>- Array is much faster if there is [[CPU Cache]], otherwise it will be slightly slower (Because Array has to calculate the address of the next element, while [[Linked List]] is already calculated)
>- Array faster with CPU Cache is because it is stored in a [[Data Structure#Continuous Memory]] manner, and can take advantage of [[CPU Cache#Cache Locality]]

## Properties
Expand Down
28 changes: 8 additions & 20 deletions content/DSA/Data Structure/Stack/Stack (FILO).md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ Author Profile:
tags:
- dsa
Creation Date: 2023-10-07T16:38:28+08:00
Last Date: 2023-10-07T16:38:28+08:00
References:
Last Date: 2023-12-20T16:24:30+08:00
References:
---
## Basics
## Abstract
---
>[!abstract] Basic Properties
>![[stack.png]]
>- [[Linear Data Structure]]
>- Aka [[Array]]/[[Linked List]] with limitations
![[stack.png]]
- [[Linear Data Structure]]
- Aka [[Array]]/[[Linked List]] with limitations


>[!caution] Stack is more about the having the push(), pop() & peek() in O(1) on a particular data structure
Expand Down Expand Up @@ -47,9 +46,9 @@ References:
>- Both support without much difference
>[!note] Time Efficiency
>- [[Array]] has [[Cache Locality]] to take advantage of [[Cache]] for extreme fast access. But [[Array]] has fixed size, if there isn't any space, that particular insertion operation will be O(n)
>- [[Array]] has [[Cache Locality]] to take advantage of [[CPU Cache]] for extreme fast access. But Array has fixed size, if there isn't any space, that particular insertion operation will be O(n)
>- [[Linked List]] has to use extra time to perform pointer operation
>- Conclusion: [[Array]] has slightly better time efficiency, since expansion is a low frequency operation, while pointer operation occurs whenever there is an insertion operation. However, [[Linked List]] has more stable performance
>- Conclusion: Array has slightly better time efficiency, since expansion is a low frequency operation, while pointer operation occurs whenever there is an insertion operation. However, [[Linked List]] has more stable performance
>[!note] Space Efficiency
>- [[Array]] get a pre-defined [[Main Memory]] size, and each expansion is usually double the original size which may exceed the actual demand
Expand All @@ -63,14 +62,3 @@ References:
>[!success] O(1) to pop()
>[!success] O(1) to peek()

## Side Notes
---
>[!success]
>[!success]
>[!success]
>[!success]
11 changes: 6 additions & 5 deletions content/Networking/Application Layer/DNS/Features/DNS Caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Author Profile:
tags:
- networking
Creation Date: 2023-07-23T18:40:57+08:00
Last Date: 2023-07-23T18:40:57+08:00
References:
Last Date: 2023-12-20T16:23:17+08:00
References:
---
>[!note]
>- [[Cache]] [[DNS]] mappings in the [[Main Memory]]
>- This allows us to bypass some or all the servers in [[DNS Servers]]
## Abstract
---
- Cache [[DNS]] mappings in the [[Main Memory]]
- This allows us to bypass some or all the servers in [[DNS Servers]]
18 changes: 13 additions & 5 deletions content/OS/MISC/Booting/BIOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ Author Profile:
tags:
- OS
Creation Date: 2023-07-15T16:58:57+08:00
Last Date: 2023-07-15T16:58:57+08:00
References:
Last Date: 2023-12-20T15:28:16+08:00
References:
---
> [!note]
> - Contains low-level IO software
> - Nowadays, stored in [[Flash RAM]] - nonvolatile & can be updated
## Abstract
---
- Contains low-level IO software
- Nowadays, stored in **Flash RAM** - nonvolatile & can be updated

## BIOS in Booting
---
1. Checks [[Main Memory]] capacity
2. Check [[IO Device]]
3. Scanning [[IO Bus#PCI Bus]] etc to detect all devices attached
4. Determine the **Boot Device** by trying out a list of devices stored in the **CMOS**
30 changes: 30 additions & 0 deletions content/OS/MISC/Booting/Boot Device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
Author:
- Xinyang YU
Author Profile:
- https://linkedin.com/in/xinyang-yu
tags:
- OS
Creation Date: 2023-12-20, 15:30
Last Date: 2023-12-20T15:33:38+08:00
References:
---
## Abstract
---
- Physical or logical storage device that contains [[#Master Boot Record]]

## Boot Device in Booting
---
1. [[#Master Boot Record]] is read into [[Main Memory]]
2. [[#Secondary Boot Loader]] started

## Terminologies
---
### Master Boot Record
- Contains [[#Primary Boot Loader]]
### Primary Boot Loader
- Initiate the process of loading the [[OS]] into the computer's [[Main Memory]]
- Examines the **partition table** at the end of **boot sector** to determine which **partition** is active. Providing a menu for user to select which OS to boot

### Secondary Boot Loader
- Loading the [[Kernel]] and initialising the [[OS]] environment from **active partition** and start it
23 changes: 7 additions & 16 deletions content/OS/MISC/Booting/Booting Computer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@ Author Profile:
tags:
- OS
Creation Date: 2023-07-15T17:02:04+08:00
Last Date: 2023-12-14T19:32:16+08:00
Last Date: 2023-12-20T15:37:43+08:00
References:
---
>[!note]
>Booting sequence
>1. [[BIOS]] started
> 1. Checks [[Main Memory]] capacity
> 2. Check [[IO Device]]
> 1. Scanning [[Peripheral Component Interconnect Express (PCIe) bus]] etc to detect all devices attached
> 3. Determine the [[Boot Device]] by trying out a list of devies stored in the [[CMOS]]
>2. Boot Device started
> 1. [[First sector from the boot device]] is read into memory & executed
>3. [[Secondary Boot loader]] started
>4. [[OS]] started
> 1. Get configuration info from BIOS
> 2. Check missing [[Device Controller#Device Driver]]
> 3. [[Initialize table]]
> 4. Starts up a login program/GUI
## Abstract
---
A 3-steps process
1. [[BIOS#BIOS in Booting]]
2. [[Boot Device#Boot Device in Booting]]
3. [[OS#OS in Booting]]
12 changes: 0 additions & 12 deletions content/OS/MISC/Booting/First sector from the boot device.md

This file was deleted.

12 changes: 0 additions & 12 deletions content/OS/MISC/Booting/Secondary Boot loader.md

This file was deleted.

12 changes: 0 additions & 12 deletions content/OS/Main Components/IO/Busy Waiting.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ Author Profile:
- https://linkedin.com/in/xinyang-yu
tags:
- OS
Creation Date: 2023-07-14T20:53:45+08:00
Last Date: 2023-12-18T17:25:17+08:00
Creation Date: 2023-10-29T20:13:44
Last Date: 2023-12-20T15:46:50+08:00
References:
---
## Abstract
---
* Controlled by [[Device Controller]]
* Examples are like keyboard and monitor


* A small embedded computers that are programmed to tell [[IO Device]] what to do
* Communicates with [[OS]] over [[#Device Driver]]

## Terminologies
---
### Device Driver
- A piece of software that allows [[OS]] to talk to the [[Device Controller]] over a standardised interface
### IO Device Register
- Used to control [[IO Device]]
- Act as *interfaces* between the [[CPU]] and external devices such as hard drives, keyboards, printers, and more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ Author Profile:
tags:
- OS
Creation Date: 2023-08-27T14:44:16+08:00
Last Date: 2023-12-18T17:26:53+08:00
Last Date: 2023-12-20T15:43:57+08:00
References:
---
* Chip that control the flow of bits between [[Main Memory]] and some [[Device Controller]] without constant [[CPU]] intervention
## Abstract
---
* Chip that control the flow of bits between [[Main Memory]] and some [[Device Controller]] without constant [[CPU]] intervention, solves [[#Busy Waiting]]



## Terminologies
---
### Busy Waiting
* Has a big disadvantage of involving [[CPU]] keep polling until [[Device Controller]] retrieves data from [[IO Device]]
19 changes: 0 additions & 19 deletions content/OS/Main Components/IO/Hardware/Device Controller.md

This file was deleted.

This file was deleted.

15 changes: 13 additions & 2 deletions content/OS/Main Components/IO/IO Bus.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ Author Profile:
tags:
- OS
Creation Date: 2023-07-14T21:06:58+08:00
Last Date: 2023-12-18T17:31:36+08:00
Last Date: 2023-12-20T15:48:07+08:00
References:
---
## Abstract
---
- A *communication pathway* within a computer system that facilitates the exchange of *data* between the [[CPU]], [[Main Memory]], and [[IO Device]]
- [[#Common Bus]]


## IO Bus Architecture
---
Expand All @@ -20,4 +22,13 @@ References:
### Parallel Bus Architecture
* Send each [[Computer Data Representation#Word]] of data over multiple wires
### Serial Bus Architecture
- Send all [[Computer Data Representation#Bit]] in a single connection/lane
- Send all [[Computer Data Representation#Bit]] in a single connection/lane


## Common Bus
---
### PCI Bus
- Uses [[#Serial Bus Architecture]]
### USA

### SATA
25 changes: 25 additions & 0 deletions content/OS/Main Components/IO/IO Device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
Author:
- Xinyang YU
Author Profile:
- https://linkedin.com/in/xinyang-yu
tags:
- OS
Creation Date: 2023-07-14T20:53:45+08:00
Last Date: 2023-12-20T15:44:46+08:00
References:
---
## Abstract
---
* Controlled by [[Device Controller]]
* Examples are like keyboard and monitor



## Terminologies
---
### Plug and Play
- [[OS]] automatically collect information about the [[IO Device]]
- Centrally assign **interrupt level** & **IO Addresses**
- Tell each IO device what its numbers are
- Works closely with [[Booting Computer]]
16 changes: 0 additions & 16 deletions content/OS/Main Components/IO/Plug and play.md

This file was deleted.

Loading

0 comments on commit 8ceb63c

Please sign in to comment.