add simple boot loader example
This commit is contained in:
21
bootloader1/boot.asm
Normal file
21
bootloader1/boot.asm
Normal file
@@ -0,0 +1,21 @@
|
||||
; boot.asm - prints 'A' and halts
|
||||
BITS 16 ; 16-bit real mode
|
||||
ORG 0x7C00 ; boot sector load address
|
||||
|
||||
start:
|
||||
mov ah, 0x0E ; teletype output BIOS function
|
||||
mov al, 'A' ; character to print
|
||||
mov bh, 0x00 ; page number 0
|
||||
mov bl, 0x07 ; text attribute (light grey on black)
|
||||
int 0x10 ; BIOS video interrupt
|
||||
|
||||
cli ; disable interrupts
|
||||
hang:
|
||||
hlt ; halt CPU
|
||||
jmp hang ; infinite loop
|
||||
|
||||
; fill the rest of the sector with zeros
|
||||
times 510-($-$$) db 0
|
||||
|
||||
; boot signature (2 bytes)
|
||||
dw 0xAA55
|
||||
Reference in New Issue
Block a user