1+ ;***********************************************************
2+ ; マクロ
3+ ;***********************************************************
4+ %include "../include/define.s"
5+ %include "../include/macro.s"
6+
7+ ORG KERNEL_LOAD
8+
9+ [BITS 32]
10+ ;***********************************************************
11+ ; エントリポイント
12+ ;***********************************************************
13+ kernel:
14+ ;------------------------------------------
15+ ; フォントアドレスを取得
16+ ;------------------------------------------
17+ mov esi , BOOT_LOAD + SECT_SIZE
18+ movzx eax , word [ esi + 0 ]
19+ movzx ebx , word [ esi + 2 ]
20+ shl eax , 4
21+ add eax , ebx
22+ mov [ FONT_ADR ], eax
23+
24+ ;------------------------------------------
25+ ; フォントの一覧表示
26+ ;------------------------------------------
27+ cdecl draw_font , 63 , 13
28+ cdecl draw_color_bar , 63 , 4
29+
30+ ;------------------------------------------
31+ ; 文字列を描画
32+ ;------------------------------------------
33+ cdecl draw_str , 25 , 14 , 0x010F , .s0
34+
35+ ;------------------------------------------
36+ ; 線を描画
37+ ;------------------------------------------
38+ cdecl draw_line , 100 , 100 , 0 , 0 , 0x0F
39+ cdecl draw_line , 100 , 100 , 200 , 0 , 0x0F
40+ cdecl draw_line , 100 , 100 , 200 , 200 , 0x0F
41+ cdecl draw_line , 100 , 100 , 0 , 200 , 0x0F
42+
43+ cdecl draw_line , 100 , 100 , 50 , 0 , 0x02
44+ cdecl draw_line , 100 , 100 , 150 , 0 , 0x03
45+ cdecl draw_line , 100 , 100 , 150 , 200 , 0x04
46+ cdecl draw_line , 100 , 100 , 50 , 200 , 0x05
47+
48+ cdecl draw_line , 100 , 100 , 0 , 50 , 0x02
49+ cdecl draw_line , 100 , 100 , 200 , 50 , 0x03
50+ cdecl draw_line , 100 , 100 , 200 , 150 , 0x04
51+ cdecl draw_line , 100 , 100 , 0 , 150 , 0x05
52+
53+ cdecl draw_line , 100 , 100 , 100 , 0 , 0x0F
54+ cdecl draw_line , 100 , 100 , 200 , 100 , 0x0F
55+ cdecl draw_line , 100 , 100 , 100 , 200 , 0x0F
56+ cdecl draw_line , 100 , 100 , 0 , 100 , 0x0F
57+
58+ ;------------------------------------------
59+ ; 処理の終了
60+ ;------------------------------------------
61+ jmp $
62+
63+ .s0: db " Hello, kernel! " , 0
64+
65+ ALIGN 4 , db 0
66+ FONT_ADR: dd 0
67+
68+ ;***********************************************************
69+ ; モジュール
70+ ;***********************************************************
71+ %include "../modules/protect/vga.s"
72+ %include "../modules/protect/draw_char.s"
73+ %include "../modules/protect/draw_font.s"
74+ %include "../modules/protect/draw_str.s"
75+ %include "../modules/protect/draw_color_bar.s"
76+ %include "../modules/protect/draw_pixel.s"
77+ %include "../modules/protect/draw_line.s"
78+
79+ ;***********************************************************
80+ ; パディング
81+ ;***********************************************************
82+ times KERNEL_SIZE - ($ - $$) db 0
0 commit comments