[okl4-developer] adding a guest RTOS
Geoffrey Lee
glee at ok-labs.com
Tue Aug 5 22:02:08 EST 2008
On Tue, Aug 05, 2008 at 01:34:29PM +0200, Antonin SUBTIL wrote:
> Hello;
>
> I've done my elf :D and I succeded in merging to okl4 to produce image.elf.
> I made a few change in build.py (add an argument) and
> project/iguana/scontruct (elf_image= arg) so OKL4 toolchain would use my
> build/image/test/image.elf instead of build/images/image.elf when producing
> a image disk for simulation.
>
> But it doesn't work... everything seems to be ok in toolchain, but when
> grubs starts running on qemu, there is a mistake :
> Booting 'L4 NICTA::Iguana'
Hi Antonin
It appears you are trying to load something that is too big. Please
provide a segment/section dump of your program.
-gl
>
> root (hd0,0)
> Filesystem type is fat, partition type 0x6
> kernel=/boot/grub/image.elf
> [Multiboot-elf, <0x100000:0x17f40:0x0>, <0x118000:0xcc14:0x203ec>,
> <0x145000
> :0x23820:0x0>, <0x1e0000:0xa3cb:0x0>, <0x1da3e0:0x1b0:0x124>,
> <0x200000:0x5a40:
> 0x0>, <0x1dea40:0x120:0x15c>, <0x208000:0x7280:0x0>, <0x1ed280:0x25c:0x1cc>,
> <0
> x230000:0x73b3:0x0>, <0x2073c0:0x44c:0x484>, <0x250000:0x7813:0x0>,
> <0x23b820:0
> x27c:0x1b0>, <0x258000:0x56e0:0x0>, <0x23f6e0:0x120:0x108>,
> <0x280000:0x4000:0x
> 0>, shtab=0x2845f0(bad)
>
> Error 28: Selected item cannot fit into memory
>
> Press any key to continue...
>
> I check (readelf) my test/image.elf, and it looks like a normal one, except
> there's still a symtab. I didn't use "stack size" in weaver.xml. that's my 2
> clues.
> do you have any idea???
>
> thanks
>
> antonin
>
> ----
> === MERGE 2 ELF with ELFWEAVER ===
> 1/ cd okl4_2.1/build/images/
> 2/ vi weaver.xml (et adapter l'xml)
> 3/ ~/okl4_2.1/tools/pyelf/elfweaver merge weaver.xml --output=img.elf
>
> === cross-COMPILER un programme en ELF pour OKL4 (en vue d'un merge ===
> (essai de HELLO WORLD)
>
> ~/opt/nicta/gcc-3.3.4-glibc-2.3.3/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-gcc
> --std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
> -Wmissing-declarations -Wredundant-decls -Wundef -Wpointer-arith
> -Wno-nonnull -Werror -O2 -nostdlib -nostdinc -g -DCONFIG_CPU_IA32_I686
> -DCONFIG_CPU_IA32_I686 -DARCH_IA32 -DMACHINE_IA32_PC99 -DENDIAN_LITTLE
> -DWORDSIZE_32 -DKENGE_IGUANA -DTHREAD_SAFE -DMAX_ELF_SEGMENTS=1000
> -DIGUANA_VERSION=20060101UL -DCONFIG_MAX_THREAD_BITS=10
> -DCONFIG_STRICT_SCHEDULING=1 -DCONFIG_SCHEDULE_INHERITANCE=1 -DCONFIG_EAS=1
> -DCONFIG_ZONE=1 -DCONFIG_MEM_PROTECTED=1 -DCONFIG_MEMLOAD=1
> -DCONFIG_REMOTE_MEMORY_COPY=1 -DCONFIG_USER_MUTEXES=1 -D__L4_ARCH__=ia32
> -DL4_ARCH_IA32 -I~/okl4_2.1/build/iguana/include hello_world_elf.c -c -o
> hello_world_elf.o
>
> ~/okl4_2.1/tools/pyelf/elfadorn -s -o hello_world_elf.elf --
> ~/opt/nicta/gcc-3.3.4-glibc-2.3.3/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-ld
> -Ttext=9050000 ~/okl4_2.1/build/iguana/lib/crt0.o hello_world_elf.o
> -L~/okl4_2.1/build/iguana/lib --start-group -lgcc -lc -lll -lrtos -ll4
> -lmutex -ll4e -lcircular_buffer -liguana -lgcc --end-group -o
> hello_world_elf.elf
>
>
>
>
>
>
> Le 1 août 2008 02:12, Geoffrey Lee <glee at ok-labs.com> a écrit :
>
> > On Thu, Jul 31, 2008 at 02:54:37PM +0200, Antonin SUBTIL wrote:
> > > Thanks....
> > > Yet I wasn't able to do this compilation...
> > > I runned GCC to compile, I runned GCC/LD+ELFADORN to link... but it does
> > not
> > > work. (I've got an elf who refuse to merge with the same mistake).
> > > " ~/okl4_2.1/tools/pyelf/elfadorn -s -o hello.elf --
> > >
> > ~/opt/nicta/gcc-3.3.4-glibc-2.3.3/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-gcc
> > > hello_world_elf.o -o hello.elf -lc -lgcc"
> >
> >
> > If you must compile an executable out of the OKL4 build system
> > I suggest you try to compile some of our example program and
> > take a look at the build/link flags that they use. You can enable
> > verbose mode with verbose_str=True.
> >
> > -gl
> >
> > >
> > >
> > > Then my question is : what kind of args should I had to GCC, GCC/LD or
> > > Elfadorn to produce an Elf for OKL4 ?
> > >
> > > Thanks
> > >
> > > Antonin
> > >
> > > Le 29 juillet 2008 12:41, Geoffrey Lee<glee at ok-labs.com> a écrit :
> > >
> > > > On Tue, Jul 29, 2008 at 12:33:01PM +0200, Antonin SUBTIL wrote:
> > > > > hi back,
> > > > >
> > > > >
> > > > > I mean, when I make an small HELLOWORLD -> compile -> elf, then
> > elfweaver
> > > > > says :
> > > > >
> > > > > Error: Unable to handle segments that aren't of type LOAD (found type
> > > > 0x3)
> > > > >
> > > > > ///////////////////////////////////////// command I used
> > > > > gcc -c helloworld.c
> > > > > gcc helloworld.o -o hello_world_elf.elf
> > > > > ~/okl4_2.1/tools/pyelf/elfweaver merge weaver.xml --output=image.elf
> > > >
> > > >
> > > > You should not compile dynamically-linked executables intended for the
> > host
> > > > system rather than the target system. Type 0x3 is PT_INTERP. For more
> > > > details on what the segments mean you can check /usr/include/elf.h,
> > which
> > > > should be available on Linux systems.
> > > >
> > > > -gl
> > > >
> > > > >
> > > > > //////////////////////////////////////----------------------
> > weaver.xml
> > > > > ------------------------------
> > > > > <?xml version="1.0"?>
> > > > > <!DOCTYPE image SYSTEM "weaver-1.1.dtd">
> > > > > <image>
> > > > > <machine>
> > > > > <word_size size="0x20" />
> > > > > <virtual_memory name="virtual">
> > > > > <region base="0x200000" size="0x3fe00000" />
> > > > > </virtual_memory>
> > > > > <physical_memory name="bios">
> > > > > <region base="0xf0000" size="0x10000" type="dedicated" />
> > > > > </physical_memory>
> > > > > <physical_memory name="vga">
> > > > > <region base="0xa0000" size="0x20000" type="dedicated" />
> > > > > </physical_memory>
> > > > > <physical_memory name="physical">
> > > > > <region base="0x100000" size="0x7f00000"
> > type="conventional"
> > > > />
> > > > > </physical_memory>
> > > > > <physical_memory name="system_dram">
> > > > > <region base="0x0" size="0xa000" type="dedicated" />
> > > > > </physical_memory>
> > > > > <physical_memory name="rom_expansion">
> > > > > <region base="0xc0000" size="0x30000" type="dedicated" />
> > > > > </physical_memory>
> > > > > <phys_device name="timer_dev">
> > > > > <interrupt name="int_timer0" number="0" />
> > > > > </phys_device>
> > > > > <phys_device name="serial_dev">
> > > > > <interrupt name="int_serial0" number="4" />
> > > > > </phys_device>
> > > > > <phys_device name="rtc_dev">
> > > > > </phys_device>
> > > > > <page_size size="0x1000" />
> > > > > <page_size size="0x400000" />
> > > > > </machine>
> > > > > <physical_pool name="bios" direct="true">
> > > > > <memory src="bios" />
> > > > > </physical_pool>
> > > > >
> > > > > <physical_pool name="vga" direct="true">
> > > > > <memory src="vga" />
> > > > > </physical_pool>
> > > > >
> > > > > <physical_pool name="physical" direct="true">
> > > > > <memory src="physical" />
> > > > > </physical_pool>
> > > > >
> > > > > <physical_pool name="system_dram" direct="true">
> > > > > <memory src="system_dram" />
> > > > > </physical_pool>
> > > > >
> > > > > <virtual_pool name="virtual">
> > > > > <memory src="virtual" />
> > > > > </virtual_pool>
> > > > >
> > > > > <physical_pool name="rom_expansion" direct="true">
> > > > > <memory src="rom_expansion" />
> > > > > </physical_pool>
> > > > >
> > > > > <kernel file="/users/antonin/okl4_2.1/build/pistachio/bin/kernel"
> > > > > xip="false" >
> > > > > <dynamic max_threads="0x400" />
> > > > > <config>
> > > > > <option key="root_caps" value="4096"/>
> > > > > </config>
> > > > > </kernel>
> > > > >
> > > > > <rootprogram
> > > > > file="/users/antonin/okl4_2.1/build/iguana_server/bin/ig_server"
> > > > > virtpool="virtual" physpool="physical" >
> > > > > </rootprogram>
> > > > >
> > > > > <program name="event"
> > > > > file="/users/antonin/okl4_2.1/build/iguana/bin/event" priority="200"
> > > > > server="OKL4_EVENT_SERVER" >
> > > > > </program>
> > > > >
> > > > > <program name="vtimer"
> > > > > file="/users/antonin/okl4_2.1/build/iguana/bin/vtimer" priority="240"
> > > > > server="OKL4_VTIMER_SERVER" >
> > > > > <virt_device name="vtimer0" />
> > > > > <virt_device name="vtimer1" />
> > > > > <environment>
> > > > > <entry key="TIMER_RESOURCE" cap="/dev/timer_dev" />
> > > > > </environment>
> > > > > </program>
> > > > >
> > > > > <program name="vserial"
> > > > > file="/users/antonin/okl4_2.1/build/iguana/bin/vserial"
> > priority="110"
> > > > > server="OKL4_VSERIAL_SERVER" >
> > > > > <virt_device name="vserial0" />
> > > > > <environment>
> > > > > <entry key="SERIAL_RESOURCE" cap="/dev/serial_dev" />
> > > > > <entry key="VTIMER" cap="/dev/vtimer0" />
> > > > > </environment>
> > > > > </program>
> > > > >
> > > > > <program name="vrtc"
> > > > > file="/users/antonin/okl4_2.1/build/iguana/bin/vrtc" priority="240"
> > > > > server="OKL4_VRTC_SERVER" >
> > > > > <environment>
> > > > > <entry key="RTC_RESOURCE" cap="/dev/rtc_dev" />
> > > > > </environment>
> > > > > </program>
> > > > >
> > > > > <program name="hello_world_elf"
> > > > > file="/users/antonin/okl4_2.1/build/images/hello_world_elf.elf"
> > > > > priority="100">
> > > > > </program>
> > > > >
> > > > > </image>
> > > > >
> > > > > //////////////////////////////////------------ code of HELLO
> > > > > WORLD-----------------
> > > > > /*
> > > > >
> > > >
> > ============================================================================
> > > > > Name : hello_world_elf.c
> > > > > Author :
> > > > > Version :
> > > > > Copyright : Your copyright notice
> > > > > Description : Hello World in C, Ansi-style
> > > > >
> > > >
> > ============================================================================
> > > > > */
> > > > >
> > > > > #include <stdio.h>
> > > > > #include <stdlib.h>
> > > > >
> > > > > int main(void) {
> > > > > puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
> > > > > return EXIT_SUCCESS;
> > > > > }
> > > > >
> > > > > ---
> > > > >
> > > > > Le 29 juillet 2008 11:49, Antonin SUBTIL<antonin.subtil at gmail.com> a
> > > > écrit :
> > > > >
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > > Here I come with always the same kind of question :s Sorry I'm a
> > slow
> > > > to
> > > > > > understand ... (or maybe I'm bad in explaining to my bosses :p )
> > > > > >
> > > > > > IF I modify some RTOS called A (nothing similar to linux or so)
> > (with
> > > > OKL4
> > > > > > functions, OKL4 .h and OKL4 .a) AND produce an ELF of it,
> > > > > > CAN I just modify weaver.xml and run elfadorn to ADD this A-OS to
> > OKL4
> > > > ?
> > > > > > Will it work?
> > > > > > What kind of parameters would be compulsory? (I mean, some are
> > obvious,
> > > > but
> > > > > > some might not be...)
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > --
> > > > > > Antonin Subtil,
> > > > > > 35 rue Donissan
> > > > > > FR-33000 Bordeaux
> > > > > > +33 (0)6.86.04.41.33
> > > > > > (anciennement +33 (0)6.77.40.17.69)
> > > > > >
> > > > > > Economisez du papier, limitez votre production de déchets :
> > n'imprimez
> > > > ce
> > > > > > message que si nécessaire et optez pour le recto-verso.
> > > > > >
> > > > > > Ce message est confidentiel. Toute publication, utilisation ou
> > > > diffusion,
> > > > > > même partielle, doit être autorisée préalablement. Si vous n'êtes
> > pas
> > > > > > destinataire de ce message, merci d'en avertir immédiatement
> > > > l'expéditeur.
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Antonin Subtil,
> > > > > 35 rue Donissan
> > > > > FR-33000 Bordeaux
> > > > > +33 (0)6.86.04.41.33
> > > > > (anciennement +33 (0)6.77.40.17.69)
> > > > >
> > > > > Economisez du papier, limitez votre production de déchets :
> > n'imprimez ce
> > > > > message que si nécessaire et optez pour le recto-verso.
> > > > >
> > > > > Ce message est confidentiel. Toute publication, utilisation ou
> > diffusion,
> > > > > même partielle, doit être autorisée préalablement. Si vous n'êtes pas
> > > > > destinataire de ce message, merci d'en avertir immédiatement
> > > > l'expéditeur.
> > > >
> > > > > _______________________________________________
> > > > > Developer mailing list
> > > > > Developer at okl4.org
> > > > > https://lists.okl4.org/mailman/listinfo/developer
> > > >
> > > >
> > > > --
> > > >
> > > >
> > >
> > >
> > > --
> > > Antonin Subtil,
> > > 35 rue Donissan
> > > FR-33000 Bordeaux
> > > +33 (0)6.86.04.41.33
> > > (anciennement +33 (0)6.77.40.17.69)
> > >
> > > Economisez du papier, limitez votre production de déchets : n'imprimez ce
> > > message que si nécessaire et optez pour le recto-verso.
> > >
> > > Ce message est confidentiel. Toute publication, utilisation ou diffusion,
> > > même partielle, doit être autorisée préalablement. Si vous n'êtes pas
> > > destinataire de ce message, merci d'en avertir immédiatement
> > l'expéditeur.
> >
> > --
> >
> >
>
>
> --
> Antonin Subtil,
> 35 rue Donissan
> FR-33000 Bordeaux
> +33 (0)6.86.04.41.33
> (anciennement +33 (0)6.77.40.17.69)
>
> Economisez du papier, limitez votre production de déchets : n'imprimez ce
> message que si nécessaire et optez pour le recto-verso.
>
> Ce message est confidentiel. Toute publication, utilisation ou diffusion,
> même partielle, doit être autorisée préalablement. Si vous n'êtes pas
> destinataire de ce message, merci d'en avertir immédiatement l'expéditeur.
--
More information about the Developer
mailing list