Save another 5 bytes by making the newline character do double duty as
newline and string terminator.
missing_os:
call error
.ascii "Missing operating system.\r\n"
- .byte 0
/*
* read_sector: read a single sector pointed to by %eax to 0x7c00.
too_many_active:
call error
.ascii "Multiple active partitions.\r\n"
- .byte 0
/*
* boot: invoke the actual bootstrap. (%si) points to the partition
disk_error:
call error
.ascii "Operating system load error.\r\n"
- .byte 0
/*
* Print error messages. This is invoked with "call", with the
popw %si
2:
lodsb
- andb %al, %al
- jz 3f
movb $0x0e, %ah
movb (BIOS_page), %bh
movb $0x07, %bl
- int $0x10
- jmp 2b
-3:
+ int $0x10 /* May destroy %bp */
+ cmpb $10, %al /* Newline? */
+ jne 2b
+
int $0x18 /* Boot failure */
die:
hlt