From: Constantine Kousoulos <wuwei@freemail.gr>
To: grub-devel@gnu.org
Subject: boot on amd64
Date: Thu, 07 Jun 2007 20:27:27 +0300 [thread overview]
Message-ID: <46683FFF.9020500@freemail.gr> (raw)
Hello all,
I 'm building a (non linux) kernel natively on i386 and on amd64.
My linker script defines the first section to be one called
'boot'. This is where i put multiboot headers so that they are
within the first 8 bytes of the kernel image. Grub2 succesfully
retrieves the headers from the i386 build but not from the amd64
build. On amd64, i use the additional gcc flags '-mcmodel=kernel
-mno-red-zone'.
Grub2 complaints that 'no multiboot headers found'. This is very
interesting because they are found when booting an i386 image.
What can possibly confuse grub2 on amd64??
Thanks,
Constantine
This is the beginning of my boot.S:
.section .boot, "ax"
ENTRY(start)
jmp realstart
/*
* Multiboot header.
*/
.align 4
.long MULTIBOOT_MAGIC_OS /* 0x2badb002 */
.long MULTIBOOT_FLAGS /* 0x0 */
.long -(MULTIBOOT_FLAGS + MULTIBOOT_MAGIC_OS)
realstart:
...
Here's my linker script for amd64. The same linker script is used
on i386 with a different kernel_offset.
start_offset = 0x100000;
kernel_offset = 0xffffffff80000000;
real_start = start - kernel_offset;
boot_stack_size = 4096;
ENTRY(real_start)
SECTIONS
{
. = (start_offset + kernel_offset);
.boot ALIGN(4096) : AT(ADDR(.boot) - kernel_offset)
{
_boot = .;
*(.boot)
_eboot = .;
}
.bootdata ALIGN(4) : AT(ADDR(.bootdata) - kernel_offset)
{
_bootdata = .;
*(.bootdata)
_ebootdata = .;
}
.bootstack ALIGN(4096) : AT(ADDR(.bootstack) - kernel_offset)
{
_bootstack = .;
. += boot_stack_size;
_ebootstack = .;
}
.text ALIGN(4096) : AT(ADDR(.text) - kernel_offset)
{
_text = .;
*(.text)
_etext = .;
}
.rodata ALIGN(4) : AT(ADDR(.rodata) - kernel_offset)
{
_rodata = .;
*(.rodata)
_erodata = .;
}
.data ALIGN(4096) : AT(ADDR(.data) - kernel_offset)
{
_data = .;
*(.data)
_edata = .;
}
.bss ALIGN(4) : AT(ADDR(.bss) - kernel_offset)
{
_bss = .;
*(.bss)
_ebss = .;
}
_end = .;
}
reply other threads:[~2007-06-07 17:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46683FFF.9020500@freemail.gr \
--to=wuwei@freemail.gr \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.