diff options
Diffstat (limited to 'boot/arch/amd64/mbr/mbr.S')
| -rw-r--r-- | boot/arch/amd64/mbr/mbr.S | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/boot/arch/amd64/mbr/mbr.S b/boot/arch/amd64/mbr/mbr.S index fa33707..a548ce7 100644 --- a/boot/arch/amd64/mbr/mbr.S +++ b/boot/arch/amd64/mbr/mbr.S @@ -35,11 +35,43 @@ reloc: /* Set our stack */ mov $0x7C00, %sp + /* Write out our boot string */ + mov $boot_msg, %si + call putstr + cli hlt jmp reloc +/* + * Write a string to the console + * + * %si: String to write + * + * XXX: Clobbers %AL + */ +putstr: + lodsb + or %al, %al + jz 1f + call putchr + jmp putstr +1: ret + +/* + * Write a single character to the console + * + * %al: Character to write + */ +putchr: + push %dx + mov $0x3F8, %dx + out %al, %dx + pop %dx + ret + drive_num: .byte 0x00 +boot_msg: .ascii "booting\0" .org 510 .byte 0x55 |
