Add OS selector to bootloader
This commit is contained in:
parent
96dcfa48bb
commit
7e41612687
26
bootsect.asm
26
bootsect.asm
|
@ -67,6 +67,28 @@ _start:
|
||||||
; Save bootdrive
|
; Save bootdrive
|
||||||
mov [drivenumber], dl
|
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:
|
calc_constants:
|
||||||
; Disk organization:
|
; Disk organization:
|
||||||
; Reserved sectors (MBR)
|
; Reserved sectors (MBR)
|
||||||
|
@ -310,9 +332,9 @@ chs:
|
||||||
pop ax
|
pop ax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%include "hexprint.inc"
|
prompt: db "Select OS. 'e' for EttinOS, any other key Nor86.", 0
|
||||||
|
|
||||||
kernel_name: db "KERNEL BIN"
|
kernel_name: db "KERNEL BIN"
|
||||||
|
ettinos_kernel_name: db "SYSTEM BIN"
|
||||||
|
|
||||||
times 510-($-$$) db 0
|
times 510-($-$$) db 0
|
||||||
db 0x55, 0xaa
|
db 0x55, 0xaa
|
||||||
|
|
Loading…
Reference in New Issue