1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/examples/bootloader-multiboot2-limine/multiboot2.c

29 lines
856 B
C
Raw Normal View History

2022-01-14 00:40:51 -05:00
#include <kernaux/multiboot2.h>
2022-01-14 01:38:21 -05:00
// TODO: add more tags
2022-01-14 01:05:13 -05:00
__attribute__((section(".multiboot2"), used))
2022-01-14 00:44:44 -05:00
__attribute__((aligned(KERNAUX_MULTIBOOT2_HEADER_ALIGN)))
2022-01-14 00:40:51 -05:00
const struct {
struct KernAux_Multiboot2_Header multiboot2_header;
struct KernAux_Multiboot2_HTag_None tag_none;
2022-01-14 00:54:04 -05:00
}
__attribute__((packed))
multiboot2_header = {
2022-01-14 00:40:51 -05:00
.multiboot2_header = {
.magic = KERNAUX_MULTIBOOT2_HEADER_MAGIC,
2022-01-14 01:20:16 -05:00
.arch = KERNAUX_MULTIBOOT2_HEADER_ARCH_I386,
2022-01-14 00:40:51 -05:00
.total_size = sizeof(multiboot2_header),
.checksum = KERNAUX_MULTIBOOT2_HEADER_CHECKSUM(
2022-01-14 01:20:16 -05:00
KERNAUX_MULTIBOOT2_HEADER_ARCH_I386,
2022-01-14 00:40:51 -05:00
sizeof(multiboot2_header)
),
},
.tag_none = {
.base = {
.type = KERNAUX_MULTIBOOT2_HTAG_NONE,
.flags = 0,
.size = sizeof(multiboot2_header.tag_none),
},
},
};