-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvga-01.txt
More file actions
330 lines (289 loc) · 10.2 KB
/
Copy pathvga-01.txt
File metadata and controls
330 lines (289 loc) · 10.2 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
c[?7l[2J[0mSeaBIOS (version 1.16.3-debian-1.16.3-2)
iPXE (https://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+06FC6F60+06F06F60 CA00
Press Ctrl-B to configure iPXE (PCI 00:03.0)...
Booting from Hard Disk...
Boot failed: could not read the boot disk
Booting from Floppy...
Boot failed: could not read the boot disk
Booting from DVD/CD...
[0;30;47mWelcome to GRUB!
[01;01H[0m[2J Booting `MakhOS v0.0.1 - Phase 1'[01;35H
[MakhOS] Serial port initialized
__ ___ __ _____ ____ _____
/ |/ /______/ // / _ / __ \/ ___/
/ /|_/ / __/ __/ _ / __ / / / /__
/_/ /_/_/ \__/_//_/_/ |_/_/ /_/___/
MakhOS v0.0.2 - Phase 2 Complete Complete
[OK] Long mode active (64-bit)
[OK] CPU initialized
[OK] VGA driver initialized
[OK] Multiboot2 info structure received
[CHECK] Initializing Physical Memory Manager...
[PMM] Initialized - Total: 127 MB, Pages: 32736
[OK] PMM initialized, running tests...
Test 1: Allocating 2 pages...
Page 1: 0x400000
Page 2: 0x401000
Test 2: Freeing page 1...
Memory Statistics:
Total pages: 32736
Used pages: 928
Free memory: 124 MB
[CHECK] Initializing Virtual Memory Manager...
[VMM] Starting initialization...
[VMM] Boot PML4 at: 0x1000
[VMM] Kernel PML4 cleared
[VMM] Copying boot page table mappings...
[VMM] Boot mappings copied
[VMM] Extending identity mapping to 16MB...
[VMM] Identity mapping extended to 16MB
[VMM] Recursive mapping set (PML4[511])
[VMM] Switching to kernel PML4 at: 0x13F000
[VMM] CR3 loaded successfully
[VMM] Initialized with 4-level paging
[TEST] Testing Virtual Memory Manager...
Allocated virtual page at: 0xFFFF800000000000
Wrote 0xDEADBEEF to virtual address
Physical address: 0x400000
[OK] Virtual != Physical (paging works)
Value at physical address: 0x0xDEADBEEF
[OK] Physical memory contains correct value
Mapped fixed virt 0xFFFF800000100000 -> phys 0x405000
[OK] Fixed mapping works
[TEST] VMM tests complete
[CHECK] Initializing Kernel Heap...
[KHEAP] Initializing kernel heap...
[KHEAP] Heap initialized at 0x0xFFFF900000000000 size=16384 bytes
[TEST] Testing Kernel Heap...
Test 1: Basic allocation...
Allocated string: Hello Heap!
[OK] Basic allocation works
Test 2: Multiple allocations...
[OK] Multiple allocations work
Test 3: Variable sizes and alignment...
Test 4: kcalloc (zeroed memory)...
[OK] kcalloc returns zeroed memory
Test 5: krealloc...
[OK] krealloc preserves data
Test 6: Heap statistics...
Total heap: 16384 bytes
Used: 0 bytes
Free: 16340 bytes
Test 7: stdlib malloc/free macros...
[OK] stdlib macros work
[TEST] Kernel heap tests complete
[CHECK] Initializing Interrupt Descriptor Table...
[IDT] Initializing Interrupt Descriptor Table...
[IDT] Loaded 32 exception gates + 16 IRQ gates
[TSS] Initializing Task State Segment...
[TSS] Initialized at 0x0x1410A0, size 104 bytes
[TSS] Kernel stack set to 0x0xFFFF90000000801C
[TSS] IST1 set to 0x0xFFFF90000000201C
[GDT] Initializing Global Descriptor Table...
[GDT] Loaded successfully
[0] NULL descriptor
[1] Kernel Code (ring 0) selector=0x08
[2] Kernel Data (ring 0) selector=0x10
[3] User Code (ring 3) selector=0x1B (0x18|RPL3)
[4] User Data (ring 3) selector=0x23 (0x20|RPL3)
[5,6] TSS 128-bit descriptor at selector=0x28
[GDT] Segment registers reloaded
[GDT] TSS loaded at 0x0x1410A0 (128-bit descriptor)
[TEST] Testing GDT and TSS...
Current CS: 0x0x8 (should be 0x08)
[OK] CS is kernel code segment
Current DS: 0x0x10 (should be 0x10)
[OK] DS is kernel data segment
Task Register: 0x0x28 (should be 0x28)
[OK] TSS loaded in TR
[TEST] Testing Timer Interrupts...
[CHECK] Initializing Programmable Interrupt Controller...
[PIC] Initializing 8259A...
[PIC] Remapped to vectors 0x20-0x2F
[CHECK] Initializing Timer...
[TIMER] Initializing PIT with 100 Hz...
[PIC] Unmasked IRQ 0
[TIMER] Initialized at 100 Hz (divisor: 11931)
[CHECK] Initializing system calls...
[SYSCALL] Initializing system call interface...
[SYSCALL] Registered 11 system calls (including wait/waitpid)
[SYSCALL] syscall/iretq enabled
[CHECK] Enabling interrupts...
[IDT] Interrupts enabled
Waiting for 2 seconds...
[OK] Timer counted 200 ticks in 2 seconds (expected ~200)
[TIMER] Statistics:
Total ticks: 210
Uptime: 2.110 seconds
Frequency: 100 Hz
[PROC] Initializing process manager...
[PROC] Idle process created (PID 0)
[PROC] Init process created (PID 1)
[PROC] Process manager initialized
========================================
MAKHOS v0.0.3 COMPREHENSIVE TEST SUITE
========================================
=== TEST 1: Process Table Stress ===
[PROC] Creating new process...
[PROC] Process created with PID 2
[PROC] Creating new process...
[PROC] Process created with PID 3
[PROC] Creating new process...
[PROC] Process created with PID 4
[PROC] Creating new process...
[PROC] Process created with PID 5
[PROC] Creating new process...
[PROC] Process created with PID 6
[PROC] Creating new process...
[PROC] Process created with PID 7
[PROC] Creating new process...
[PROC] Process created with PID 8
[PROC] Creating new process...
[PROC] Process created with PID 9
[PROC] Creating new process...
[PROC] Process created with PID 10
[PROC] Creating new process...
[PROC] Process created with PID 11
[PROC] Creating new process...
[PROC] Process created with PID 12
[PROC] Creating new process...
[PROC] Process created with PID 13
[PROC] Creating new process...
[PROC] Process created with PID 14
[PROC] Creating new process...
[PROC] Process created with PID 15
[PROC] Creating new process...
[PROC] Process created with PID 16
[PROC] Creating new process...
[PROC] Process created with PID 17
[PROC] Creating new process...
[PROC] Process created with PID 18
[PROC] Creating new process...
[PROC] Process created with PID 19
[PROC] Creating new process...
[PROC] Process created with PID 20
[PROC] Creating new process...
[PROC] Process created with PID 21
Created 20 processes
[PASS] Process table stress test
=== TEST 2: Fork Bomb with Memory ===
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 22
[PARENT] Forked child PID 22
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 23
[PARENT] Forked child PID 23
[PASS] Fork bomb with memory isolation
=== TEST 3: Process Tree ===
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 24
[PARENT] Child relationship valid
[PASS] Process tree relationships
=== TEST 4: Scheduler State Validation ===
[PROC] Creating new process...
[PROC] Process created with PID 25
[PASS] Scheduler state always consistent
=== TEST 5: Idle Process Guarantee ===
[PASS] Idle process always available
=== TEST 6: Multiple Forks ===
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 26
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 27
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 28
[PASS] Multiple forks executed
=== TEST 7: Process Find by PID ===
[PASS] Process lookup works correctly
=== TEST 8: Process Exit ===
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 29
[WARN] Child state or exit code mismatch
[PASS] Process exit handling works
=== TEST 9: Parent-Child Relationships ===
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 30
[OK] Child relationships verified
[PASS] Parent-child relationships valid
=== TEST 10: Full System Integration ===
=== TEST 1: Process Table Stress ===
[PROC] Creating new process...
[PROC] Process created with PID 31
[PROC] Creating new process...
[PROC] Process created with PID 32
[PROC] Creating new process...
[PROC] Process created with PID 33
[PROC] Creating new process...
[PROC] Process created with PID 34
[PROC] Creating new process...
[PROC] Process created with PID 35
[PROC] Creating new process...
[PROC] Process created with PID 36
[PROC] Creating new process...
[PROC] Process created with PID 37
[PROC] Creating new process...
[PROC] Process created with PID 38
[PROC] Creating new process...
[PROC] Process created with PID 39
[PROC] Creating new process...
[PROC] Process created with PID 40
[PROC] Creating new process...
[PROC] Process created with PID 41
[PROC] Creating new process...
[PROC] Process created with PID 42
[PROC] Creating new process...
[PROC] Process created with PID 43
[PROC] Creating new process...
[PROC] Process created with PID 44
[PROC] Creating new process...
[PROC] Process created with PID 45
[PROC] Creating new process...
[PROC] Process created with PID 46
[PROC] Creating new process...
[PROC] Process created with PID 47
[PROC] Creating new process...
[PROC] Process created with PID 48
[PROC] Creating new process...
[PROC] Process created with PID 49
[PROC] Creating new process...
[PROC] Process created with PID 50
Created 20 processes
[PASS] Process table stress test
=== TEST 4: Scheduler State Validation ===
[PROC] Creating new process...
[PROC] Process created with PID 51
[PASS] Scheduler state always consistent
=== TEST 5: Idle Process Guarantee ===
[PASS] Idle process always available
=== TEST 7: Process Find by PID ===
[PASS] Process lookup works correctly
=== TEST 2: Fork Bomb with Memory ===
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 52
[PARENT] Forked child PID 52
[FORK] Forking process PID 0
[FORK] WARNING: parent RSP outside kernel stack, using stack top
[FORK] Created child PID 53
[PARENT] Forked child PID 53
[PASS] Fork bomb with memory isolation
*** ALL TESTS PASSED - SYSTEM STABLE ***
========================================
ALL TESTS COMPLETED SUCCESSFULLY
========================================
[IDT] Interrupts enabled
====================================
MakhOS v0.0.2 - Phase 2 Complete [OK]
====================================
[MAIN] System fully functional.
Type anything - it will appear on screen.
Press Ctrl+Alt+G to exit QEMU.
MakhOS>