QEMU/GRUB: No multiboot header found
Joel Sherrill
joel.sherrill at OARcorp.com
Tue Dec 23 00:47:36 UTC 2008
Chris Johns wrote:
> Massimo Tipaldi wrote:
>
>> Dear Joel,
>>
>> I have followed your suggestions, but unfortunately the same behaviour
>> is observed.
>>
>>
The file hello.ralf should have had bin2boot run on it.
All of Chris' comments also apply. Please use 4.9.1
or the CVS head with matching tools.
>> In any case, I would like to point out some important points:
>>
>> 1) to compile RTEMS, in the directory /d/opt/rtems-4.9/bin, I was
>> obliged to rename all the files in order to remove the version number
>> (for instance, i386-rtems4.9-g++.exe --> i386-g++.exe).
>>
>
> This is wrong and should not be done. It usually means you have not configured
> RTEMS correctly. The Wiki entry:
>
> http://www.rtems.org/wiki/index.php/MinGW_Tools_for_Windows#Building_RTEMS
>
> says:
>
> ../rtems-4.9.0/configure --target=m68k-rtems4.9 --enable-multilib \
> --prefix=/c/opt/src/rtems/m68k
>
> Please note the version number. Could you please try a configure this way ?
>
>
>> 2) to produce my Hello Word, I have updated the Makefile.inc
>> (/d/opt/rtems-4.9/build-rtems/i386/c/pc386/make):
>>
>> .....
>>
>> prefix = /d/opt/rtems-4.9/build-rtems/i386/c/pc386
>> exec_prefix = /opt/rtems-4.9/i386-rtems
>>
>> CC_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-gcc --pipe
>> -I/d/opt/rtems-4.9/build-rtems/i386/pc386/lib/include
>>
>> CXX_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-g++
>> AS_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-as
>> AR_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-ar
>> NM_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-nm
>> LD_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-ld
>> SIZE_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-size
>> OBJCOPY_FOR_TARGET = /d/opt/rtems-4.9/bin/i386-objcopy
>>
>> CC= $(CC_FOR_TARGET)
>> CXX= $(CXX_FOR_TARGET)
>> AS= $(AS_FOR_TARGET)
>> LD= $(LD_FOR_TARGET)
>> NM= $(NM_FOR_TARGET)
>> AR= $(AR_FOR_TARGET)
>> SIZE= $(SIZE_FOR_TARGET)
>> OBJCOPY= $(OBJCOPY_FOR_TARGET)
>>
>>
>> PROJECT_TOOLS = /d/opt/rtems-4.9/build-rtems/i386/pc386/build-tools
>> export PROJECT_TOOLS
>>
>>
>> ......
>>
>> 3) inside the MSYS shell, before launching the make command, I have
>> carried out the following:
>> export
>> RTEMS_MAKEFILE_PATH=/d/opt/rtems-4.9/build-rtems/i386/c/pc386/make
>> export ARCH=/d/opt/rtems-4.9/examples-4.9.1/hello_world_c
>>
>>
>> After that I have launched the make command in the folder:
>> /d/opt/rtems-4.9/examples-4.9.1/hello_world_c
>> My Hello Word is successfully compiled, but it is not correctly managed
>> by QEMU ("No multiboot Header found").
>> What I can further add, is that the dimension of my Hello Word is 17 Kb,
>> whereas the dimension of the Hello Word that comes from the RTEMS
>> compliation is about 1 Mb.
>>
>> Does it sound strange? Should I modify the makefiles further in order to
>> produce an executable file in line with the rtems boot loader multiboot
>> specification? Can you suggest me something else?
>>
>
> I would rather you go back and try the correct configure command then work
> though the build issues. Lets sort out one problem at a time.
>
>
>> Thanks in advance and I wish you a Merry Christmas and Happy New Year.
>>
>>
>
> Thanks and to you also.
>
> Regards
> Chris
>
>
>> Massimo
>>
>>
>>
>>
>> Joel Sherrill ha scritto:
>>
>>> Massimo Tipaldi wrote:
>>>
>>>> Dear all,
>>>>
>>>> I have installed all the RTEMS tools on Windows, compiled RTEMS 4.9
>>>> (--target=i386-rtems and bsp=pc386) and installed QEMU as detailed in:
>>>>
>>>> http://www.rtems.com/wiki/index.php/MinGW_Tools_for_Windows
>>>> http://www.rtems.com/wiki/index.php/QEMU
>>>>
>>>> All these operations went well.
>>>>
>>>> Therefore, I have tried to launch some RTEMS applications by means of
>>>> QEMU/GRUB (in this phase I have taken the executable files produced
>>>> during the RTEMS compilation phase, placed in /testsuites/samples): this
>>>> operation was successfull as well.
>>>>
>>>> After that I have compiled successfully Hello Word by myself
>>>> (examples-4.7.99.2.tar.bz2
>>>> ftp://ftp.rtems.com/pub/rtems/4.7.99.2/examples-4.7.99.2.tar.bz2
>>>> ) and put my hello.exe in the folder /testsuites/samples/hello).
>>>> With my Hello Word, the GRUB gives me the message "No multiboot header
>>>> found".
>>>>
>>>>
>>>>
>>> Very old examples. Please use the ones which match 4.9.
>>>
>>> This sounds like a bug which was fixed between 4.9.0 and 4.9.1.
>>>
>>> 1337/bsps - Stripping .rodata section produces unusable executables for
>>> the i386-rtems target.
>>>
>>>> As far as I have understood, my hello.exe does not have a multiboot
>>>> header.
>>>> How can I overcome this issue? Should I modify somehow my source code or
>>>> the makefiles in order to create this multiboot header into my .exe?
>>>>
>>>>
>>>> Thanks in advance
>>>>
>>>> Massimo Tipaldi
>>>>
>>>>
>>>>
>>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list