summaryrefslogtreecommitdiff
path: root/src/kernel/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/core')
-rw-r--r--src/kernel/core/kmain.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/kernel/core/kmain.cpp b/src/kernel/core/kmain.cpp
index 58a3c48..96c4050 100644
--- a/src/kernel/core/kmain.cpp
+++ b/src/kernel/core/kmain.cpp
@@ -80,7 +80,25 @@ extern "C" void kmain(multiboot_info_t* mbd, int32_t magic) {
char* cmd = (char*)mods[i].string;
*ke_vt << " * " << cmd << " \t";
if (elf_check((uint8_t*)mods[i].mod_start) == 0) {
- process *pr = elf_exec((uint8_t*)mods[i].mod_start, PL_USER);
+
+ char *args[16] = { cmd, 0 };
+ int a = 1;
+ for (char* c = cmd; c != 0; c++) {
+ if (*c == ' ') {
+ *c = 0;
+ args[a] = c + 1;
+ a++;
+ if (a == 15) {
+ args[a] = 0;
+ break;
+ }
+ } else if (*c == 0) {
+ args[a] = 0;
+ break;
+ }
+ }
+
+ process *pr = elf_exec((uint8_t*)mods[i].mod_start, PL_USER, args); // todo add args
if (pr == 0) {
*ke_vt << "Error loading\n";
} else {