btldr

bootloader written in assembly
Log | Files | Refs | README

commit 00dddf9db3557736f3b27fd9fed861a130ceaa2f
Author: tin <ichtinnotl@gmail.com>
Date:   Sun,  7 Oct 2018 17:21:35 +0200

adds asm and binary DOS/MBR boot sector

Diffstat:
boot.asm | 23+++++++++++++++++++++++
boot.bin | 0
2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/boot.asm b/boot.asm @@ -0,0 +1,22 @@ +bits 16 ; tell NASM this is 16 bit code +org 0x7c00 ; tell NASM to start outputting stuff at offset 0x7c00 + +; If the last two bytes equal 0xAA55 then the BIOS will jump to +; location 0x7C00 effectively transferring control to the bootloader. + +boot: + mov si,hello ; point si register to hello label memory location + mov ah,0x0e ; 0x0e means 'Write Character in TTY mode' +.loop: + lodsb ; load string byte instruction + or al,al ; is al == 0? + jz halt ; if (al == 0) jump to halt label + int 0x10 ; runs BIOS interrupt 0x10 - Video Services + jmp .loop +halt: + cli ; clear interrupt flag + hlt ; halt execution +hello: db "Hello world!", 0 + +times 510 - ($-$$) db 0 ; pad remaining 510 with zeroes +dw 0xaa55 ; magic bootloader magic - marks this 512 byte sector bootable!+ \ No newline at end of file diff --git a/boot.bin b/boot.bin Binary files differ.