misc: Bug fixes

This commit is contained in:
mintsuki 2022-03-26 11:59:27 +01:00
parent 8b19de71e6
commit 8b2cafc875
2 changed files with 20 additions and 17 deletions

View File

@ -49,9 +49,7 @@ static struct limine_file get_file(struct file_handle *file, char *cmdline) {
if (file->pxe) {
ret.tftp_ip = file->pxe_ip;
ret.tftp_port = file->pxe_port;
return ret;
}
} else {
struct volume *vol = file->vol;
ret.partition_index = vol->partition;
@ -70,6 +68,7 @@ static struct limine_file get_file(struct file_handle *file, char *cmdline) {
if (gpt_get_guid(&gpt_disk_uuid, vol->backing_dev ?: vol) == true) {
memcpy(&ret.gpt_disk_uuid, &gpt_disk_uuid, sizeof(struct limine_uuid));
}
}
char *path = ext_mem_alloc(strlen(file->path) + 1);
strcpy(path, file->path);
@ -374,6 +373,10 @@ FEAT_START
break;
}
if (module_count == 0) {
break;
}
struct limine_module_response *module_response =
ext_mem_alloc(sizeof(struct limine_module_response));
@ -453,7 +456,7 @@ FEAT_START
#if defined (__i386__)
if (stivale2_rt_stack == NULL) {
stivale2_rt_stack = ext_mem_alloc(16384);
stivale2_rt_stack = ext_mem_alloc(16384) + 16384;
}
terminal_response->write = (uintptr_t)(void *)stivale2_term_write_entry;

View File

@ -570,7 +570,7 @@ failed_to_load_header_section:
#if defined (__i386__)
if (stivale2_rt_stack == NULL) {
stivale2_rt_stack = ext_mem_alloc(8192);
stivale2_rt_stack = ext_mem_alloc(8192) + 8192;
}
tag->term_write = (uintptr_t)(void *)stivale2_term_write_entry;