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