提交 5b2bcf08 编写于 作者: R rain

0.451s-boot: load 4KB of loader, not 512B

上级 c272bda3
......@@ -6,3 +6,5 @@
2021-2-15 0.432: 432 lines, 4 files, rain
2021-2-15 0.451: 451 lines, 4 files, rain
......@@ -19,4 +19,6 @@ Cunix kernel
`0.432s-boot`:
make directory `include/`, and add segment.inc, but it doesn't work. :-)
`0.451s-boot`:
`boot` can load 8 sectors (4KB) of loader (not 1 sector).
......@@ -71,21 +71,40 @@ load_loader:
mov cl, 0x02
mov bx, 0x8000
.read_loop:
call read_sector_chs
mov di, diskpanic_message
jc .try_lba
; read 8 sectors
add cl, 0x02
add bx, 0x0200
cmp cl, 0x0a
je .ret
jmp .read_loop
.ret:
ret
.try_lba:
mov cl, 0x02
mov bx, 0x8000
call read_sector_lba
jc panic
ret
add cl, 0x02
add bx, 0x0200
cmp cl, 0x0a
je .ret
jmp .read_loop
read_sector_chs:
mov ax, 0x0201
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册