github link: https://github.com/JustVic/kernel_grub_multiboot_info
in the _start function I copied multiboot2 magic number and info addres to variables:
Code: Select all
_start:
movl $stack_top, %esp
movl %eax, multiboot_magic
movl %ebx, multiboot_info
Code: Select all
.data
multiboot_magic:
.long 0
multiboot_info:
.long 0
Code: Select all
.code64
.global _start64
.type _start64, @function
_start64:
// Setup segment selectors
movw $0, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
movw %ax, %ss
mov multiboot_magic, %rsi
mov multiboot_info, %rdi
call cmain
Code: Select all
int cmain(unsigned long addr, unsigned long magic)
{
}
What I did wrong? And How to send memory map data to c lang after 64-bit long mode setup from grub multiboot info?
Screenshot of the wrong data:
https://pixelfed-prod.nyc3.cdn.digitalo ... w2VOio.png