protos: Move 'loading kernel' prints where they belong

This commit is contained in:
mintsuki 2022-07-13 08:34:30 +02:00
parent e5e125887b
commit 2a448febb3
4 changed files with 8 additions and 7 deletions

View File

@ -231,6 +231,8 @@ noreturn void limine_load(char *config, char *cmdline) {
if (kernel_path == NULL)
panic(true, "limine: KERNEL_PATH not specified");
print("limine: Loading kernel `%s`...\n", kernel_path);
struct file_handle *kernel_file;
if ((kernel_file = uri_open(kernel_path)) == NULL)
panic(true, "limine: Failed to open kernel with path `%s`. Is the path correct?", kernel_path);
@ -308,8 +310,6 @@ noreturn void limine_load(char *config, char *cmdline) {
panic(true, "limine: This CPU does not support 64-bit mode.");
}
print("limine: Loading kernel `%s`...\n", kernel_path);
printv("limine: Physical base: %X\n", physical_base);
printv("limine: Virtual base: %X\n", virtual_base);
printv("limine: Slide: %X\n", slide);

View File

@ -355,6 +355,8 @@ noreturn void linux_load(char *config, char *cmdline) {
if (kernel_path == NULL)
panic(true, "linux: KERNEL_PATH not specified");
print("linux: Loading kernel `%s`...\n", kernel_path);
if ((kernel_file = uri_open(kernel_path)) == NULL)
panic(true, "linux: Failed to open kernel with path `%s`. Is the path correct?", kernel_path);
@ -419,7 +421,6 @@ noreturn void linux_load(char *config, char *cmdline) {
// load kernel
uintptr_t kernel_load_addr = 0x100000;
print("linux: Loading kernel `%s`...\n", kernel_path);
for (;;) {
if (memmap_alloc_range(kernel_load_addr,
ALIGN_UP(kernel_file->size - real_mode_code_size, 4096),

View File

@ -51,6 +51,8 @@ noreturn void multiboot1_load(char *config, char *cmdline) {
if (kernel_path == NULL)
panic(true, "multiboot1: KERNEL_PATH not specified");
print("multiboot1: Loading kernel `%s`...\n", kernel_path);
if ((kernel_file = uri_open(kernel_path)) == NULL)
panic(true, "multiboot1: Failed to open kernel with path `%s`. Is the path correct?", kernel_path);
@ -76,8 +78,6 @@ noreturn void multiboot1_load(char *config, char *cmdline) {
panic(true, "multiboot1: Invalid magic");
}
print("multiboot1: Loading kernel `%s`...\n", kernel_path);
if (header.magic + header.flags + header.checksum)
panic(true, "multiboot1: Header checksum is invalid");

View File

@ -66,6 +66,8 @@ noreturn void multiboot2_load(char *config, char* cmdline) {
if (kernel_path == NULL)
panic(true, "multiboot2: KERNEL_PATH not specified");
print("multiboot2: Loading kernel `%s`...\n", kernel_path);
if ((kernel_file = uri_open(kernel_path)) == NULL)
panic(true, "multiboot2: Failed to open kernel with path `%s`. Is the path correct?", kernel_path);
@ -89,8 +91,6 @@ noreturn void multiboot2_load(char *config, char* cmdline) {
panic(true, "multiboot2: Invalid magic");
}
print("multiboot2: Loading kernel `%s`...\n", kernel_path);
if (header->magic + header->architecture + header->checksum + header->header_length) {
panic(true, "multiboot2: Header checksum is invalid");
}