-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootloader_kernel.asm
More file actions
129 lines (106 loc) · 2.64 KB
/
Copy pathbootloader_kernel.asm
File metadata and controls
129 lines (106 loc) · 2.64 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
; Combined Aurora Bootloader + Kernel
; Simple all-in-one approach for testing
org 0x7C00
bits 16
start:
; Set video mode to 80x25 text
mov ax, 3
int 0x10
; Clear screen with Aurora colors
mov ax, 0x0600 ; AH=06 (scroll), AL=00 (clear)
mov bh, 0x1F ; Blue background, white foreground
mov cx, 0x0000 ; From (0,0)
mov dx, 0x184F ; To (24,79)
int 0x10
; Position cursor at top-left
mov ah, 0x02 ; Set cursor position
mov bh, 0 ; Page number
mov dh, 0 ; Row
mov dl, 0 ; Column
int 0x10
; Print Aurora banner
mov si, banner
call print_string
; Wait a moment
mov cx, 0xFFFF
.delay:
nop
loop .delay
; Clear screen for kernel
mov ax, 0x0600
mov bh, 0x1F
mov cx, 0x0000
mov dx, 0x184F
int 0x10
; Print kernel running message
mov si, kernel_msg
call print_string
; Simple kernel shell-like interface
mov si, prompt
call print_string
.kernel_loop:
; Wait for key press
mov ah, 0x00
int 0x16
; Echo character
mov ah, 0x0E
int 0x10
; Handle commands
cmp al, 'q'
je .reboot
cmp al, 'p'
je .print_stats
cmp al, 's'
je .shell_demo
; Continue loop
jmp .kernel_loop
.reboot:
int 0x19
.print_stats:
mov si, stats_msg
call print_string
jmp .kernel_loop
.shell_demo:
mov si, shell_msg
call print_string
mov si, prompt
call print_string
jmp .kernel_loop
print_string:
pusha
.print_loop:
lodsb
cmp al, 0
je .done
mov ah, 0x0E
mov bh, 0
int 0x10
jmp .print_loop
.done:
popa
ret
banner:
db "🌠 Aurora OS v0.2.0", 0x0D, 0x0A
db "=================", 0x0D, 0x0A, 0x0A
db "Transitioning to kernel mode...", 0x0D, 0x0A, 0x0A, 0
kernel_msg:
db "Kernel: Ready", 0x0D, 0x0A
db "RAM: Basic", 0x0D, 0x0A
db "VGA: Text Mode", 0x0D, 0x0A
db "Shell: Aurora Built-in", 0x0D, 0x0A, 0x0A
db "Commands: [p]rint stats, [s]hell demo, [q]uit", 0x0D, 0x0A, 0x0A, 0
prompt:
db "aurora> ", 0
stats_msg:
db 0x0D, 0x0A, "System Statistics:", 0x0D, 0x0A
db "• Kernel: Aurora v0.2.0", 0x0D, 0x0A
db "• Platform: x86 Real Mode", 0x0D, 0x0A
db "• Memory: Basic Management", 0x0D, 0x0A
db "• Interface: Text Console", 0x0D, 0x0A, 0
shell_msg:
db 0x0D, 0x0A, "[Shell demo activated]", 0x0D, 0x0A
db "Welcome to Aurora OS! This is a simple shell interface.", 0x0D, 0x0A
db "Try typing commands like 'help', 'version', or press 'q' to quit.", 0x0D, 0x0A, 0
; Boot sector signature
times 510 - ($ - $$) db 0
dw 0xAA55