-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot.asm
More file actions
59 lines (55 loc) · 1.99 KB
/
Copy pathboot.asm
File metadata and controls
59 lines (55 loc) · 1.99 KB
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
59
global start:
section .text
bits 32 ;grub loads the kernel in 32 bit mode by default
start:
; Clear screen or set up pointer to VGA text buffer
mov edi, 0xb8000
; "Hello World This is my first bootable kernel!!!"
mov word [edi + 0], 0x0248 ; 'H'
mov word [edi + 2], 0x0265 ; 'e'
mov word [edi + 4], 0x026c ; 'l'
mov word [edi + 6], 0x026c ; 'l'
mov word [edi + 8], 0x026f ; 'o'
mov word [edi + 10], 0x0220 ; ' '
mov word [edi + 12], 0x0257 ; 'W'
mov word [edi + 14], 0x026f ; 'o'
mov word [edi + 16], 0x0272 ; 'r'
mov word [edi + 18], 0x026c ; 'l'
mov word [edi + 20], 0x0264 ; 'd'
mov word [edi + 22], 0x0220 ; ' '
mov word [edi + 24], 0x0254 ; 'T'
mov word [edi + 26], 0x0268 ; 'h'
mov word [edi + 28], 0x0269 ; 'i'
mov word [edi + 30], 0x0273 ; 's'
mov word [edi + 32], 0x0220 ; ' '
mov word [edi + 34], 0x0269 ; 'i'
mov word [edi + 36], 0x0273 ; 's'
mov word [edi + 38], 0x0220 ; ' '
mov word [edi + 40], 0x026d ; 'm'
mov word [edi + 42], 0x0279 ; 'y'
mov word [edi + 44], 0x0220 ; ' '
mov word [edi + 46], 0x0266 ; 'f'
mov word [edi + 48], 0x0269 ; 'i'
mov word [edi + 50], 0x0272 ; 'r'
mov word [edi + 52], 0x0273 ; 's'
mov word [edi + 54], 0x0274 ; 't'
mov word [edi + 56], 0x0220 ; ' '
mov word [edi + 58], 0x0262 ; 'b'
mov word [edi + 60], 0x026f ; 'o'
mov word [edi + 62], 0x026f ; 'o'
mov word [edi + 64], 0x0274 ; 't'
mov word [edi + 66], 0x0261 ; 'a'
mov word [edi + 68], 0x0262 ; 'b'
mov word [edi + 70], 0x026c ; 'l'
mov word [edi + 72], 0x0265 ; 'e'
mov word [edi + 74], 0x0220 ; ' '
mov word [edi + 76], 0x026b ; 'k'
mov word [edi + 78], 0x0265 ; 'e'
mov word [edi + 80], 0x0272 ; 'r'
mov word [edi + 82], 0x026e ; 'n'
mov word [edi + 84], 0x0265 ; 'e'
mov word [edi + 86], 0x026c ; 'l'
mov word [edi + 88], 0x0221 ; '!'
mov word [edi + 90], 0x0221 ; '!'
mov word [edi + 92], 0x0221 ; '!'
hlt ;halt cpu