Friday, December 18, 2009
Compiling load modules for soft kernel?
Q: I want to try a load module in my soft kernel before putting it on the real target. How can I build this? The sfk-win32 ARCH target doesn't work.
A: The trick to getting the LMs to build for sfk is to use ARCH=x86 instead. E.g.:
$ C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong
$ make ARCH=x86 all
--- Compiling src/ping.c
--- Compiling src/pong.c
--- Compiling ../../modules/src/libwhat.c for obj/x86/debug/libwhat.o
--- Building lib/x86/debug/libpingpong.a
--- Compiling src/debug_friendly.c
--- Compiling src/pingpong_main.c
--- Concatenating osemain.con fragments
--- Compiling c:/OSE/ose5.4.1_ppc/src/osemain.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/crt0_lm.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/ose_confd.c
--- Linking obj/x86/debug/unconfigured (pass 1)
--- Linking obj/x86/debug/unconfigured (pass 2)
--- Stripping load module from symbol and debug information
--- Postlinking obj/x86/debug/unconfigured
--- Inserting configuration ../../modules/src/default.lmconf
--- Sizing bin/x86/pingpong_debug.elf
Size of text : 29704 (29K) (t)
Size of initdata : 0 (0K) (id)
Size of data : 2084 (2K) (d)
Size of bss : 344 (0K) (b)
ROM footprint : 31788 (31K) (t+d)
RAM footprint : 36864 (36K) (t+id+d+b)
The resulting elf file is located in :
C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong/bin/x86/pingpong_debug.elf
This applies for OSE5.4.1 but holds for older releases as well. To upload it, remember that the directory for sfk is mounted locally (for newer OSE5 releases) so you don't need the /tftp/ in the pathname. The default pathname is /host, which represents your root C: level. Just create a temp directory from your C: top-level directory and mount from there, e.g. create C:/oselm, copy the elf file over there, then download it to the rtose for sfk-win32 with:
rtose@softwin> pm_install pingpong /host/oselm/pingpong_debug.elf
rtose@softwin> pm_create pingpong
rtose@softwin> pm_lminfo
core_module
pingpong
A: The trick to getting the LMs to build for sfk is to use ARCH=x86 instead. E.g.:
$ C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong
$ make ARCH=x86 all
--- Compiling src/ping.c
--- Compiling src/pong.c
--- Compiling ../../modules/src/libwhat.c for obj/x86/debug/libwhat.o
--- Building lib/x86/debug/libpingpong.a
--- Compiling src/debug_friendly.c
--- Compiling src/pingpong_main.c
--- Concatenating osemain.con fragments
--- Compiling c:/OSE/ose5.4.1_ppc/src/osemain.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/crt0_lm.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/ose_confd.c
--- Linking obj/x86/debug/unconfigured (pass 1)
--- Linking obj/x86/debug/unconfigured (pass 2)
--- Stripping load module from symbol and debug information
--- Postlinking obj/x86/debug/unconfigured
--- Inserting configuration ../../modules/src/default.lmconf
--- Sizing bin/x86/pingpong_debug.elf
Size of text : 29704 (29K) (t)
Size of initdata : 0 (0K) (id)
Size of data : 2084 (2K) (d)
Size of bss : 344 (0K) (b)
ROM footprint : 31788 (31K) (t+d)
RAM footprint : 36864 (36K) (t+id+d+b)
The resulting elf file is located in :
C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong/bin/x86/pingpong_debug.elf
This applies for OSE5.4.1 but holds for older releases as well. To upload it, remember that the directory for sfk is mounted locally (for newer OSE5 releases) so you don't need the /tftp/ in the pathname. The default pathname is /host, which represents your root C: level. Just create a temp directory from your C: top-level directory and mount from there, e.g. create C:/oselm, copy the elf file over there, then download it to the rtose for sfk-win32 with:
rtose@softwin> pm_install pingpong /host/oselm/pingpong_debug.elf
rtose@softwin> pm_create pingpong
rtose@softwin> pm_lminfo
core_module
pingpong
Labels: lm, load module, OSE5, sfk
free invisible web counter