feature (sysconfig): connected sysconfig to 'noxos.json'
This commit is contained in:
parent
2ffbaa5322
commit
fc81e9f458
|
@ -25,7 +25,26 @@ void sysconfig_init() {
|
||||||
|
|
||||||
json_T* json = json_from_string(buffer);
|
json_T* json = json_from_string(buffer);
|
||||||
|
|
||||||
json_node_dump(json->root_node, 0);
|
json_node_T* child = json->root_node->childs_start;
|
||||||
|
while (child != NULL) {
|
||||||
|
if (string_compare("PS2_ACPI_VALIDATION", child->string)) {
|
||||||
|
if (&child->childs_start[0] == NULL || child->childs_start[0].type != JSON_NODE_BOOL) {
|
||||||
|
log(LOG_WARNING, "sysconfig -> failed to parse field 'PS2_ACPI_VALIDATION' (expected boolean)");
|
||||||
|
} else {
|
||||||
|
g_sysconfig->ps2_acpi_validation = child->childs_start[0].value;
|
||||||
|
}
|
||||||
|
} else if (string_compare("LOG_GRAPHICAL", child->string)) {
|
||||||
|
if (&child->childs_start[0] == NULL || child->childs_start[0].type != JSON_NODE_BOOL) {
|
||||||
|
log(LOG_WARNING, "sysconfig -> failed to parse field 'LOG_GRAPHICAL' (expected boolean)");
|
||||||
|
} else {
|
||||||
|
g_sysconfig->log_graphical = child->childs_start[0].value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log(LOG_WARNING, "sysconfig -> skipping field '%s' (unknown identifier)", child->string);
|
||||||
|
}
|
||||||
|
|
||||||
|
child = child->next;
|
||||||
|
}
|
||||||
|
|
||||||
json_destruct(json);
|
json_destruct(json);
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,13 @@ void kernel_init(boot_info_T* boot_info) {
|
||||||
memory_allocator_init((void*)MEM_REGION_KERNEL_HEAP);
|
memory_allocator_init((void*)MEM_REGION_KERNEL_HEAP);
|
||||||
|
|
||||||
graphics_renderer_init(boot_info);
|
graphics_renderer_init(boot_info);
|
||||||
// graphical_log_init();
|
|
||||||
|
|
||||||
vfs_init(boot_info);
|
vfs_init(boot_info);
|
||||||
|
|
||||||
sysconfig_init();
|
sysconfig_init();
|
||||||
|
|
||||||
|
if (g_sysconfig->log_graphical) graphical_log_init();
|
||||||
|
|
||||||
scheduler_init(boot_info);
|
scheduler_init(boot_info);
|
||||||
|
|
||||||
acpi_init(boot_info);
|
acpi_init(boot_info);
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
json_T* json_from_string(string_t str) {
|
json_T* json_from_string(string_t str) {
|
||||||
json_T* json = memory_allocate(sizeof(json_T));
|
json_T* json = memory_allocate(sizeof(json_T));
|
||||||
|
|
||||||
DEBUG("\n%s", str);
|
|
||||||
|
|
||||||
json_tokenize(json, str);
|
json_tokenize(json, str);
|
||||||
|
|
||||||
bool status = json_parse(json);
|
bool status = json_parse(json);
|
||||||
|
|
Loading…
Reference in New Issue