mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-19 09:35:15 -04:00
Finalize the new bootloader
This commit is contained in:
parent
9a0e4318b1
commit
84c869f8fa
@ -14,7 +14,7 @@ jmp rm_start
|
||||
; Start in real mode
|
||||
rm_start:
|
||||
; Set stack space (4K) and stack segment
|
||||
mov ax, 0x7C0
|
||||
mov ax, 0x9C0
|
||||
add ax, 288
|
||||
mov ss, ax
|
||||
mov sp, 4096
|
||||
|
@ -35,11 +35,13 @@ second_step:
|
||||
|
||||
mov ax, KERNEL_BASE
|
||||
mov es, ax
|
||||
xor bx, bx
|
||||
|
||||
xor si, si
|
||||
xor di, di
|
||||
xchg bx, bx
|
||||
|
||||
.next:
|
||||
xor bx, bx
|
||||
|
||||
; Read one sector
|
||||
mov ah, 0x2 ; Read sectors from memory
|
||||
mov al, 1 ; Number of sectors to read
|
||||
@ -51,14 +53,17 @@ second_step:
|
||||
|
||||
jc read_failed
|
||||
|
||||
test ah, ah
|
||||
jne read_failed
|
||||
|
||||
cmp al, 1
|
||||
jne read_failed
|
||||
|
||||
mov si, star
|
||||
call print_16
|
||||
|
||||
inc si
|
||||
cmp si, sectors
|
||||
inc di
|
||||
cmp di, sectors
|
||||
jne .continue
|
||||
|
||||
mov si, kernel_loaded
|
||||
@ -97,7 +102,6 @@ second_step:
|
||||
mov ax, es
|
||||
add ax, 0x20 ; 0x20:0x0 = 512 (sector size)
|
||||
mov es, ax
|
||||
xor bx, bx
|
||||
|
||||
jmp .next
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user