-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot.asm
More file actions
21 lines (16 loc) · 753 Bytes
/
boot.asm
File metadata and controls
21 lines (16 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[org 0x7c00] ; Set origin to 0x7C00 (where BIOS loads the bootloader)
mov ah, 0x0e ; BIOS teletype output function
mov bx, hello_msg ; Memory address of our string
print_string:
mov al, [bx] ; Load the character at the address in BX into AL
cmp al, 0 ; Check if it's the null terminator
je end ; If it is, we're done printing
int 0x10 ; Otherwise, call BIOS interrupt to print the character
inc bx ; Move to the next character
jmp print_string
end:
jmp $ ; Infinite loop to hang the system
hello_msg db 'Welcome to your Custom OS!', 0
; Bootloader signature
times 510-($-$$) db 0 ; Pad the rest of the 512 bytes with zeros
dw 0xaa55 ; The standard PC boot signature