2020-12-06 23:46:37 -05:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2020-12-06 23:42:52 -05:00
|
|
|
#include "config.h"
|
2020-12-06 23:46:37 -05:00
|
|
|
#endif
|
2020-11-30 06:40:33 -05:00
|
|
|
|
2022-05-24 19:01:51 -04:00
|
|
|
#include <kernaux/assert.h>
|
2022-12-16 03:28:58 -05:00
|
|
|
#include <kernaux/generic/display.h>
|
2022-12-10 15:15:58 -05:00
|
|
|
#include <kernaux/macro.h>
|
2020-11-27 20:27:41 -05:00
|
|
|
#include <kernaux/multiboot2.h>
|
|
|
|
|
2020-12-06 05:16:15 -05:00
|
|
|
#include <stddef.h>
|
2022-01-13 09:18:18 -05:00
|
|
|
#include <stdint.h>
|
2020-12-06 05:16:15 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
#define PRINT(s) do { KernAux_Display_print (display, s); } while (0)
|
|
|
|
#define PRINTLN(s) do { KernAux_Display_println(display, s); } while (0)
|
2022-12-08 21:59:54 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
#define PRINTF(format, ...) \
|
|
|
|
do { KernAux_Display_printf (display, format, __VA_ARGS__); } while (0)
|
2022-12-08 21:59:54 -05:00
|
|
|
#define PRINTLNF(format, ...) \
|
2022-12-16 03:28:58 -05:00
|
|
|
do { KernAux_Display_printlnf(display, format, __VA_ARGS__); } while (0)
|
|
|
|
|
|
|
|
#define HEADER(Type) do { \
|
|
|
|
KERNAUX_ASSERT(tag); \
|
|
|
|
KERNAUX_ASSERT(display); \
|
|
|
|
\
|
|
|
|
if (!KernAux_Multiboot2_ITag_##Type##_is_valid(tag)) { \
|
|
|
|
PRINTLN("Multiboot 2 info tag // invalid!"); \
|
|
|
|
} \
|
|
|
|
\
|
2022-12-16 21:31:09 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, type, tag->base.type); \
|
2022-12-16 03:28:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, size, tag->base.size); \
|
|
|
|
\
|
|
|
|
PRINTLN("Multiboot 2 info tag {"); \
|
2022-12-16 21:31:09 -05:00
|
|
|
PRINTLNF(" u32 type: %lu (%s)", \
|
|
|
|
type, \
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_to_str(tag->base.type) \
|
|
|
|
); \
|
|
|
|
PRINTLNF(" u32 size: %lu", size); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define FOOTER do { PRINTLN("}"); } while (0)
|
2022-12-08 21:59:54 -05:00
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
void KernAux_Multiboot2_Info_print(
|
|
|
|
const struct KernAux_Multiboot2_Info *const multiboot2_info,
|
2022-12-08 21:59:54 -05:00
|
|
|
const KernAux_Display display
|
2020-11-27 20:27:41 -05:00
|
|
|
) {
|
2022-06-13 12:28:00 -04:00
|
|
|
KERNAUX_ASSERT(multiboot2_info);
|
2022-12-08 21:59:54 -05:00
|
|
|
KERNAUX_ASSERT(display);
|
2022-05-24 19:01:51 -04:00
|
|
|
|
2022-12-10 15:15:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, total_size, multiboot2_info->total_size);
|
2022-12-16 03:28:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved, multiboot2_info->reserved);
|
2022-12-10 15:15:58 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
PRINTLN("Multiboot 2 info {");
|
2022-12-16 20:05:48 -05:00
|
|
|
PRINTLNF(" u32 size: %lu", total_size);
|
|
|
|
PRINTLNF(" u32 reserved: 0x%lx", reserved);
|
2022-12-16 03:28:58 -05:00
|
|
|
PRINTLN("}");
|
2020-11-27 20:27:41 -05:00
|
|
|
|
2022-01-12 22:03:15 -05:00
|
|
|
const struct KernAux_Multiboot2_ITagBase *tag_base =
|
|
|
|
(struct KernAux_Multiboot2_ITagBase*)
|
2022-01-12 22:59:52 -05:00
|
|
|
KERNAUX_MULTIBOOT2_DATA(multiboot2_info);
|
2020-11-27 20:27:41 -05:00
|
|
|
|
2021-12-14 14:13:18 -05:00
|
|
|
while (tag_base <
|
2022-01-12 22:03:15 -05:00
|
|
|
(struct KernAux_Multiboot2_ITagBase*)
|
2022-01-13 09:18:18 -05:00
|
|
|
((uint8_t*)multiboot2_info + multiboot2_info->total_size))
|
2021-12-14 14:13:18 -05:00
|
|
|
{
|
2022-01-12 22:03:15 -05:00
|
|
|
if (!KernAux_Multiboot2_ITagBase_is_valid(tag_base)) return;
|
2022-12-08 21:59:54 -05:00
|
|
|
KernAux_Multiboot2_ITagBase_print(tag_base, display);
|
2022-01-13 07:55:59 -05:00
|
|
|
tag_base = KERNAUX_MULTIBOOT2_ITAG_NEXT(tag_base);
|
2020-11-27 20:27:41 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-12 22:03:15 -05:00
|
|
|
void KernAux_Multiboot2_ITagBase_print(
|
|
|
|
const struct KernAux_Multiboot2_ITagBase *const tag_base,
|
2022-12-08 21:59:54 -05:00
|
|
|
const KernAux_Display display
|
2020-11-27 20:27:41 -05:00
|
|
|
) {
|
2022-06-13 12:28:00 -04:00
|
|
|
KERNAUX_ASSERT(tag_base);
|
2022-12-08 21:59:54 -05:00
|
|
|
KERNAUX_ASSERT(display);
|
2022-05-24 19:01:51 -04:00
|
|
|
|
2020-11-27 20:27:41 -05:00
|
|
|
switch (tag_base->type) {
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_NONE:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_None_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_None*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_BOOT_CMD_LINE:
|
2022-01-15 01:36:24 -05:00
|
|
|
KernAux_Multiboot2_ITag_BootCmdLine_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_BootCmdLine*)tag_base,
|
2022-12-08 21:59:54 -05:00
|
|
|
display
|
2020-11-27 20:27:41 -05:00
|
|
|
);
|
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_BOOT_LOADER_NAME:
|
2022-01-15 01:39:01 -05:00
|
|
|
KernAux_Multiboot2_ITag_BootLoaderName_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_BootLoaderName*)tag_base,
|
2022-12-08 21:59:54 -05:00
|
|
|
display
|
2020-11-27 20:27:41 -05:00
|
|
|
);
|
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_MODULE:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_Module_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_Module*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-27 20:27:41 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_BASIC_MEMORY_INFO:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_BasicMemoryInfo_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_BasicMemoryInfo*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-27 20:27:41 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_BIOS_BOOT_DEVICE:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_BIOSBootDevice_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_BIOSBootDevice*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-27 20:27:41 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_MEMORY_MAP:
|
2022-01-12 22:12:28 -05:00
|
|
|
KernAux_Multiboot2_ITag_MemoryMap_print(
|
2022-01-12 22:38:51 -05:00
|
|
|
(struct KernAux_Multiboot2_ITag_MemoryMap*)tag_base,
|
2022-12-08 21:59:54 -05:00
|
|
|
display
|
2020-11-28 18:24:14 -05:00
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_VBE_INFO:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_VBEInfo_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_VBEInfo*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_FRAMEBUFFER_INFO:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_FramebufferInfo_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_FramebufferInfo*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_ELF_SYMBOLS:
|
2022-01-12 22:12:28 -05:00
|
|
|
KernAux_Multiboot2_ITag_ELFSymbols_print(
|
2022-01-12 22:38:51 -05:00
|
|
|
(struct KernAux_Multiboot2_ITag_ELFSymbols*)tag_base,
|
2022-12-08 21:59:54 -05:00
|
|
|
display
|
2020-11-29 09:18:07 -05:00
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_APM_TABLE:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_APMTable_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_APMTable*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_EFI_32BIT_SYSTEM_TABLE_PTR:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_EFI32bitSystemTablePtr_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_EFI32bitSystemTablePtr*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_EFI_64BIT_SYSTEM_TABLE_PTR:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_EFI64bitSystemTablePtr_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_EFI64bitSystemTablePtr*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_SMBIOS_TABLES:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_SMBIOSTables_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_SMBIOSTables*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_ACPI_OLD_RSDP:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_ACPIOldRSDP_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_ACPIOldRSDP*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_ACPI_NEW_RSDP:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_ACPINewRSDP_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_ACPINewRSDP*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_NETWORKING_INFO:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_NetworkingInfo_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_NetworkingInfo*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_EFI_MEMORY_MAP:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_EFIMemoryMap_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_EFIMemoryMap*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_EFI_BOOT_SERVICES_NOT_TERMINATED:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_EFIBootServicesNotTerminated_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_EFIBootServicesNotTerminated*)
|
|
|
|
tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_EFI_32BIT_IMAGE_HANDLE_PTR:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_EFI32bitImageHandlePtr_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_EFI32bitImageHandlePtr*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_EFI_64BIT_IMAGE_HANDLE_PTR:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_EFI64bitImageHandlePtr_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_EFI64bitImageHandlePtr*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-28 16:39:04 -05:00
|
|
|
break;
|
2022-01-12 21:49:25 -05:00
|
|
|
case KERNAUX_MULTIBOOT2_ITAG_IMAGE_LOAD_BASE_PHYS_ADDR:
|
2022-12-16 03:28:58 -05:00
|
|
|
KernAux_Multiboot2_ITag_ImageLoadBasePhysAddr_print(
|
|
|
|
(struct KernAux_Multiboot2_ITag_ImageLoadBasePhysAddr*)tag_base,
|
|
|
|
display
|
|
|
|
);
|
2020-11-27 20:43:51 -05:00
|
|
|
break;
|
2020-11-27 20:27:41 -05:00
|
|
|
}
|
|
|
|
}
|
2020-11-28 18:24:14 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
void KernAux_Multiboot2_ITag_None_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_None *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(None);
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
2022-01-15 01:36:24 -05:00
|
|
|
void KernAux_Multiboot2_ITag_BootCmdLine_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_BootCmdLine *const tag,
|
2022-12-08 21:59:54 -05:00
|
|
|
const KernAux_Display display
|
2022-01-15 01:36:24 -05:00
|
|
|
) {
|
2022-12-16 03:28:58 -05:00
|
|
|
HEADER(BootCmdLine);
|
2022-05-24 19:01:51 -04:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
// Print data:
|
|
|
|
PRINTLNF(" char cmdline[]: \"%s\"", KERNAUX_MULTIBOOT2_DATA(tag));
|
2022-01-15 01:36:24 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
FOOTER;
|
2022-01-15 01:36:24 -05:00
|
|
|
}
|
|
|
|
|
2022-01-15 01:39:01 -05:00
|
|
|
void KernAux_Multiboot2_ITag_BootLoaderName_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_BootLoaderName *const tag,
|
2022-12-08 21:59:54 -05:00
|
|
|
const KernAux_Display display
|
2022-01-15 01:39:01 -05:00
|
|
|
) {
|
2022-12-16 03:28:58 -05:00
|
|
|
HEADER(BootLoaderName);
|
2022-05-24 19:01:51 -04:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
// Print data:
|
|
|
|
PRINTLNF(" char name[]: \"%s\"", KERNAUX_MULTIBOOT2_DATA(tag));
|
2022-01-15 01:39:01 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_Module_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_Module *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(Module);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, mod_start, tag->mod_start);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, mod_end, tag->mod_end);
|
|
|
|
|
2022-12-16 20:05:48 -05:00
|
|
|
PRINTLNF(" u32 mod_start: 0x%lx", mod_start);
|
|
|
|
PRINTLNF(" u32 mod_end: 0x%lx", mod_end);
|
2022-12-16 03:28:58 -05:00
|
|
|
|
|
|
|
// Print data:
|
|
|
|
PRINTLNF(" char cmdline[]: \"%s\"", KERNAUX_MULTIBOOT2_DATA(tag));
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_BasicMemoryInfo_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_BasicMemoryInfo *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(BasicMemoryInfo);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, mem_lower, tag->mem_lower);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, mem_upper, tag->mem_upper);
|
|
|
|
|
|
|
|
PRINTLNF(" u32 mem_lower: %lu", mem_lower);
|
|
|
|
PRINTLNF(" u32 mem_upper: %lu", mem_upper);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_BIOSBootDevice_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_BIOSBootDevice *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(BIOSBootDevice);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, biosdev, tag->biosdev);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, partition, tag->partition);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, sub_partition, tag->sub_partition);
|
|
|
|
|
|
|
|
PRINTLNF(" u32 biosdev: %lu", biosdev);
|
|
|
|
PRINTLNF(" u32 partition: %lu", partition);
|
|
|
|
PRINTLNF(" u32 sub_partition: %lu", sub_partition);
|
|
|
|
|
|
|
|
FOOTER;
|
2022-01-15 01:39:01 -05:00
|
|
|
}
|
|
|
|
|
2022-01-12 22:12:28 -05:00
|
|
|
void KernAux_Multiboot2_ITag_MemoryMap_print(
|
2022-01-12 22:38:51 -05:00
|
|
|
const struct KernAux_Multiboot2_ITag_MemoryMap *const tag,
|
2022-12-08 21:59:54 -05:00
|
|
|
const KernAux_Display display
|
2020-11-28 18:24:14 -05:00
|
|
|
) {
|
2022-12-16 03:28:58 -05:00
|
|
|
HEADER(MemoryMap);
|
2020-11-28 18:24:14 -05:00
|
|
|
|
2022-12-10 15:15:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, entry_size, tag->entry_size);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, entry_version, tag->entry_version);
|
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
PRINTLNF(" u32 entry_size: %lu", entry_size);
|
|
|
|
PRINTLNF(" u32 entry_version: %lu", entry_version);
|
|
|
|
|
|
|
|
// Print data:
|
|
|
|
|
|
|
|
PRINTLN (" varies(entry_size) entries[]: [");
|
2020-11-28 18:24:14 -05:00
|
|
|
|
2022-01-12 22:22:17 -05:00
|
|
|
const struct KernAux_Multiboot2_ITag_MemoryMap_EntryBase *const entries =
|
|
|
|
(struct KernAux_Multiboot2_ITag_MemoryMap_EntryBase*)
|
2022-01-12 22:38:51 -05:00
|
|
|
KERNAUX_MULTIBOOT2_DATA((struct KernAux_Multiboot2_ITag_MemoryMap*)tag);
|
2020-11-28 18:24:14 -05:00
|
|
|
|
|
|
|
for (
|
2021-12-16 10:26:16 -05:00
|
|
|
size_t index = 0;
|
2020-11-28 18:24:14 -05:00
|
|
|
index < (tag->base.size - sizeof(*tag)) / tag->entry_size;
|
|
|
|
++index
|
|
|
|
) {
|
2022-12-10 15:15:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long long, base_addr, entries[index].base_addr);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long long, length, entries[index].length);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, type, entries[index].type);
|
2022-12-16 03:28:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved, entries[index].reserved);
|
|
|
|
|
|
|
|
PRINTLNF(" [%zu] entry: {", index);
|
2022-12-16 20:05:48 -05:00
|
|
|
PRINTLNF(" u64 base_addr: 0x%llx", base_addr);
|
|
|
|
PRINTLNF(" u64 length: %llu", length);
|
|
|
|
PRINTLNF(" u32 type: %lu", type);
|
|
|
|
PRINTLNF(" u32 reserved: 0x%lx", reserved);
|
2022-12-16 03:28:58 -05:00
|
|
|
PRINTLN (" }");
|
|
|
|
}
|
2022-12-10 15:15:58 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
PRINTLN(" ]");
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_VBEInfo_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_VBEInfo *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(VBEInfo);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, mode, tag->vbe_mode);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, interface_seg, tag->vbe_interface_seg);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, interface_off, tag->vbe_interface_off);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, interface_len, tag->vbe_interface_len);
|
|
|
|
|
|
|
|
PRINTLNF(" u16 vbe_mode: %lu", mode);
|
|
|
|
PRINTLNF(" u16 vbe_interface_seg: %lu", interface_seg);
|
|
|
|
PRINTLNF(" u16 vbe_interface_off: %lu", interface_off);
|
|
|
|
PRINTLNF(" u16 vbe_interface_len: %lu", interface_len);
|
|
|
|
|
|
|
|
const size_t cols = 16;
|
|
|
|
|
|
|
|
PRINTLN (" u8 vbe_control_info[]: [");
|
|
|
|
for (
|
|
|
|
size_t index = 0;
|
|
|
|
index < sizeof(tag->vbe_control_info) / sizeof(tag->vbe_control_info[0]);
|
|
|
|
index += cols
|
|
|
|
) {
|
|
|
|
PRINTF(" %-3u", tag->vbe_control_info[index]);
|
|
|
|
for (size_t col = 1; col < cols; ++col) {
|
|
|
|
PRINTF(" %-3u", tag->vbe_control_info[index + col]);
|
|
|
|
}
|
|
|
|
PRINTLN("");
|
|
|
|
}
|
|
|
|
PRINTLN (" ]");
|
|
|
|
|
|
|
|
PRINTLN (" u8 vbe_mode_info[]: [");
|
|
|
|
for (
|
|
|
|
size_t index = 0;
|
|
|
|
index < sizeof(tag->vbe_mode_info) / sizeof(tag->vbe_mode_info[0]);
|
|
|
|
index += cols
|
|
|
|
) {
|
|
|
|
PRINTF(" %-3u", tag->vbe_mode_info[index]);
|
|
|
|
for (size_t col = 1; col < cols; ++col) {
|
|
|
|
PRINTF(" %-3u", tag->vbe_mode_info[index + col]);
|
|
|
|
}
|
|
|
|
PRINTLN("");
|
2020-11-28 18:24:14 -05:00
|
|
|
}
|
2022-12-16 03:28:58 -05:00
|
|
|
PRINTLN (" ]");
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_FramebufferInfo_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_FramebufferInfo *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(FramebufferInfo);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long long, addr, tag->framebuffer_addr);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, pitch, tag->framebuffer_pitch);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, width, tag->framebuffer_width);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, height, tag->framebuffer_height);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, bpp, tag->framebuffer_bpp);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, type, tag->framebuffer_type);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved, tag->reserved);
|
|
|
|
|
2022-12-16 20:05:48 -05:00
|
|
|
PRINTLNF(" u64 framebuffer_addr: 0x%llx", addr);
|
|
|
|
PRINTLNF(" u32 framebuffer_pitch: %lu", pitch);
|
|
|
|
PRINTLNF(" u32 framebuffer_width: %lu", width);
|
|
|
|
PRINTLNF(" u32 framebuffer_height: %lu", height);
|
|
|
|
PRINTLNF(" u8 framebuffer_bpp: %lu", bpp);
|
|
|
|
PRINTLNF(" u8 framebuffer_type: %lu", type);
|
|
|
|
PRINTLNF(" u16 reserved: 0x%lx", reserved);
|
2022-12-16 03:28:58 -05:00
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
2020-11-28 18:24:14 -05:00
|
|
|
}
|
2020-11-29 09:18:07 -05:00
|
|
|
|
2022-01-12 22:12:28 -05:00
|
|
|
void KernAux_Multiboot2_ITag_ELFSymbols_print(
|
2022-01-12 22:38:51 -05:00
|
|
|
const struct KernAux_Multiboot2_ITag_ELFSymbols *const tag,
|
2022-12-08 21:59:54 -05:00
|
|
|
const KernAux_Display display
|
2020-11-29 09:18:07 -05:00
|
|
|
) {
|
2022-12-16 03:28:58 -05:00
|
|
|
HEADER(ELFSymbols);
|
2022-05-24 19:01:51 -04:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, num, tag->num);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, entsize, tag->entsize);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, shndx, tag->shndx);
|
|
|
|
|
|
|
|
PRINTLNF(" u32 num: %lu", num);
|
|
|
|
PRINTLNF(" u32 entsize: %lu", entsize);
|
|
|
|
PRINTLNF(" u32 shndx: %lu", shndx);
|
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_APMTable_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_APMTable *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(APMTable);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, version, tag->version);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, cseg, tag->cseg);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, offset, tag->offset);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, cseg_16, tag->cseg_16);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, dseg, tag->dseg);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, flags, tag->flags);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, cseg_len, tag->cseg_len);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, cseg_16_len, tag->cseg_16_len);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, dseg_len, tag->dseg_len);
|
|
|
|
|
|
|
|
PRINTLNF(" u16 version: %lu", version);
|
|
|
|
PRINTLNF(" u16 cseg: %lu", cseg);
|
|
|
|
PRINTLNF(" u32 offset: %lu", offset);
|
|
|
|
PRINTLNF(" u16 cseg_16: %lu", cseg_16);
|
|
|
|
PRINTLNF(" u16 dseg: %lu", dseg);
|
|
|
|
PRINTLNF(" u16 flags: %lu", flags);
|
|
|
|
PRINTLNF(" u16 cseg_len: %lu", cseg_len);
|
|
|
|
PRINTLNF(" u16 cseg_16_len: %lu", cseg_16_len);
|
|
|
|
PRINTLNF(" u16 dseg_len: %lu", dseg_len);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_EFI32bitSystemTablePtr_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_EFI32bitSystemTablePtr *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(EFI32bitSystemTablePtr);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, pointer, tag->pointer);
|
|
|
|
|
|
|
|
PRINTLNF(" u32 pointer: %lu", pointer);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_EFI64bitSystemTablePtr_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_EFI64bitSystemTablePtr *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(EFI64bitSystemTablePtr);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long long, pointer, tag->pointer);
|
|
|
|
|
|
|
|
PRINTLNF(" u64 pointer: %llu", pointer);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_SMBIOSTables_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_SMBIOSTables *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(SMBIOSTables);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, major, tag->major);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, minor, tag->minor);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved0, tag->reserved[0]);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved1, tag->reserved[1]);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved2, tag->reserved[2]);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved3, tag->reserved[3]);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved4, tag->reserved[4]);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, reserved5, tag->reserved[5]);
|
|
|
|
|
|
|
|
PRINTLNF(" u8 major: %lu", major);
|
|
|
|
PRINTLNF(" u8 minor: %lu", minor);
|
2022-12-16 20:05:48 -05:00
|
|
|
PRINTLNF(" u8 reserved[6]: [0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx]",
|
2022-12-16 03:28:58 -05:00
|
|
|
reserved0, reserved1, reserved2,
|
|
|
|
reserved3, reserved4, reserved5
|
|
|
|
);
|
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_ACPIOldRSDP_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_ACPIOldRSDP *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(ACPIOldRSDP);
|
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_ACPINewRSDP_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_ACPINewRSDP *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(ACPINewRSDP);
|
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_NetworkingInfo_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_NetworkingInfo *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(NetworkingInfo);
|
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_EFIMemoryMap_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_EFIMemoryMap *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(EFIMemoryMap);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, descr_size, tag->descriptor_size);
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, descr_version, tag->descriptor_version);
|
|
|
|
|
|
|
|
PRINTLNF(" u32 descriptor_size: %lu", descr_size);
|
|
|
|
PRINTLNF(" u32 descriptor_version: %lu", descr_version);
|
|
|
|
|
|
|
|
// TODO: Print data?
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_EFIBootServicesNotTerminated_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_EFIBootServicesNotTerminated *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(EFIBootServicesNotTerminated);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_EFI32bitImageHandlePtr_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_EFI32bitImageHandlePtr *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(EFI32bitImageHandlePtr);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long, pointer, tag->pointer);
|
|
|
|
|
|
|
|
PRINTLNF(" u32 pointer: %lu", pointer);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_EFI64bitImageHandlePtr_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_EFI64bitImageHandlePtr *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(EFI64bitImageHandlePtr);
|
|
|
|
|
|
|
|
KERNAUX_CAST_CONST(unsigned long long, pointer, tag->pointer);
|
|
|
|
|
|
|
|
PRINTLNF(" u64 pointer: %llu", pointer);
|
|
|
|
|
|
|
|
FOOTER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KernAux_Multiboot2_ITag_ImageLoadBasePhysAddr_print(
|
|
|
|
const struct KernAux_Multiboot2_ITag_ImageLoadBasePhysAddr *const tag,
|
|
|
|
const KernAux_Display display
|
|
|
|
) {
|
|
|
|
HEADER(ImageLoadBasePhysAddr);
|
2020-11-29 09:18:07 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
KERNAUX_CAST_CONST(unsigned long, load_base_addr, tag->load_base_addr);
|
2022-12-10 15:15:58 -05:00
|
|
|
|
2022-12-16 20:05:48 -05:00
|
|
|
PRINTLNF(" u32 load_base_addr: 0x%lx", load_base_addr);
|
2020-11-29 09:25:35 -05:00
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
FOOTER;
|
2020-11-29 09:18:07 -05:00
|
|
|
}
|