Added new kernel param

This commit is contained in:
Alex 2023-03-06 03:33:34 +02:00
parent ac88a1edb7
commit 546efd37d0
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
3 changed files with 18 additions and 3 deletions

View File

@ -74,7 +74,7 @@ namespace Interrupts
{ {
// TODO: This function is called by SMP too. Do not initialize timers that doesn't support multiple cores. // TODO: This function is called by SMP too. Do not initialize timers that doesn't support multiple cores.
apic[Core] = new APIC::APIC(Core); apic[Core] = new APIC::APIC(Core);
if (Core == 0) // Redirect IRQs to the BSP if (Core == Config.IOAPICInterruptCore) // Redirect IRQs to the specified core.
((APIC::APIC *)apic[Core])->RedirectIRQs(Core); ((APIC::APIC *)apic[Core])->RedirectIRQs(Core);
} }
else else

View File

@ -36,6 +36,12 @@ static struct cag_option ConfigOptions[] = {
.value_name = "VALUE", .value_name = "VALUE",
.description = "Number of cores to use (0 = all; 1 is the first code, not 0)"}, .description = "Number of cores to use (0 = all; 1 is the first code, not 0)"},
{.identifier = 'p',
.access_letters = "pP",
.access_name = "ioapicirq",
.value_name = "VALUE",
.description = "Which core will be used for I/O APIC interrupts"},
{.identifier = 't', {.identifier = 't',
.access_letters = "tT", .access_letters = "tT",
.access_name = "tasking", .access_name = "tasking",
@ -77,11 +83,12 @@ KernelConfig ParseConfig(char *Config)
int argc = 0; int argc = 0;
char **argv = nullptr; char **argv = nullptr;
struct KernelConfig config = {Memory::MemoryAllocatorType::Pages, struct KernelConfig config = {Memory::MemoryAllocatorType::XallocV1,
0, 0,
{'/', 's', 'y', 's', 't', 'e', 'm', '/', 'd', 'r', 'i', 'v', 'e', 'r', 's', '\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'}, {'/', 's', 'y', 's', 't', 'e', 'm', '/', 'i', 'n', 'i', 't', '\0'},
false, true,
0,
0, 0,
false}; false};
@ -320,6 +327,13 @@ ParseSuccess:
config.Cores = atoi(value); config.Cores = atoi(value);
break; break;
} }
case 'p':
{
value = cag_option_get_value(&context);
KPrint("\eAAFFAARedirecting I/O APIC interrupts to %s%s", atoi(value) ? "core " : "", atoi(value) ? value : "BSP");
config.IOAPICInterruptCore = atoi(value);
break;
}
case 't': case 't':
{ {
value = cag_option_get_value(&context); value = cag_option_get_value(&context);

View File

@ -12,6 +12,7 @@ struct KernelConfig
char InitPath[256]; char InitPath[256];
bool InterruptsOnCrash; bool InterruptsOnCrash;
int Cores; int Cores;
int IOAPICInterruptCore;
bool UnlockDeadLock; bool UnlockDeadLock;
}; };