Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

port goahead web server to nios2 uclinux

hi all:

I ported goahead websrver to nio2 use hippo's toolschain.

GoAhead WebServer 2.1 is a fully-featured, open-source embedded Web server that leverages Active Server Pages, embedded JavaScript, and in-process CGI forms processing (GoForms™) to deliver highly efficient and effective dynamic web page creation. Its source code is available free on the GoAhead website (http://www.goahead.com/webserver/wsregister.htm) to developers without royalties or proprietary lock-ins and is subject to the terms specified in the GoAhead .

The following step is my process:

1)download goahead webserver source code(webs218.tar.gz) from internet.

2)tar xzvf webs218.tar.gz

3)in the ../ws031202/LINUX dir,rework the original Makefile.

The original Make file is follow: attached

4)edit misc.c in the ../ws031202 dir

commet follow code:

//static int strnlen(char_t *s, unsigned int n);

/************************************************** ****************************/

/*

* Return the length of a string limited by a given length

*/

//static int strnlen(char_t *s, unsigned int n)

//{

// unsigned int len;

// len = gstrlen(s);

// return min(len, n);

//}

5)open the terminal ,cd ../ws031202/LINUX dir

6) PATH=$PATH:~/buildroot/build_nio2/staging_dir/bin

7)make

8)cp webs to ../rootfs/bin,cp ../ws031202/web dir to ../rootfs

9)rebuild kernel for inramfs use command "make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc-"

10)nios2-linux-uclibc-strip vmlinux

11) under nios sdk shell,use command "nio2-download -g vmlinux" to download the vmlinux to your target board

12)open the windows terminal,cd /bin

13) exec command "hostname localhost"

14) exec command "webs"

now your goahead webserver is running on your target board.you can open your IE,then type your target board IP to visit the demo HTML.

ps: because I am a linux beginner.So my rework Makefile maybe have some bugs.if anyone find any mistakes,please tell me right here. Thanks.

15 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi alex, i followed ur steps to port the webserver. everything seems fine but i cant access the demo webpage. i can ping my de2 but cant access it with web browser.

    here are some of my questions:

    1. must i follow the Buildrootguide to build the toolchain? i'm totally new and i used the BinaryToolchain for newbies.

    2. step 9: shud i run that cmd under ~/ws031202/LINUX dir or under ~/uClinux-dist-test/ dir? is it this cmd is suppose to replace the 'make linux image' as in uClinuxDist?

    3. step 10: whr shud i run this cmd? i tried the vmlinux file under ~/uClinux-dist-test/linux-2.6.xx/ (<= sry cant remember the numbers...) is it correct?

    Pls help. thank you in advance.

    ps. i&#39;m totally new n i hope my q doesnt sound stupid. i&#39;ll b glad if u would like to suggest anything.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi alex,I followed your steps to port the webserver.When I arrived the 10) step,I met the following err:

    [w@localhost w]$ cd uClinux-dist-test

    [w@localhost uClinux-dist-test]$ make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-

    uclibc-

    make -C tools/ucfront

    make[1]: Entering directory `/home/w/uClinux-dist-test/tools/ucfront&#39;

    make[1]: Nothing to be done for `all&#39;.

    make[1]: Leaving directory `/home/w/uClinux-dist-test/tools/ucfront&#39;

    ... ...

    ... ...

    ... ...

    [ -d /home/w/uClinux-dist-test/images ] || mkdir -p /home/w/uClinux-dist-test/im

    ages

    cp /home/w/uClinux-dist-test/linux-2.6.x/arch/nios2nommu/boot/zImage /home/w/uCl

    inux-dist-test/images/zImage

    make[2]: Leaving directory `/home/w/uClinux-dist-test/vendors/Altera/nios2nommu&#39;

    make[1]: Leaving directory `/home/w/uClinux-dist-test/vendors&#39;

    [w@localhost uClinux-dist-test]$ nios2-linux-uclibc-strip vmlinux

    nios2-linux-uclibc-strip: &#39;vmlinux&#39;: No such file

    Then I do it by the following way,but I do not know if it is correct.Could you tell me what does the command "nios2-linux-uclibc-strip" mean?

    [w@localhost uClinux-dist-test]$ nios2-linux-uclibc-strip images/zImage

    [w@localhost uClinux-dist-test]$

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi All,

    I am trying to port Go Ahead into REX OS for Qualcomm Mobile phones. Can I follow same steps for that OS too?

    I have tried the normal porting methods, but getting thousands of errors. Since I am new to this, expecting your support.

    Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    For those trying to access current releases of the Goahead-Webserver, it is now being hosted by Embedthis Software at: embedthis.com under products.