[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem loading a multiboot kernel
From: |
Vincent Girard-Reydet |
Subject: |
Re: Problem loading a multiboot kernel |
Date: |
Wed, 30 Jul 2003 10:25:59 +0200 |
User-agent: |
KMail/1.5 |
Hi,
The reboot occures only when I specify a VMA different from the LMA in the
linker script.
In fact, it seems that Grub always follows the ELF header when ther's one,
even if a a.out kludge is provided. The header of my file lokks like this :
1b ad b0 02 // magic
00 01 00 02 // flags, including the A.OUT kludge bit
e4 51 4f fc // checksum
00 01 00 04 // header address
00 01 00 00 /load start
00 01 8c 68 // load end
00 11 be d4 // bss end
00 01 00 24 // entry point
So normally I should be loaded and started to about 0x100000. But when I try
booting, Grub tells me
[Multiboot-elf, <0xc0000000:0x8c68:0x1326c>
Error 28: Selected item cannot fit into memory.
Le Mercredi 30 Juillet 2003 08:44, Vincent Girard-Reydet a écrit :
> Le Mercredi 30 Juillet 2003 02:47, Jeff Sheinberg a écrit :
> > Vincent Girard-Reydet writes:
> > > 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.
> >
> > Have you tried "mbchk YOUR_KERNEL", try "info mbchk" for details.
>
> Here is the output of mbchk :
>
> The Multiboot header is found at the offset 4100.
> /mnt/tmp/kernel.bin: Page alignment is turned off.
> /mnt/tmp/kernel.bin: Memory information is turned on.
> /mnt/tmp/kernel.bin: Address fields is turned on.
> /mnt/tmp/kernel.bin: All checks passed.
>
> For info, here are the ELF headers of my file :
>
> bash-2.05b$ objdump -ph /mnt/tmp/kernel.bin
>
> /mnt/tmp/kernel.bin: file format elf32-i386
>
> Program Header:
> LOAD off 0x00001000 vaddr 0xc0000000 paddr 0xc0000000 align 2**12
> filesz 0x00008c68 memsz 0x0001bed4 flags rwx
>
> Sections:
> Idx Name Size VMA LMA File off Algn
> 0 .text 000050f7 c0000000 c0000000 00001000 2**2
> CONTENTS, ALLOC, LOAD, READONLY, CODE
> 1 .data 00003b68 c0005100 c0005100 00006100 2**5
> CONTENTS, ALLOC, LOAD, DATA
> 2 .bss 00012ed4 c0009000 c0009000 0000a000 2**12
> ALLOC
> 3 .debug_line 00003a3a 00000000 00000000 0000a000 2**0
> CONTENTS, READONLY, DEBUGGING
> 4 .debug_info 00009b3d 00000000 00000000 0000da3a 2**0
> CONTENTS, READONLY, DEBUGGING
> 5 .debug_abbrev 000020b7 00000000 00000000 00017577 2**0
> CONTENTS, READONLY, DEBUGGING
> 6 .debug_aranges 00000470 00000000 00000000 00019630 2**3
> CONTENTS, READONLY, DEBUGGING
> 7 .debug_frame 0000124c 00000000 00000000 00019aa0 2**2
> CONTENTS, READONLY, DEBUGGING
> 8 .debug_pubnames 0000060c 00000000 00000000 0001acec 2**0
> CONTENTS, READONLY, DEBUGGING
> 9 .debug_str 0000168c 00000000 00000000 0001b2f8 2**0
> CONTENTS, READONLY, DEBUGGING
> 10 .comment 00000640 00000000 00000000 0001c984 2**0
> CONTENTS, READONLY