ChorusOS 4.0 Porting Guide

launch() Routine

Example 4-6 is the launch() routine source code provided in kernel/snippet/nucleus/boot_tools/launch.s.


Example 4-9 launch() Routine

        /*
         *     void
         * launch (VmAddr dst, VmAddr src, VmSize size , KnPc entry, void* cookie);
         */

        .global launch_start
        .global launch_end

launch_start:   

launch_end:     


The launch() function copies size bytes from the source address, src, to the destination address, dst, and then jumps to the location entry, passing cookie as the argument.

The launch() routine is positional independent. The caller can copy the instructions, starting from the address launch_start() up to the address launch_end(), to any destination location and execute them there.

The launch() routine does not require a stack and is not required to preserve any general register state.