For a few days I'm looking at my code of kernel. After fight with Multiboot 0.6 memory map I decided to update kernel to Multiboot 2.0. So I wrote header based on Multiboot 2.0 Specs and it starts on QEMU and VirtualBox.
The problem is that informations I requested from GRUB are not present in Multiboot Information Structure.
My Multiboot header:
Code: Select all
; Multiboot 2:
; Defining values:
MAGIC equ 0xE85250D6
ARCH equ 0x0
LENGHT equ header_end - header_start
CHECKSUM equ 0x100000000 - (MAGIC + ARCH + LENGHT)
; Defining header structure:
SECTION .multiboot
header_start:
dd MAGIC
dd ARCH
dd LENGHT
dd CHECKSUM
; Tags for Multiboot bootloader:
; Information request:
ALIGN 8
request_tag_start:
dw 1
dw 0
dd request_tag_end - request_tag_start
dd 1 ; CMD line,
dd 2 ; bootloader name,
dd 4 ; basic memory amount,
dd 6 ; memory map,
request_tag_end:
ALIGN 8
; End of tags, "NULL tag":
null_start:
dw 0 ; Type
dw 0 ; Flags
dd 8 ; Size
null_end:
header_end: ; End of Multiboot header!
Code: Select all
struct multiboot_tag *mbi = 0;
for (mbi = (struct multiboot_tag *) (mbi + 8); mbi->type != MULTIBOOT_TAG_TYPE_END; mbi = (struct multiboot_tag *) ((multiboot_uint8_t *) mbi + ((mbi->size + 7) & ~7)))
{
switch(mbi->type)
{
case MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME: ;
kprintf("BOOTLOADER: OK\n");
break;
case MULTIBOOT_TAG_TYPE_BASIC_MEMINFO: ;
kprintf("MEMINFO: OK\n");
break;
case MULTIBOOT_TAG_TYPE_CMDLINE: ;
kprintf("CMDLINE: OK\n");
break;
}
}
https://drive.google.com/open?id=1rSoI3 ... UTtmoeYP1m
I would like to know what i'm doing wrong.
Could someone explain it to me please?
Resto of code of OS on my GitHub:
https://github.com/StraykerPL/StrayexOS