yboot2-proto/include/protocol.h
2020-09-27 12:00:36 +03:00

56 lines
1.1 KiB
C

// TODO: cbindgen doesn't work lmao
#pragma once
#define YB_CMDLINE_SIZE 256
#define YB_KERNEL_MAGIC_V1 {0x07, 0xB0, 0x07, 0xB0, 0xA9, 0x97, 0xA1, 0x00}
#define YB_LOADER_MAGIC_V1 {0x1A, 0x79, 0x9A, 0x0B, 0x70, 0x0B, 0x70, 0x00}
#define YB_FLAG_VIDEO (1 << 0)
#define YB_FLAG_INITRD (1 << 1)
#define YB_FLAG_UPPER (1 << 2)
#define YB_LFB_BGR32 0
#define YB_LFB_RGB32 1
#define YB_LFB_ANY 2
#define YB_TEXT 3
#if !defined(__ASM__)
#include <stdint.h>
struct yb_header {
uint8_t kernel_magic[8];
uint8_t loader_magic[8];
};
struct yb_video_info {
uint32_t width, height;
uint32_t format;
uint64_t framebuffer, pitch;
};
struct yb_memory_map_info {
uint64_t address;
uint32_t size, entsize;
};
struct yb_elf_tables {
uint64_t symtab_hdr, symtab_data;
uint64_t strtab_hdr, strtab_data;
};
struct yb_proto_v1 {
struct yb_header hdr;
uint32_t flags;
struct yb_video_info video;
struct yb_memory_map_info memory_map;
struct yb_elf_tables elf_tables;
uint64_t initrd_base, initrd_size;
uint64_t rsdp;
char cmdline[YB_CMDLINE_SIZE];
};
#endif