Finalize the new bootloader

This commit is contained in:
Baptiste Wicht 2013-11-24 16:13:07 +01:00
parent 9a0e4318b1
commit 84c869f8fa
2 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -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