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

[Xen-devel] Mini-OS Makefile and Cross Compilation



Mini-OS developers:

I acquired a Core 2 Duo machine, and decided to see if I could get a
32-bit Mini-OS application running using a 64-bit hypervisor.  I'm
running Fedora Core 6 for hardware platform x86_64 using its packaging
of the Xen hypervisor.  The Mini-OS sources were obtained today from
xen-unstable.hg.

I built binutils 2.17, gcc 4.1.2, and newlib 1.5.0 with a target of
i386-elf, and installed them into $HOME/opt/i386-elf.

$ cd $HOME/opt/i386-elf
$ ls i386-elf/bin
ar  as  c++  g++  gcc  ld  nm  objdump  ranlib  strip
[ramsdell@mm144697-pc i386-elf]$ ls bin
i386-elf-addr2line  i386-elf-cpp        i386-elf-gcov     i386-elf-ranlib
i386-elf-ar         i386-elf-g++        i386-elf-ld       i386-elf-readelf
i386-elf-as         i386-elf-gcc        i386-elf-nm       i386-elf-size
i386-elf-c++        i386-elf-gcc-4.1.2  i386-elf-objcopy  i386-elf-strings
i386-elf-c++filt    i386-elf-gccbug     i386-elf-objdump  i386-elf-strip

I first tried to build an application on top of Mini-OS, so I
attempted to build libminios.a with:

$ make CROSS_COMPILE=$HOME/opt/i386-elf/i386-elf/bin/ \
      TARGET_ARCH=x86_32 CPPFLAGS=-DHAVE_LIBC libminios.a

I found there is no rule for the libminios.a target, or one for the
all target.  Okay, lets get more conservative.

I decided to try to build just Mini-OS with:

$ make CROSS_COMPILE=$HOME/opt/i386-elf/i386-elf/bin/ TARGET_ARCH=x86_32
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
/home/ramsdell/opt/i386-elf/i386-elf/bin/gcc -fno-builtin -Wall -Werror 
-Wredundant-decls -Wno-format -Wstrict-prototypes -Wnested-externs 
-Wpointer-arith -Winline -D__XEN_INTERFACE_VERSION__=0x00030205 -g -m64 
-mno-red-zone -fpic -fno-reorder-blocks -fno-asynchronous-unwind-tables 
-I/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include  
-I/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/x86 
-I/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/x86/x86_64 -c 
events.c -o events.o
events.c:1: sorry, unimplemented: 64-bit mode not compiled in
In file included from 
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/x86/os.h:20,
                 from events.c:19:
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/hypervisor.h:19:30: 
error: hypercall-x86_32.h: No such file or directory
cc1: warnings being treated as errors
In file included from events.c:22:
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/events.h: In function 
'notify_remote_via_evtchn':
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/events.h:45: warning: 
implicit declaration of function 'HYPERVISOR_event_channel_op'
/home/ramsdell/scm/xen-unstable.hg/extras/mini-os/include/events.h:45: warning: 
nested extern declaration of 'HYPERVISOR_event_channel_op'
make: *** [events.o] Error 1
$ 

Some how, setting TARGET_ARCH=x86_32 was not enough to convince the
makefile to think 32-bits.  What was I supposed to do?  

I decided to carefully read the makefiles in the Mini-OS directories.
I discovered that the one in the root directory calls for $(OBJCOPY).
When using a cross compiler, this variable evaluates to objcopy, but
the installation of a cross compiler does not produce a binary named
objcopy.  When the target is i386-elf, it puts i386-elf-objcopy in the
bin directory where it is installed, but objcopy is not put the
i386-elf/bin directory.  Is this makefile intended to be used with a
cross compiler?  I'd gladly specify a target of i386-elf on the
command line if that helps.

I promise to submit a text document to be placed in the Mini-OS root
directory describing how to use its makefile with a cross compiler if
given the information need to complete this document by you all.

John

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.