Added extra warning levels and fixed existing warnings

This commit is contained in:
Jozef Nagy 2025-01-31 21:22:48 +01:00
parent a39e30d17e
commit df0ebbbbcd
Signed by untrusted user who does not match committer: crz
GPG key ID: 459A4811CEAC7068
4 changed files with 16 additions and 31 deletions

View file

@ -28,7 +28,7 @@ export BUILD_DIR ?= build
export SYSROOT_DIR ?= sysroot
export ASFLAGS := $(foreach d, $(DEFINES), -D$d)
export CFLAGS := $(foreach d, $(DEFINES), -D$d) -ffreestanding -fno-stack-protector -fno-stack-check -MMD -MP
export CFLAGS := $(foreach d, $(DEFINES), -D$d) -Wall -Wextra -ffreestanding -fno-stack-protector -fno-stack-check -MMD -MP
export LDFLAGS := -nostdlib
export BOOT_ROOT := $(ROOT_DIR)/boot

View file

@ -18,6 +18,8 @@
/*********************************************************************************/
#include <lib/string.h>
#include <mm/mman.h>
#include <vfs/vfs.h>
#include <print.h>
#include <axboot.h>
@ -33,44 +35,24 @@ char *config_paths[] = {
void config_init(void)
{
void *config_file;
char *config_buffer;
int filesize;
char *config_buf;
uint8_t open = 0;
for (size_t i = 0; i < ARRAY_LENGTH(config_paths); i++) {
//config_file = fw_file_open(NULL, config_paths[i]);
if (config_file != NULL) {
vfs_read("\\System\\axkrnl", &config_buf);
if (config_buf != NULL) {
open = 1;
break;
}
}
if (config_file == NULL) {
//print("No configuration file found! Please refer to the AxBoot documentation.\n");
//print("Entering console...\n\n");
if (open == 0) {
debug("Couldn't open a configuration file! Entering console...\n");
//console();
while (1);
}
//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);
// TODO: parse configuration file
//free(config_buffer);
/*
if (config_errors != 0 || config_get_menu_root() == NULL) {
//print("\nConfiguration invalid!\n");
//print("Please correct your config file.\n");
//print("Entering console...\n\n");
//console();
}
*/
//fw_file_close(config_file);
mem_free(config_buf);
}

View file

@ -34,6 +34,8 @@ struct sfs_fsdata {
struct vfs_drive *sfs_init(char *mountpoint)
{
(void)mountpoint;
EFI_LOADED_IMAGE_PROTOCOL *loaded_image = NULL;
EFI_GUID lip_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *iovolume;
@ -97,6 +99,8 @@ struct vfs_drive *sfs_init(char *mountpoint)
size_t sfs_read(char *filename, char **buffer, struct vfs_drive *dev, void *fsdata)
{
(void)dev;
struct sfs_fsdata *data = (struct sfs_fsdata *)fsdata;
EFI_FILE_PROTOCOL *volume = data->volume;
EFI_FILE_PROTOCOL *file;

View file

@ -119,7 +119,6 @@ void *mem_alloc(size_t n)
int mem_allocat(void *addr, size_t npages)
{
EFI_STATUS status;
void *alloc;
status = gBootServices->AllocatePages(AllocateAddress, EfiLoaderData, (EFI_UINTN)npages, addr);
if (EFI_ERROR(status)) {