2020-12-06 23:47:53 -05:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2020-11-29 13:02:19 -05:00
|
|
|
#include <kernaux/multiboot2.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
2020-11-29 15:08:44 -05:00
|
|
|
#include "multiboot2_example1.h"
|
|
|
|
#include "multiboot2_example2.h"
|
|
|
|
|
2020-11-29 13:02:19 -05:00
|
|
|
static const struct {
|
2022-01-12 22:59:52 -05:00
|
|
|
struct KernAux_Multiboot2_Info multiboot2_info;
|
2022-01-12 22:38:51 -05:00
|
|
|
struct KernAux_Multiboot2_ITag_None tag_none;
|
2020-11-29 13:02:19 -05:00
|
|
|
} multiboot2_without_boot_cmd_line = {
|
2022-01-12 22:59:52 -05:00
|
|
|
.multiboot2_info = {
|
2020-11-29 13:02:19 -05:00
|
|
|
.total_size = sizeof(multiboot2_without_boot_cmd_line),
|
|
|
|
.reserved1 = 0,
|
|
|
|
},
|
|
|
|
.tag_none = {
|
|
|
|
.base = {
|
2022-01-12 21:49:25 -05:00
|
|
|
.type = KERNAUX_MULTIBOOT2_ITAG_NONE,
|
2020-11-29 13:02:19 -05:00
|
|
|
.size = sizeof(multiboot2_without_boot_cmd_line.tag_none),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct {
|
2022-01-12 22:59:52 -05:00
|
|
|
struct KernAux_Multiboot2_Info multiboot2_info;
|
2020-11-29 13:02:19 -05:00
|
|
|
|
|
|
|
struct {
|
2022-01-12 22:38:51 -05:00
|
|
|
struct KernAux_Multiboot2_ITag_BootCmdLine tag;
|
2020-11-29 13:02:19 -05:00
|
|
|
char cmdline[14];
|
|
|
|
} tag_boot_cmd_line;
|
|
|
|
|
|
|
|
unsigned char _align1[2];
|
|
|
|
|
2022-01-12 22:38:51 -05:00
|
|
|
struct KernAux_Multiboot2_ITag_None tag_none;
|
2020-11-29 13:02:19 -05:00
|
|
|
} multiboot2_with_some_boot_cmd_line = {
|
2022-01-12 22:59:52 -05:00
|
|
|
.multiboot2_info = {
|
2020-11-29 13:02:19 -05:00
|
|
|
.total_size = sizeof(multiboot2_with_some_boot_cmd_line),
|
|
|
|
.reserved1 = 0,
|
|
|
|
},
|
|
|
|
.tag_boot_cmd_line = {
|
|
|
|
.tag = {
|
|
|
|
.base = {
|
2022-01-12 21:49:25 -05:00
|
|
|
.type = KERNAUX_MULTIBOOT2_ITAG_BOOT_CMD_LINE,
|
2020-11-29 13:02:19 -05:00
|
|
|
.size = sizeof(
|
|
|
|
multiboot2_with_some_boot_cmd_line.tag_boot_cmd_line
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
.cmdline = "Hello, World!\0",
|
|
|
|
},
|
|
|
|
.tag_none = {
|
|
|
|
.base = {
|
2022-01-12 21:49:25 -05:00
|
|
|
.type = KERNAUX_MULTIBOOT2_ITAG_NONE,
|
2020-11-29 13:02:19 -05:00
|
|
|
.size = sizeof(multiboot2_with_some_boot_cmd_line.tag_none),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct {
|
2022-01-12 22:59:52 -05:00
|
|
|
struct KernAux_Multiboot2_Info multiboot2_info;
|
2020-11-29 13:02:19 -05:00
|
|
|
|
|
|
|
struct {
|
2022-01-12 22:38:51 -05:00
|
|
|
struct KernAux_Multiboot2_ITag_BootCmdLine tag;
|
2020-11-29 13:02:19 -05:00
|
|
|
char cmdline[14];
|
|
|
|
} tag_boot_cmd_line1;
|
|
|
|
|
|
|
|
unsigned char _align1[2];
|
|
|
|
|
|
|
|
struct {
|
2022-01-12 22:38:51 -05:00
|
|
|
struct KernAux_Multiboot2_ITag_BootCmdLine tag;
|
2020-11-29 13:02:19 -05:00
|
|
|
char cmdline[13];
|
|
|
|
} tag_boot_cmd_line2;
|
|
|
|
|
|
|
|
unsigned char _align2[3];
|
|
|
|
|
2022-01-12 22:38:51 -05:00
|
|
|
struct KernAux_Multiboot2_ITag_None tag_none;
|
2020-11-29 13:02:19 -05:00
|
|
|
} multiboot2_with_two_boot_cmd_lines = {
|
2022-01-12 22:59:52 -05:00
|
|
|
.multiboot2_info = {
|
2020-11-29 13:02:19 -05:00
|
|
|
.total_size = sizeof(multiboot2_with_two_boot_cmd_lines),
|
|
|
|
.reserved1 = 0,
|
|
|
|
},
|
|
|
|
.tag_boot_cmd_line1 = {
|
|
|
|
.tag = {
|
|
|
|
.base = {
|
2022-01-12 21:49:25 -05:00
|
|
|
.type = KERNAUX_MULTIBOOT2_ITAG_BOOT_CMD_LINE,
|
2020-11-29 13:02:19 -05:00
|
|
|
.size = sizeof(
|
|
|
|
multiboot2_with_two_boot_cmd_lines.tag_boot_cmd_line1
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
.cmdline = "Hello, World!\0",
|
|
|
|
},
|
|
|
|
.tag_boot_cmd_line2 = {
|
|
|
|
.tag = {
|
|
|
|
.base = {
|
2022-01-12 21:49:25 -05:00
|
|
|
.type = KERNAUX_MULTIBOOT2_ITAG_BOOT_CMD_LINE,
|
2020-11-29 13:02:19 -05:00
|
|
|
.size = sizeof(
|
|
|
|
multiboot2_with_two_boot_cmd_lines.tag_boot_cmd_line2
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
.cmdline = "Hello again!\0",
|
|
|
|
},
|
|
|
|
.tag_none = {
|
|
|
|
.base = {
|
2022-01-12 21:49:25 -05:00
|
|
|
.type = KERNAUX_MULTIBOOT2_ITAG_NONE,
|
2020-11-29 13:02:19 -05:00
|
|
|
.size = sizeof(multiboot2_with_two_boot_cmd_lines.tag_none),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2022-01-12 22:59:52 -05:00
|
|
|
assert(KernAux_Multiboot2_Info_is_valid(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1
|
2020-11-29 15:08:44 -05:00
|
|
|
));
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
assert(KernAux_Multiboot2_Info_is_valid(
|
|
|
|
&multiboot2_example2.multiboot2_info
|
2020-11-29 15:08:44 -05:00
|
|
|
));
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
assert(KernAux_Multiboot2_Info_is_valid(
|
|
|
|
&multiboot2_without_boot_cmd_line.multiboot2_info
|
2020-11-29 13:02:19 -05:00
|
|
|
));
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
assert(KernAux_Multiboot2_Info_is_valid(
|
|
|
|
&multiboot2_with_some_boot_cmd_line.multiboot2_info
|
2020-11-29 13:02:19 -05:00
|
|
|
));
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
assert(KernAux_Multiboot2_Info_is_valid(
|
|
|
|
&multiboot2_with_two_boot_cmd_lines.multiboot2_info
|
2020-11-29 13:02:19 -05:00
|
|
|
));
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_boot_cmd_line(
|
|
|
|
&multiboot2_without_boot_cmd_line.multiboot2_info
|
2020-11-29 13:02:19 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
// KernAux_Multiboot2_Info_first_tag_with_type
|
2020-11-29 15:08:44 -05:00
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_32BIT_SYSTEM_TABLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_64BIT_SYSTEM_TABLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_SMBIOS_TABLES
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_ACPI_NEW_RSDP
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_NETWORKING_INFO
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_MEMORY_MAP
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_BOOT_SERVICES_NOT_TERMINATED
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_32BIT_IMAGE_HANDLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
(struct KernAux_Multiboot2_Info*)multiboot2_example1,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_64BIT_IMAGE_HANDLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_NONE
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_none.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_BOOT_CMD_LINE
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_boot_cmd_line.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_BOOT_LOADER_NAME
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_boot_loader_name.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_module1.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_BASIC_MEMORY_INFO
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_basic_memory_info.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_FRAMEBUFFER_INFO
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_framebuffer_info.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_ELF_SYMBOLS
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_elf_symbols.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_APM_TABLE
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_apm_table.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_32BIT_SYSTEM_TABLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_efi_32bit_system_table_ptr.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_64BIT_SYSTEM_TABLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_efi_64bit_system_table_ptr.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_SMBIOS_TABLES
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_smbios_tables.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_ACPI_OLD_RSDP
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_acpi_old_rsdp.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_ACPI_NEW_RSDP
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_acpi_new_rsdp.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_NETWORKING_INFO
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_networking_info.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_MEMORY_MAP
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_efi_memory_map.tag.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_BOOT_SERVICES_NOT_TERMINATED
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_efi_boot_services_not_terminated.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_32BIT_IMAGE_HANDLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_efi_32bit_image_handle_ptr.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_EFI_64BIT_IMAGE_HANDLE_PTR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_efi_64bit_image_handle_ptr.base
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_IMAGE_LOAD_BASE_PHYS_ADDR
|
2020-11-29 15:08:44 -05:00
|
|
|
) == &multiboot2_example2.tag_image_load_base_phys_addr.base
|
|
|
|
);
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
// KernAux_Multiboot2_Info_tag_with_type_after
|
2020-11-29 16:06:25 -05:00
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_tag_with_type_after(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE,
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE
|
2020-11-29 16:06:25 -05:00
|
|
|
) - 1
|
2022-01-12 22:03:15 -05:00
|
|
|
) == (struct KernAux_Multiboot2_ITagBase*)
|
2020-11-29 16:06:25 -05:00
|
|
|
&multiboot2_example2.tag_module1
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_tag_with_type_after(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE,
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE
|
2020-11-29 16:06:25 -05:00
|
|
|
)
|
2022-01-12 22:03:15 -05:00
|
|
|
) == (struct KernAux_Multiboot2_ITagBase*)
|
2020-11-29 16:06:25 -05:00
|
|
|
&multiboot2_example2.tag_module2
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_tag_with_type_after(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE,
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_tag_with_type_after(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE,
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_first_tag_with_type(
|
|
|
|
&multiboot2_example2.multiboot2_info,
|
2022-01-12 21:49:25 -05:00
|
|
|
KERNAUX_MULTIBOOT2_ITAG_MODULE
|
2020-11-29 16:06:25 -05:00
|
|
|
)
|
|
|
|
)
|
|
|
|
) == 0
|
|
|
|
);
|
|
|
|
|
2022-01-12 22:59:52 -05:00
|
|
|
// KernAux_Multiboot2_Info_boot_cmd_line
|
2020-11-29 15:08:44 -05:00
|
|
|
|
2020-11-29 13:02:19 -05:00
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_boot_cmd_line(
|
|
|
|
&multiboot2_with_some_boot_cmd_line.multiboot2_info
|
2020-11-29 13:02:19 -05:00
|
|
|
) == multiboot2_with_some_boot_cmd_line.tag_boot_cmd_line.cmdline
|
|
|
|
);
|
|
|
|
|
|
|
|
assert(
|
2022-01-12 22:59:52 -05:00
|
|
|
KernAux_Multiboot2_Info_boot_cmd_line(
|
|
|
|
&multiboot2_with_two_boot_cmd_lines.multiboot2_info
|
2020-11-29 13:02:19 -05:00
|
|
|
) == multiboot2_with_two_boot_cmd_lines.tag_boot_cmd_line1.cmdline
|
|
|
|
);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|