All of lore.kernel.org
 help / color / mirror / Atom feed
From: Constantine Kousoulos <wuwei@freemail.gr>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: multiboot header error
Date: Wed, 30 May 2007 18:51:37 +0300	[thread overview]
Message-ID: <465D9D89.1010904@freemail.gr> (raw)
In-Reply-To: <465C756E.8000506@freemail.gr>

Here is a sample kernel, built as elf64, that simply refuses to 
boot. It consists of only two files: boot.S and multiboot.h. It 
does absolutely nothing and it is a cut-down version of the kernel 
found at 
http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Example-OS-code 
or in grub-0.97/docs.

boot.S:
#include "multiboot.h"
	.text
	.globl	start, _start
start:
_start:
	jmp	multiboot_entry

	/* Align 64 bits boundary.  */
	.align	8
	
multiboot_header:
	.long	MULTIBOOT_HEADER_MAGIC
	.long	MULTIBOOT_HEADER_FLAGS
/*	.long	-(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)*/

multiboot_entry:
	/* Initialize the stack pointer.  */
	movq	$(stack + STACK_SIZE), %rsp

	/* Reset EFLAGS.  */
	pushq	$0
	popf

	/* Push the pointer to the Multiboot information structure.  */
	pushq	%rbx
	/* Push the magic value.  */
	pushq	%rax

loop:	hlt
	jmp	loop

	/* Our stack area.  */
	.comm	stack, STACK_SIZE
	
multiboot.h:
#define MULTIBOOT_HEADER_MAGIC		0xe85250d6
#define MULTIBOOT_HEADER_FLAGS		0x00000000
#define STACK_SIZE			0x4000

Makefile.am:
noinst_PROGRAMS = kernel
kernel_SOURCES = boot.S multiboot.h
kernel_CFLAGS = -fno-builtin -nostdinc -O -g -Wall
kernel_LDFLAGS = -nostdlib


All i get from GRUB2 is "error: No multiboot header found". I have 
tried changing the magic number to 0xd65052e8 to make sure i got 
it ok, but it still doesn't boot. The flags are all zero according 
to the next version of the Multiboot Spec. The same document 
doesn't say anything about a checksum in the multiboot header, so 
i commented it out.

What do you think is to blame for this behaviour?

Thanks,
Constantine



  reply	other threads:[~2007-05-30 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-29 18:48 multiboot header error Constantine Kousoulos
2007-05-30 15:51 ` Constantine Kousoulos [this message]
2007-05-31 18:51   ` Constantine Kousoulos

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=465D9D89.1010904@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.