How to enable the graphic mode by grub2?
Posted: Wed Jun 29, 2022 2:27 am
I'm sorry my English is poor, but I will try my best to express the problem clearly.
This is my multiboot2 header, but it doesn't work
It works well.
When I insert the following line to enable the graphic mode
I get "error: unsupported tag 0x8"
what's wrong with it
This is my multiboot2 header, but it doesn't work
Code: Select all
struct os_header {
struct multiboot_header header;
#ifdef VBE_ENABLE
struct multiboot_header_tag_framebuffer framebuffer;
#endif
struct multiboot_header_tag end;
} __attribute__((packed));
struct os_header OS_HEADER __attribute__((section(".multiboot"))) = {
.header = {
.magic = MULTIBOOT2_HEADER_MAGIC,
.architecture = MULTIBOOT_ARCHITECTURE_I386,
.header_length = sizeof (struct tayhuang_header),
.checksum = -(MULTIBOOT2_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + sizeof(struct tayhuang_header)),
},
#ifdef VBE_ENABLE
#define FRAMEBUFFER_WIDTH 1024
#define FRAMEBUFFER_HEIGHT 768
#define FRAMEBUFFER_BPP 24
//FIXME: Error here
.framebuffer = {
.type = MULTIBOOT_HEADER_TAG_FRAMEBUFFER,
.flags = MULTIBOOT_HEADER_TAG_OPTIONAL,
.size = sizeof (struct multiboot_header_tag_framebuffer),
.width = FRAMEBUFFER_WIDTH,
.height = FRAMEBUFFER_HEIGHT,
.depth = FRAMEBUFFER_BPP
},
#endif
.end = {
.type = MULTIBOOT_HEADER_TAG_END,
.flags = 0,
.size = sizeof (struct multiboot_header_tag)
}
};
When I insert the following line to enable the graphic mode
Code: Select all
#define VBE_ENABLE
what's wrong with it