Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: yourtion/30dayMakeOS
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: CodingdAwn/30dayMakeOS
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 6 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 29, 2021

  1. record for day 1

    gaoxifeng committed Oct 29, 2021
    Copy the full SHA
    a35e7b5 View commit details
  2. record for day 1

    gaoxifeng committed Oct 29, 2021
    Copy the full SHA
    b66d90b View commit details
  3. note for day1 and day2

    gaoxifeng committed Oct 29, 2021
    Copy the full SHA
    e84cb38 View commit details
  4. note for day1 and day2

    gaoxifeng committed Oct 29, 2021
    Copy the full SHA
    c561d4c View commit details
  5. some day 3 note

    gaoxifeng committed Oct 29, 2021
    Copy the full SHA
    7e033ad View commit details

Commits on Nov 5, 2021

  1. 提交笔记

    gaoxifeng committed Nov 5, 2021
    Copy the full SHA
    7683a57 View commit details
Showing with 92 additions and 0 deletions.
  1. +18 −0 01_day/readme.md
  2. +49 −0 02_day/readme.md
  3. +25 −0 03_day/readme.md
  4. 0 04_day/readme.md
18 changes: 18 additions & 0 deletions 01_day/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## day 1

### 工具的使用
- asm.bat 执行汇编器 再生成一个img镜像
- run.bat 直接使用qemu虚拟机打开镜像文件

### 知识点
- 关键字使用大写或者小写都可以
- DB: data byte 写入一个字节
- DW: data word 2个字节
- DD: data double-word 4个字节
- ;用于注释
- $是当前已输出的字节数
- RESB: 填0
- boot sector: 启动区 软盘第一个扇区为启动区
512字节为一个扇区 软盘大小为1440KB 故有2880个扇区
启动区最后两个字节固定为 55 AA
- IPL: initial program loader
49 changes: 49 additions & 0 deletions 02_day/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# day 2

## 知识点
- ORG: 指定程序起始位置
- JMP: jump
- entry: 只是标签 label 类似goto
- MOV: 赋值语句 MOV AX,0 即AX = 0, MOV源数据和目的数据位数相同
- ADD: 加法指令
- CMP: 比较指令
- JE: 比较跳转指令, 比较结果相等则跳转 否则继续执行下一条指令 jump if equal
- INT: 中断指令 INT 0x10 bios显卡指令
- BIOS: basic input output system
- HLT: cpu睡眠

### 寄存器:
16位寄存器
- AX -> accumulator 累加
- CX -> counter 计数
- DX -> data 数据
- BX -> base 基址
- SP -> stack pointer 栈指针
- BP -> base pointer 基址指针
- SI -> source index 源变址
- DI -> destination index 目的变址

8位寄存器
- AL,CL,DL,BL,AH,CH,DH,BH 分高低位

32位寄存器
- EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI

段寄存器 16位
- ES -> extra segment 附加段
- CS -> code segment 代码段
- SS -> stack segment 栈段
- DS -> data segment 数据段
- FS,GS

### 其他
[]为指定内存 cpu与内存的存取
- MOV WORD [678], 123 内存678-679 设置为123
- MOV BYTE [BX],123 内存[BX寄存器的值] 设置为123 {BX BP SI DI}可用

对于ORG 0x7c00的解释:
- 0x00007c00 -> 0x00007dff为 启动区内容装载地址
- 内存有部分地址是BIOS的地址

### 疑问
- $符号在ORG下 含义有变化?
25 changes: 25 additions & 0 deletions 03_day/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# day 3

## 知识点
- JC: jump if carry, 如果进位标记carry flag是1的话就跳转
- INT 0x13: 磁盘读写
- FLACS.CF: 进位标志 读写磁盘后进位标志会被设置
FLACS.CF为1位的寄存器
- JNC: jump if not carry 进位标记为0跳转
- JAE: jump if above or equal 如果大于或等于跳转
- JBE: jump if below or equal 如果小于或等于跳转
- JB: jump if below 如果小于就跳转
- EQU: 相当于#define CYLS EQU 10 ; CYLS=10

## 读写磁盘操作
- AH: 0x02读盘 0x03写盘 0x04校验 0x0c寻道
- AL: 扇区数
- CH: 柱面号&0xff
- CL: 扇区号
- DH: 磁头号 软盘有正反面2个磁头
- DL: 驱动器号 如果有多个软盘的话
- ES:BX 缓冲地址 从软盘中读取的数据装载到内存的哪个位置
MOV AL,[ES:BX] 标识ES*16+BX的内存地址 如果ES为0x20那么正好每次移动512个字节 即一个扇区..
如果指定内存的话 都必须同时指定 段寄存器 默认的话为DS: 可以省略
-

Empty file added 04_day/readme.md
Empty file.