diff --git a/KConfig.cpp b/KConfig.cpp index 7c58606..88cab3e 100644 --- a/KConfig.cpp +++ b/KConfig.cpp @@ -40,9 +40,15 @@ static struct cag_option ConfigOptions[] = { {.identifier = 'd', .access_letters = "dD", .access_name = "drvdir", - .value_name = "VALUE", + .value_name = "PATH", .description = "Directory to load drivers from"}, + {.identifier = 'i', + .access_letters = "iI", + .access_name = "init", + .value_name = "PATH", + .description = "Path to init program"}, + {.identifier = 'h', .access_letters = "h", .access_name = "help", @@ -57,6 +63,7 @@ KernelConfig ParseConfig(char *Config) struct KernelConfig config = {Memory::MemoryAllocatorType::Pages, 0, {'/', 's', 'y', 's', 't', 'e', 'm', '/', 'd', 'r', 'i', 'v', 'e', 'r', 's', '\0'}, + {'/', 's', 'y', 's', 't', 'e', 'm', '/', 'i', 'n', 'i', 't', '\0'}, 0}; if (Config == NULL) @@ -321,6 +328,13 @@ ParseSuccess: KPrint("\eAAFFAAUsing %s as driver directory", value); break; } + case 'i': + { + value = cag_option_get_value(&context); + strcpy(config.InitPath, value); + KPrint("\eAAFFAAUsing %s as init program", value); + break; + } case 'h': { KPrint("\n---------------------------------------------------------------------------\nUsage: kernel.fsys [OPTION]...\nKernel configuration."); diff --git a/include/kconfig.hpp b/include/kconfig.hpp index 80115f4..560d2f5 100644 --- a/include/kconfig.hpp +++ b/include/kconfig.hpp @@ -9,6 +9,7 @@ struct KernelConfig Memory::MemoryAllocatorType AllocatorType; bool SchedulerType; char DriverDirectory[256]; + char InitPath[256]; int Cores; };