Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heng30/toy-os
玩具内核(学习项目)
https://github.com/heng30/toy-os
assembly c kernel toy-os
Last synced: about 1 month ago
JSON representation
玩具内核(学习项目)
- Host: GitHub
- URL: https://github.com/heng30/toy-os
- Owner: heng30
- Created: 2024-12-02T04:49:17.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-20T14:23:51.000Z (about 1 month ago)
- Last Synced: 2024-12-20T15:21:56.080Z (about 1 month ago)
- Topics: assembly, c, kernel, toy-os
- Language: C
- Homepage:
- Size: 1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![0.png](./screenshot/0.png)
这是一个根据[Linux操作系统-构建自己的内核](https://www.bilibili.com/video/BV1VJ41157wq?spm_id_from=333.788.videopod.episodes&vd_source=da23da82658adda9cbdfd045a9e6daf7)课程的学习项目。
### 实现的功能
- 运行在保护模式下
- 处理鼠标和键盘输入
- 简单的定时器
- 简单的内存管理
- 简单的图层管理,保证图层及时刷新
- 简单的任务调度
- 一个输入框,可以输入和删除字符### 如何使用该项目?
- 编译启动镜像:`make`
- 启动`virtualbox`,创建一个虚拟机,虚拟机以软盘启动。软盘加载`build/disk.img`作为启动镜像.![1.png](./screenshot/1.png)
![1.png](./screenshot/2.png)
### 构建工具
- gcc: `gcc (GCC) 13.3.0`
- objconv: `Object file converter version 2.54 for x86 and x86-64 platforms`
- nasm: `NASM version 2.16.03 compiled on Apr 17 2024`### 注意事项
- 整个结构体赋值会出问题,导致整个程序异常退出。应该是objconv反汇编出问题。
```
struct Foo {
int a;
int b;
}Foo a = { .a = 0, .b = 0 };
Foo b = a; // 此处会出问题,可能导致内核在刚启动就异常退出,而不是代码运行到此处
```### 参考
- [Linux操作系统-构建自己的内核](https://www.bilibili.com/video/BV1VJ41157wq?spm_id_from=333.788.videopod.episodes&vd_source=da23da82658adda9cbdfd045a9e6daf7)
- [课程代码github](https://github.com/wycl16514)
- [重点课程:从实模式进入保护模式](https://www.bilibili.com/video/BV1VJ41157wq?spm_id_from=333.788.player.switch&vd_source=da23da82658adda9cbdfd045a9e6daf7&p=5)