Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 42120cb

Browse files
authored
Fix
1 parent de73902 commit 42120cb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

kernel/main.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,34 @@
88
#include "mem/vmm.h"
99
#include "ui/system/screen.h"
1010
#include "../user/home/home.cpp"
11+
#include "core/process.h"
12+
#include "core/domain"
13+
14+
15+
u8 simple_program[] = {
16+
0xEB, 0xFE // JMP $
17+
};
1118

1219
void test() {
1320
__home();
21+
u32 fake_entry_addr = 0x400000; // Arbitrary user address
22+
u32 fake_stack_addr = 0x800000; // Arbitrary user stack top
23+
24+
// create some test proc.
25+
Process* test_proc = process_create("test_proc", 0, Domain domain, fake_entry_addr, fake_stack_addr);
26+
if (!test_proc) {
27+
LOG_ERROR("Failed to create test process");
28+
return;
29+
}
30+
31+
// load the test program
32+
if (load_program(test_proc, simple_program, sizeof(simple_program)) != 0) {
33+
LOG_ERROR("Failed to load test program");
34+
return;
35+
}
36+
37+
// for now - simulate the scheduler.. This will be done automatically once i enable the scheduler.
38+
scheduler();
1439
}
1540

1641
extern "C" void _main(u32 magic) {

0 commit comments

Comments
 (0)