Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
锟斤拷有点烫
cunix
提交
cd1c7061
C
cunix
项目概览
锟斤拷有点烫
/
cunix
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cunix
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cd1c7061
编写于
2月 23, 2021
作者:
R
rain
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0.490s-kernel: load kernel to 0x8200-0x9200
上级
95843608
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
39 addition
and
15 deletion
+39
-15
LINES
LINES
+3
-1
Makefile
Makefile
+3
-0
README.md
README.md
+4
-0
boot/x86/Makefile
boot/x86/Makefile
+4
-9
boot/x86/boot.asm
boot/x86/boot.asm
+2
-2
boot/x86/loader.asm
boot/x86/loader.asm
+2
-3
kernel/Makefile
kernel/Makefile
+14
-0
kernel/kernel.asm
kernel/kernel.asm
+7
-0
未找到文件。
LINES
浏览文件 @
cd1c7061
...
...
@@ -12,5 +12,7 @@
2021-2-15 0.487: 487 lines, 5 files, rain
2021-2-15 0.484: 484 lines, 5 files, rain
2021-2-23 0.484: 484 lines, 5 files, rain
2021-2-23 0.490: 490 lines, 6 files, rain
Makefile
浏览文件 @
cd1c7061
all
:
touch
boot/x86/bootloader.bin
make
-C
boot/x86/
make
-C
kernel/
clear
:
rm
boot/x86/
*
.bin kernel/
*
.bin cunix.img
README.md
浏览文件 @
cd1c7061
...
...
@@ -41,6 +41,10 @@ Cunix kernel
`
0.484s-boot
`:
	let `
readdisk.inc
` smaller, but we just can use CHS or LBA, not both.
`
0.490s-kernel
`
:
	load kernel to 0x8200-0x9200 for 4KB, kernel.asm display 'K' to screen.
</pre>
boot/x86/Makefile
浏览文件 @
cd1c7061
...
...
@@ -2,10 +2,10 @@ ASM_FLAGS = -I ../../include/
remake
:
rm
bootloader.bin
make
cunix.img
make
first
first
:
make
cunix.img
make
bootloader.bin
boot.bin
:
boot.asm
nasm boot.asm
-o
boot.bin
$(ASM_FLAGS)
...
...
@@ -13,13 +13,8 @@ boot.bin: boot.asm
loader.bin
:
loader.asm
nasm loader.asm
-o
loader.bin
$(ASM_FLAGS)
bootloader.bin
:
boot.bin loader.bin
bootloader.bin
:
boot.bin loader.bin
cat
boot.bin loader.bin
>>
bootloader.bin
cunix.img
:
bootloader.bin
dd
if
=
/dev/zero
of
=
cunix.img
bs
=
1024
count
=
1440
dd
if
=
bootloader.bin
of
=
cunix.img
conv
=
notrunc
clear
:
rm
*
.bin
cunix.img
rm
*
.bin
boot/x86/boot.asm
浏览文件 @
cd1c7061
...
...
@@ -77,8 +77,8 @@ load_loader:
call
read_sector
jc
panic
; read
8 sectors
add
cl
,
0x0
2
; read
9 sectors (1 loader, 8 kernel)
add
cl
,
0x0
1
add
bx
,
0x0200
cmp
cl
,
0x0a
...
...
boot/x86/loader.asm
浏览文件 @
cd1c7061
...
...
@@ -175,9 +175,7 @@ init_long_mode:
mov
ss
,
ax
mov
rsp
,
0x0000000000007c00
e:
hlt
jmp
e
jmp
0x8200
message:
db
"
Cunix
is
loading...
"
,
0x0d
,
0x0a
,
0x00
...
...
@@ -220,4 +218,5 @@ code64 equ gdt64_code - gdt64
data64
equ
gdt64_data
-
gdt64
times
512
-
(
$
-
$$
)
db
0x00
kernel/Makefile
0 → 100644
浏览文件 @
cd1c7061
ASM_FLAGS
=
-I
../include
default
:
make ../cunix.img
kernel.bin
:
kernel.asm
nasm kernel.asm
-o
kernel.bin
$(ASM_FLAGS)
../cunix.img
:
kernel.bin
cat
../boot/x86/bootloader.bin kernel.bin
>>
boot.bin
dd
if
=
boot.bin
of
=
../cunix.img
kernel/kernel.asm
0 → 100644
浏览文件 @
cd1c7061
bits
64
_start:
mov
byte
[
0xb8000
],
'K'
hlt
jmp
$
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录