-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
160 additions
and
4,306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ HelloOS | |
|
||
# Prerequisites | ||
*.d | ||
.DS_Store | ||
.vscode/ | ||
|
||
# Object files | ||
*.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +0,0 @@ | ||
MAKEFLAGS = --no-print-directory | ||
|
||
SRC := arch/x86/boot kernel mm drivers | ||
|
||
all: clean iso | ||
|
||
iso: build | ||
ld -b elf64-x86-64 -z muldefs -o kernel.elf -Map=./kernel.map -T link.lds $(shell find $(SRC) -name "*.o") | ||
@bash build_iso.sh | ||
|
||
build: $(SRC) | ||
@for s in $(SRC); do \ | ||
make -C $$s build || exit 1; \ | ||
done | ||
|
||
clean: $(SRC) | ||
@for s in $(SRC); do \ | ||
make -C $$s clean || exit 1; \ | ||
done | ||
rm -rf *.elf *.iso *.map | ||
|
||
qemu-run: | ||
qemu-system-x86_64 -m 2G HelloOS.iso | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,2 @@ | ||
# HelloOS | ||
基于 x86_64 指令集的实验性操作系统。 | ||
|
||
## 构建 | ||
目前基于 debian/ubuntu 进行构建: | ||
|
||
1. 安装依赖 | ||
|
||
```bash | ||
$ apt install -y make gcc grub git xorriso | ||
``` | ||
|
||
2. 代码拉取 | ||
|
||
```bash | ||
$ git clone [email protected]:BitInit/HelloOS.git | ||
``` | ||
|
||
3. 构建镜像 | ||
|
||
```bash | ||
$ cd HelloOS | ||
|
||
$ make | ||
``` | ||
|
||
在目录项目主目录下,`HelloOS.iso` 为构建好的镜像文件,`kernel.elf` 为构建好的内核文件。 | ||
|
||
## 进度 | ||
|
||
- [x] grub 启动引导 | ||
|
||
- [x] 基于位图的内存管理 | ||
|
||
- [ ] 内存管理改造成伙伴算法 | ||
|
||
- [ ] 支持 slab | ||
|
||
- [x] 基于 8259A PIC 的中断处理 | ||
|
||
- [ ] 基于 APIC 的中断处理 | ||
|
||
- [x] 基于 8042 的键盘驱动 | ||
|
||
- [x] 基于 `sysenter` 与 `sysexit` 指令的系统调用 | ||
|
||
- [ ] posix 支持 | ||
|
||
- [ ] 进程调度 | ||
|
||
- [ ] 多核处理器支持 | ||
|
||
- [ ] 磁盘驱动 | ||
|
||
- [ ] 支持 FAT32 文件系统 | ||
|
||
- [ ] shell 命令解析器 | ||
|
||
- [ ] 移植 ls/cat/cp 等常用工具 | ||
|
||
- [ ] 支持 risc-v 指令集 | ||
|
||
|
||
## 参考资料 | ||
|
||
* [《x86汇编语言:从实模式到保护模式》](https://book.douban.com/subject/20492528/) | ||
* [《一个64位操作系统的设计与实现》](https://book.douban.com/subject/30222325/) | ||
## HelloOS | ||
以 Linux kernel 2.6.26 源码为模版,实验性从零到一完成一个操作系统 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#define ASM_FILE | ||
#include <asm/multiboot2.h> | ||
|
||
.section .text.head | ||
.global startup | ||
.extern startup_64 | ||
|
||
.code32 | ||
startup: | ||
jmp startup_64 | ||
|
||
.align 8 | ||
multiboot_header: | ||
.long MULTIBOOT2_HEADER_MAGIC /* magic number (multiboot 2) */ | ||
.long MULTIBOOT_ARCHITECTURE_I386 /* architecture 0 (protected mode i386) */ | ||
.long multiboot_header_end - multiboot_header /* header length */ | ||
.long -(MULTIBOOT2_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header)) | ||
|
||
multiboot_header_end: |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.