Added --init arg

This commit is contained in:
Alex 2022-11-02 17:13:35 +02:00
parent 7e7e89342d
commit efea5e7aaf
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 16 additions and 1 deletions

View File

@ -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.");

View File

@ -9,6 +9,7 @@ struct KernelConfig
Memory::MemoryAllocatorType AllocatorType;
bool SchedulerType;
char DriverDirectory[256];
char InitPath[256];
int Cores;
};