38 lines
1009 B
C
38 lines
1009 B
C
#ifndef MULTIBOOT2_H
|
|
#define MULTIBOOT2_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#define MULTIBOOT2_MAGIC 0xE85250D6u
|
|
#define MULTIBOOT2_ARCHITECTURE_I386 0u
|
|
|
|
typedef struct {
|
|
uint32_t magic;
|
|
uint32_t architecture;
|
|
uint32_t header_length;
|
|
uint32_t checksum;
|
|
} multiboot2_header_t;
|
|
#define multiboot2_header(magic, architecture, header_length) \
|
|
{(magic), (architecture), (header_length), (uint32_t)(0x100000000u - (magic) - (architecture) - (header_length))}
|
|
#define multiboot2_header_default() \
|
|
multiboot2_header(MULTIBOOT2_MAGIC, MULTIBOOT2_ARCHITECTURE_I386, sizeof(multiboot2_header_t))
|
|
|
|
typedef struct {
|
|
uint16_t type;
|
|
uint16_t flags;
|
|
uint32_t size;
|
|
} multiboot2_tag_t;
|
|
#define multiboot2_end_tag() {0u, 0u, 8u}
|
|
|
|
typedef struct {
|
|
multiboot2_tag_t header;
|
|
uint32_t width;
|
|
uint32_t height;
|
|
uint32_t depth;
|
|
uint32_t _padding;
|
|
} multiboot2_framebuffer_tag_t;
|
|
#define multiboot2_framebuffer_tag(width, height, depth) \
|
|
{{5u, 0u, 20u}, width, height, depth}
|
|
|
|
#endif
|