-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot_sect.asm
More file actions
59 lines (37 loc) · 696 Bytes
/
boot_sect.asm
File metadata and controls
59 lines (37 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
; boot sect at address 0x7c00
; in 16 bit real mode
[org 0x7c00]
mov bx, HELLO ; print hello message
call print_string
mov [BOOT], dl
mov bp, 0x8000
mov sp, bp
mov bx, 0x9000
mov dh, 2
mov dl, [BOOT]
call disk_load
mov dx, [0x9000]
call print_string
jmp $
%include "disk_load.asm"
HELLO:
db 'Welcome to my OS', 0
print_string:
pusha
mov ah, 0x0e
loop:
mov al, [bx]
int 0x10
add bx, 1
cmp al, 0
jne loop
popa
ret
; Global variables
BOOT: db 0
; Bootsector padding all zero
times 510-($-$$) db 0
dw 0xaa55
;go beyond 512 byte
;see if the second sector is loaded
times 256 dw '!'