-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlowlevel_init.s
More file actions
102 lines (82 loc) · 1.7 KB
/
Copy pathlowlevel_init.s
File metadata and controls
102 lines (82 loc) · 1.7 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#the first code be calling from boot.s
VIDEO_PALLETE_PORT = 0x03c8
BG_INDEX_COLOR = 0
COLOR_SELECTION_PORT = 0x03c9
color:
.byte 0x00,0x00,0x00 #black
.byte 0xff,0x00,0x00
.byte 0x00,0xff,0x00
.byte 0xff,0xff,0x00
.byte 0x00,0x00,0xff
.byte 0xff,0x00,0xff
.byte 0x00,0xff,0xff
.byte 0xff,0xff,0xff
.byte 0xc6,0xc6,0xc6
.byte 0x84,0x00,0x00
.byte 0x00,0x84,0x00
.byte 0x84,0x84,0x00
.byte 0x00,0x00,0x84
.byte 0x84,0x00,0x84
.byte 0x00,0x84,0x84
.byte 0x00,0x84,0x84
.byte 0x84,0x84,0x84
.code16
.global lowlevel_init
.global io_hlt
set_bg_color:
movw $VIDEO_PALLETE_PORT, %dx
movb $BG_INDEX_COLOR, %al
outb %al, %dx
movw $COLOR_SELECTION_PORT, %dx
movb $0, %al
outb %al, %dx
movb $0, %al
outb %al, %dx
movb $18, %al
outb %al, %dx
ret
io_hlt:
hlt
ret
clear_screen:
movb $0x6, %ah
movb $0, %al
movb $0, %ch
movb $0, %cl
movb $24, %dh
movb $79, %dl
movb $0x07, %bh
int $0x10
ret
lowlevel_init:
call clear_screen
#setting video mode
mov $0x6a,%al
mov $0x00,%ah
int $0x10
call set_bg_color
movb $0x0, %bh
movw $300, %dx
movw $0, %cx
movb $0x0c, %ah
movb $9, %al
1:
int $0x10
incw %cx
cmpw $200, %cx
jne 1b
jmp fin
############################################
movw $0xa000,%ax
movw %ax, %es
movw $-1, %bx
2:
incw %bx
movw $0x3234,%es:(%bx)
cmpw $0xFFFF, %bx
jb 2b
#entry
# jmp main
fin:
hlt
jmp fin