diff --git a/src/boot/config.c b/src/boot/config.c index 6bb3f72..2279d05 100644 --- a/src/boot/config.c +++ b/src/boot/config.c @@ -25,7 +25,26 @@ void sysconfig_init() { 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); diff --git a/src/boot/kmain.c b/src/boot/kmain.c index 61c1e92..767c801 100644 --- a/src/boot/kmain.c +++ b/src/boot/kmain.c @@ -41,12 +41,13 @@ void kernel_init(boot_info_T* boot_info) { memory_allocator_init((void*)MEM_REGION_KERNEL_HEAP); graphics_renderer_init(boot_info); -// graphical_log_init(); vfs_init(boot_info); sysconfig_init(); + if (g_sysconfig->log_graphical) graphical_log_init(); + scheduler_init(boot_info); acpi_init(boot_info); diff --git a/src/drivers/json.c b/src/drivers/json.c index a3f9131..09b23b8 100644 --- a/src/drivers/json.c +++ b/src/drivers/json.c @@ -7,8 +7,6 @@ json_T* json_from_string(string_t str) { json_T* json = memory_allocate(sizeof(json_T)); - DEBUG("\n%s", str); - json_tokenize(json, str); bool status = json_parse(json);