Compare commits

...

2 Commits

Author SHA1 Message Date
Juhani Krekelä 3f4c6c0559 Make output code work also on the original IBM PC 2021-06-30 23:22:09 +03:00
Juhani Krekelä 7e41612687 Add OS selector to bootloader 2021-06-30 22:56:42 +03:00
1 changed files with 25 additions and 2 deletions

View File

@ -67,6 +67,29 @@ _start:
; Save bootdrive
mov [drivenumber], dl
select_os:
mov si, prompt
.print:
lodsb
test al, al
jz .end
; On the original IBM PC BIOS the int 0x10 will clobber this
mov ah, 0xe
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 +333,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