注意:这篇文章上次更新于1085天前,文章内容可能已经过时。
This article was last updated1085 days ago, the content may be outdated.
硬件和程序员的约定
CPU Reset 后寄存器会有确定的初始状态
- EIP = 0x0000fff0
- CR0 = 0x60000010
- 处理器处于 16-bit 模式
- EFLAGS = 0x00000002
- interrupt disabled
Reset 后处理器从固定地址(Reset Vector)启动
- MIPS: 0xbfc000000
- Specification 规定
- ARM: 0x00000000
- Specification 规定
- 允许配置 Reset Vector Base Address Register
- RISC-V: Implementation defined
- 给厂商最大程度的自由
Demo: firmware
1 | mbr.img: mbr.S |
1 |
|
1 | # Kill process (QEMU) on gdb exits |
实现最小的操作系统
1 | NAME := hello |
1 |
|
1 | #include <am.h> |


