Add OS selector to bootloader

This commit is contained in:
Juhani Krekelä 2021-06-30 22:12:07 +03:00
parent 96dcfa48bb
commit 7e41612687
1 changed files with 24 additions and 2 deletions

View File

@ -67,6 +67,28 @@ _start:
; Save bootdrive
mov [drivenumber], dl
select_os:
mov ah, 0xe
mov si, prompt
.print:
lodsb
test al, al
jz .end
int 0x10
jmp .print
.end:
xor ax, ax
int 0x16
cmp al, 'e'
jne calc_constants
mov si, ettinos_kernel_name
mov di, kernel_name
mov cx, 11
rep movsb
calc_constants:
; Disk organization:
; Reserved sectors (MBR)
@ -310,9 +332,9 @@ chs:
pop ax
ret
%include "hexprint.inc"
prompt: db "Select OS. 'e' for EttinOS, any other key Nor86.", 0
kernel_name: db "KERNEL BIN"
ettinos_kernel_name: db "SYSTEM BIN"
times 510-($-$$) db 0
db 0x55, 0xaa