Programming the NBX in C

Programming the NBX in C

This page is here since there is a total lack of online support from 3com.

So you want to run your own code on the NBX 100? Its not that hard.

First make sure you have the right Development Tools

Here is my test.c

extern myOwnFunction() {
        int i;
        for(i=0;i<2;i++)        // do it 2 times...
                memShow();      // Just call something else for now
        return 0;

memShow() {
        asm ( "call *__memShow" );
int __memShow=0x00959570;       // only for 4.1.4a
We need to compile it:
$ cc -S test.c -o test.s
Next we need to assemble the output
$ /usr/local/vxworks/i386/bin/i386-wrs-vxworks-as test.s
Now we need to remove any excessive symbols
you can link several .o files with ld -o test.s -i file1.o file2.o
$ #strip -K myOwnFunction a.out
I can't get the symbol table striped properly
Now transfer it to the system:
$ ftp
Name ( administrator
331 Password required
Password: KeepThemGuessing If your passowrd is 0000 you can't login
230 User logged in
ftp> cd "/htfs0/tmp"
250 Changed directory to "/htfs0/tmp"
ftp> put a.out
local: a.out remote: a.out
227 Entering Passive Mode (192,168,101,190,4,24)
150 Opening BINARY mode data connection
100% |****************************************************************|    84       00:00 ETA
226 Transfer complete
84 bytes sent in 0.10 seconds (0.81 KB/s)
ftp> exit
221 Bye...see you later

Now goto the console:

nbx100-> cd "/htfs0/tmp"
nbx100-> ld 1,1,"a.out"
value = 52192268 = 0x31c640c = a.out_bss + 0x8
nbx100->lkup "myOwn"
myOwnFunction             0x031c63d0 text     (a.out)
value = 0 = 0x0
Our program runs...

Back to Tim's Homepage Back to current subject Related Links
 This page was last updated Saturday, 22-Feb-2003 13:53:16 UTC Copyright 2000-2018 thogard™ is a trademark of Tim Hogard