Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added W13D2/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W13D2/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W13D2/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W13D2/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions W13D2/w13d2胡珂雅.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Linux and Unix and Android

这三个架构之间的区别

#### Linux Goals

- Simplicity, elegance, consistency

- Power and flexibility

- Lack of useless redundancy

#### Android – Design Goals

- Open-source platform for mobile devices

- Support 3rd party apps with robust, stable API

- 3rd party apps compete on level playing field

- Users need not deeply trust 3rd party apps

- Support mobile user interaction

- Manage app processes for users

- Encourage apps to interoperate, collaborate

- Full general-purpose OS

<img src="1.jpg" alt="1" style="zoom:50%;" />

<img src="2.jpg" alt="2" style="zoom:50%;" />

<img src="E:\Tencent\WeChat Files\WeChat Files\wxid_ia5hjahervpp11\FileStorage\Temp\1686907384593.jpg" alt="1686907384593" style="zoom:50%;" />

<img src="D:\a_homework_of_c++\2_2_semester\os-2023-notes\W13D2\4.jpg" alt="4" style="zoom:50%;" />

![3](D:\a_homework_of_c++\2_2_semester\os-2023-notes\W13D2\3.jpg)
Binary file added W5D2/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W5D2/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W5D2/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W5D2/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added W5D2/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions W5D2/week5_2_3_16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
### File systems

#### Part 1 Review

- Memory Manager(Review)

- Physical Memory ( no abstract )

- Virtual Memory

- Process : VM_area_struct (linear)

- mmap ( vaddr, __ , __ , file , off , size )

if ( vaddr = 0) anywhere

file = fd(file back ) / file = -1 anonymous

<img src="2.png" alt="2" style="zoom:50%;" />

- phy : Buddy

- File = { a set of Bytes }

- FileSystem = { a set of files }

#### Part 2 Setjmp / Longjmp ( long goto )

```c++
main(){
e = setjump(jx)
swtich (v)...//ai
bar();
}
bar(){
foo();
}
foo(){
if(something erro) long_jump (jx,value)//value tell what happens
}
```

`jx` 栈结构 记录下跳转时 `set jump` 所处的所有状态

| ai | stack in main |
| ---- | ------------- |

<img src="1.png" alt="2" style="zoom:50%;" />

#### Part 3 File System

File Systems = { a set of files }

- Insert / Delete / Searching

Question:

- How do you find information
- How do you keep one user from reading another user's data?
- How do you know which blocks are free?

magic number: D0,CF,11,E3...

**MZ:**DOS MZ executable

该文件可以通过文件开头的ASCII字符串“MZ”(十六进制:4D 5A)来识别(“幻数”)。 “MZ”是Mark Zbikowski 的缩写,Mark Zbikowski是MS-DOS的主要开发者之一。

**ELF :**Executable and Loadable Format

ELF文件由4部分组成,分别是ELF头(ELF header)、程序头表(Program header table)、节(Section)和节头表(Section header table)。

<img src="4.png" alt="2" style="zoom:50%;" />

文件中:section

内存中:segment

<img src="3.png" alt="2" style="zoom:50%;" />

文件和目录都是文件

<img src="5.png" alt="2" style="zoom:50%;" />

mount(挂载):

mount 命令用于将某些设备上的文件系统附加到大文件树,加载文件系统到指定的加载点。相反,umount 命令将再次将其分离。此命令最常用于挂载cdrom,使我们可以访问cdrom中的数据

Binary file added W9D2/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions W9D2/week9_2_4_13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
### I / O

- **Q1: How to drive an I / O (or device)** (Today's topic)
- Q2: How to Read / Write

Challenges for OS

- For reasons... DMA, Interpretation

DMA :全称Direct Memory Access,即直接存储器访问。

- Variety of Devices

Sequence vs Random

#### I / O devices

NFC Field

Field Bus:

- CAN:控制器局域网络(Controller Area Network)
- LONWORKS:Lonworks代表本地运营网络。

USB 本身是个网络

#### Directed Memory Access

同步方式:阻塞式

异步方式:IO 太慢了,通常采用异步,即非阻塞

![1](1.jpg)

低端 DMA:

DMA 发出 `add I/O` 指令,将数据存在自己的 `buffer` 里头,再发出 `add Memory` 指令,将自己 `buffer` 中的数据存入 `Main Memory`,两次总线访问。

高端 DMA:**On fly:**

DMA 发出 `add I/O` 指令,再发出 `add Memory` 指令,直接将数据传入 `Main Memory`,一次总线访问。

#### Interrupts Revisited

要先 `request` 中断线

#### Precise Interrupt

Four properties of a precise interrupt:

- The PC saved in a known place.
- All instructions before that pointed to by PC have fully executed.
- No instruction beyond that pointed to by PC has been executed.
- Execution state of instruction pointed to by PC is known.



task struct $\to$ files $\to$ file struct

- top-half
- bottom-half

DMA:

request irq dma:使用 request_irq () 函数来注册中断服务函数

register block (or char)

H / W(HardWare)

Ref:LDD(Linux Device Driver)



#### Goals of the I/O Software

Issues:

- Device independence
- Uniform naming
- Error handling
- Synchronous versus asynchronous
- Buffering.