usb hubs, hotplug support, unplug support, saving log files to disk, smt
This commit is contained in:
1 parent
b838f8d83d
commit
27b31f62b6
39 files changed
+6294
-735
No files matched your search
+25
-2
@@ -264,12 +264,35 @@ typedef struct {
|
||||
char commandLine[64];
|
||||
} PARSE_STATE;
|
||||
|
||||
|
||||
static int ParseBootIniInteger(const char* val) {
|
||||
int out = 0;
|
||||
if (!val) return 0;
|
||||
while (*val == ' ' || *val == '\t') val++;
|
||||
int base = 10;
|
||||
if (val[0] == '0' && (val[1] == 'x' || val[1] == 'X')) {
|
||||
base = 16;
|
||||
val += 2;
|
||||
}
|
||||
while (*val) {
|
||||
char c = *val++;
|
||||
int digit;
|
||||
if (c >= '0' && c <= '9') digit = c - '0';
|
||||
else if (c >= 'a' && c <= 'f') digit = 10 + c - 'a';
|
||||
else if (c >= 'A' && c <= 'F') digit = 10 + c - 'A';
|
||||
else break;
|
||||
if (digit >= base) break;
|
||||
out = out * base + digit;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
static void BootIniCb(const char* section, const char* key,
|
||||
const char* val, void* ud) {
|
||||
PARSE_STATE* s = (PARSE_STATE *)ud;
|
||||
// [kernel] debug = 1
|
||||
// [kernel] debug = bitmask: 1=console, 2=selftests, 4=file log
|
||||
if (!AsciiStrCmp(section, "kernel") && !AsciiStrCmp(key, "debug"))
|
||||
s->debug = (int)(val[0] - '0');
|
||||
s->debug = ParseBootIniInteger(val);
|
||||
// [init] commandline = hello.exe
|
||||
else if (!AsciiStrCmp(section, "init") && !AsciiStrCmp(key, "commandline"))
|
||||
AsciiStrCpyS(s->commandLine, 64, val);
|
||||
|
||||
Reference in new issue
Block a user