[okl4-developer] adding a file in the image using weaver.xml

Malcolm Purvis malcolmp at ok-labs.com
Tue Oct 28 10:16:15 EST 2008


>>>>> "Gabi" == Gabi Voiculescu <boy3dfx2 at yahoo.com> writes:

Gabi> I want to be able to add a (a video) file in my
Gabi> binary image, in okl4 (not oklinux).

Hi Gabi,

What you want is to have the following XML:

<program name="prog" file="/path/to/program" >
    <memsection name="video" file="/path/to/video" />
</program>

This will put the video file in the image and your program can find the
location of the file with the code:

         env_memsection_base(iguana_getenv("VIDEO"));

As for making the build system generate this automatically, in 2.1.1 the
sequence would be something like:

---------------------------------------------------------------------------
video = env.Command() # Generate video file.
weaver = env.WeaverFile()
env.set_weaver(video, weaver, None)

prog = env.KengeProgram()
env.weaver(prog).add_memsection(video)
---------------------------------------------------------------------------

In 3.0, the build system support for generating XML data was redesigned
so the sequence would now be something like:

---------------------------------------------------------------------------
video = env.Command() # Generate video file.

prog = env.KengeProgram()
cell.add_program(prog)
cell.add_file(prog, video)
---------------------------------------------------------------------------

Malcolm

-- 
                    Malcolm Purvis <malcolmp at ok-labs.com>




More information about the Developer mailing list