X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=kern%2Fsrc%2Fboot.asm;fp=kern%2Fsrc%2Fboot.asm;h=5be618b007a57f605d1095f24bd8b647d8bd45f7;hb=5145ed1e2adefc9c66e20681532a3a7cd6c2de01;hp=96506de177878426b08c7da880baebfe4cde1719;hpb=426ed1c5006c82261fee2eea3feafe3282b2b862;p=eightysix diff --git a/kern/src/boot.asm b/kern/src/boot.asm index 96506de..5be618b 100644 --- a/kern/src/boot.asm +++ b/kern/src/boot.asm @@ -3,8 +3,8 @@ bits 16 section .bootsect -extern _stage2_start_seg -extern _stage2_size +extern _kern_start_seg +extern _kern_size boot_driveno equ 7b00h num_read_tries equ 7b06h ; 2 bytes @@ -57,7 +57,7 @@ bios_param_block: db 0 ; 25h: winnt flags db 28h ; 26h: signature(?) dd 0 ; 27h: volume serial number - db "80 SIX BOOT"; 2bh: volume label, 11 bytes + db "86BOOT "; 2bh: volume label, 11 bytes db "FAT12 " ; 36h: filesystem id, 8 bytes start: @@ -65,12 +65,10 @@ start: xor ax, ax mov ds, ax mov es, ax + mov ss, ax jmp 00:.setcs .setcs: - ; put the stack high - mov ax, 0x7f00 - mov ss, ax - xor sp, sp + mov sp, 0x7b00 ; temp stack below our vars mov [boot_driveno], dl ; query sectors per track @@ -92,13 +90,13 @@ start: .querydone: ; load the rest of the code high - mov ax, _stage2_size + mov ax, _kern_size add ax, 511 mov cl, 9 shr ax, cl inc ax mov [sect_pending], ax - mov ax, _stage2_start_seg + mov ax, _kern_start_seg mov es, ax ; destination segment mov word [destptr], 0 mov word [start_sect], 1 ; start from sector 1 to skip boot sector @@ -173,7 +171,7 @@ start: jnz .rdloop ; loaded sucessfully, load segment registers and jump -.done: mov ax, _stage2_start_seg +.done: mov ax, _kern_start_seg mov ds, ax mov es, ax push ax @@ -248,7 +246,7 @@ print_hex_digit: str_rdtrack2 db " from ",0 str_rdtrack3 db "/",0 -str_load_fail db "Failed to load 2nd stage!",0 +str_load_fail db "Failed to load kernel!",0 str_newline db 13,10,0 times 510-($-$$) db 0