mirror of
https://github.com/memtest86plus/memtest86plus
synced 2025-03-23 06:13:28 +03:00
Fix console kernel parameters parsed too late at boot (#66). Reorder global init to start tty after config parsed. Allow a wider options for console argument (ie: console - console=ttySx - console=ttySx,115200
This commit is contained in:
parent
c56fbe3257
commit
722b1b2899
19
app/config.c
19
app/config.c
@ -110,23 +110,30 @@ int tty_update_period = 2; // Update TTY every 2 seconds (default)
|
||||
|
||||
static void parse_serial_params(const char *params)
|
||||
{
|
||||
enable_tty = true;
|
||||
|
||||
// No parameters passed (only "console"), use default
|
||||
if (params == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// No TTY port passed, use default ttyS0
|
||||
if (strncmp(params, "ttyS", 5) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Configure TTY port or use default
|
||||
if (params[4] >= '0' && params[4] <= '3') {
|
||||
tty_params_port = params[4] - '0';
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
enable_tty = true;
|
||||
|
||||
if (params[5] != ',' && params[5] != ' ') {
|
||||
// No Baud Rate specified, use default
|
||||
if (params[5] != ',' || params[6] == '\0') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[6] >= '0' && params[6] <= '9') {
|
||||
switch (params[6])
|
||||
{
|
||||
default:
|
||||
@ -156,7 +163,7 @@ static void parse_serial_params(const char *params)
|
||||
tty_update_period = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void parse_option(const char *option, const char *params)
|
||||
@ -181,9 +188,7 @@ static void parse_option(const char *option, const char *params)
|
||||
power_save = POWER_SAVE_HIGH;
|
||||
}
|
||||
} else if (strncmp(option, "console", 8) == 0) {
|
||||
if (params != NULL) {
|
||||
parse_serial_params(params);
|
||||
}
|
||||
} else if (strncmp(option, "nobench", 8) == 0) {
|
||||
enable_bench = false;
|
||||
} else if (strncmp(option, "noehci", 7) == 0) {
|
||||
|
@ -217,14 +217,14 @@ static void global_init(void)
|
||||
|
||||
membw_init();
|
||||
|
||||
tty_init();
|
||||
|
||||
smbios_init();
|
||||
|
||||
badram_init();
|
||||
|
||||
config_init();
|
||||
|
||||
tty_init();
|
||||
|
||||
smp_init(smp_enabled);
|
||||
|
||||
// At this point we have started reserving physical pages in the memory
|
||||
|
Loading…
x
Reference in New Issue
Block a user