Added build type detection, simplified legacy BIOS booting on x86_64

This commit is contained in:
Jozef Nagy 2025-01-25 19:53:01 +01:00
parent 0236209e95
commit 1fc97f9c5f
Signed by untrusted user who does not match committer: crz
GPG key ID: 459A4811CEAC7068
18 changed files with 298 additions and 107 deletions

View file

@ -17,8 +17,6 @@
/* SOFTWARE. */
/*********************************************************************************/
#include <config/config.h>
#include <firmware/file.h>
#include <lib/string.h>
#include <print.h>
#include <axboot.h>
@ -35,12 +33,12 @@ char *config_paths[] = {
void config_init(void)
{
FILE *config_file;
void *config_file;
char *config_buffer;
int filesize;
for (size_t i = 0; i < ARRAY_LENGTH(config_paths); i++) {
config_file = fw_file_open(NULL, config_paths[i]);
//config_file = fw_file_open(NULL, config_paths[i]);
if (config_file != NULL) {
break;
}
@ -52,18 +50,18 @@ void config_init(void)
//console();
}
filesize = fw_file_size(config_file);
config_buffer = malloc(filesize);
//filesize = fw_file_size(config_file);
//config_buffer = malloc(filesize);
if (config_buffer == NULL) {
log("Entering console...\r\n\r\n");
//console();
}
fw_file_read(config_file, filesize, config_buffer);
//fw_file_read(config_file, filesize, config_buffer);
// TODO: parse configuration file
free(config_buffer);
//free(config_buffer);
/*
if (config_errors != 0 || config_get_menu_root() == NULL) {
@ -74,5 +72,5 @@ void config_init(void)
}
*/
fw_file_close(config_file);
//fw_file_close(config_file);
}