mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Added --init arg
This commit is contained in:
parent
7e7e89342d
commit
efea5e7aaf
16
KConfig.cpp
16
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.");
|
||||
|
@ -9,6 +9,7 @@ struct KernelConfig
|
||||
Memory::MemoryAllocatorType AllocatorType;
|
||||
bool SchedulerType;
|
||||
char DriverDirectory[256];
|
||||
char InitPath[256];
|
||||
int Cores;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user