[okl4-developer] adding a guest RTOS

Antonin SUBTIL antonin.subtil at gmail.com
Tue Jul 29 20:33:01 EST 2008


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

//////////////////////////////////////---------------------- 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080729/29ba2326/attachment.htm 


More information about the Developer mailing list