bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem loading a multiboot kernel


From: Vincent Girard-Reydet
Subject: Problem loading a multiboot kernel
Date: Tue, 29 Jul 2003 10:05:37 +0200
User-agent: KMail/1.5

Hi everyone !

Hope this is the rightplace to post my question. I'm currently working on a 
kernel that I made multiboot compliant.

This kernel is linked as an ELF program, section .text starting at 0xc0000000.
As I need to configure the paged memory before switching to high addresses, I 
must load my kernel at a much lower address. So I ask in my Multiboot header 
to be loaded at 0x100000, and I use translation tricks (leal and co) to get 
my code working untill the pagination is activated.

But Grub won't load my kernel. I checked the addresses in the Multiboot header 
with objdump, they are correct. I put an instruction that prints a character 
on the screen and loops at the cery end of my kernel, to only check if I'm 
booted. But the machine reboots when Grub loads the kernel.

I include my linker script and the beginning of my first file. If someone have 
an idea of what the problem is, please help me, I'm stuck on it since 3 days 
!

Many thanks.

Vincent Girard-Reydet


excerpt from multiboot.S, which is linked at the beginning of my kernel image:

.text
        .align 4
.globl start, _start

start:
_start:
        jmp     boot_entry

        /* MultiBoot header - see multiboot.h.  */
        .align (1<<2)
boot_hdr:
        .long   MULTIBOOT_HEADER_MAGIC  /* magic */
        .long   MULTIBOOT_HEADER_FLAGS  /* feature flags */
        .long   -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)/* checksum */
        .long   boot_hdr - _start + 0x00100000  /* header_addr */
        .long   0x00100000 /* load_addr */
        .long   _edata - _start + 0x00100000    /* load_end_addr */
        .long   _end - _start + 0x00100000      /* bss_end_addr */
        .long   boot_entry - _start + 0x00100000        /* entry */

boot_entry:

        movl $0xb8000,%edx
        movb    $0x31,0(%edx)
        movb $0xa4, 1(%edx)
hello:
        jmp hello


and here is my linker script:

SECTIONS
{
        . = 0xC0000000;
        _stext = .;
    .text : { 
                *(.text .text.*)
                _etext = .;
        }
    .data : {
                *(.rodata .data .sdata .sdata2)
                _edata = .;
        }
    __bss_start = .;
    .bss : {
         *(.bss .sbss)
         }
    _end = . ;
}


I tried using the AT command :

.text 0xC0000000:AT(0x00100000) {
...

 but this doesn't work either.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]