Integrating GoAhead WebServer & eCos
by Anthony J. Massa

Listing One
# Build a set of ROMable pages
webrom.c:
    find ../web -name "*.*" >web_files
    ./webcomp ../web web_files >webrom.c


Listing Two
# For Cirrus Logic EDB72xx board
#PKG_INSTALL_DIR := /work/net_test/install
#COMMAND_PREFIX := arm-elf-
#CFLAGS := -mcpu=arm7tdmi -D__EDB7209 -D__EDB7212 -g -Wall -O2

# For Motorola PowerPC MBX/860
PKG_INSTALL_DIR := /work/mbx/install
COMMAND_PREFIX := powerpc-eabi-
CFLAGS := -mcpu=860 -msoft-float -g -Wall -O2


Listing Three
#webcomp:
# cc -o webcomp -O2 -DWEBS -DUEMF -DOS="Linux" -DLINUX -I.. ../webcomp.c


Listing Four
STARTUP(vectors.o)
ENTRY(__exception_reset)
INPUT(extras.o)
GROUP(libtarget.a libwebs.a libgcc.a)


Listing Five
void WebserverTask( cyg_addrword_t data )
{
   /* Initialize the memory allocator. */
   bopen(NULL, (60 * 1024), B_USE_MALLOC);

   /* Initialize the web server */
   if (initWebs() < 0)
   {
      diag_printf( "Error: webserverInitialize Failed!!!\n" );
      return;
   }

   /* Basic event loop. */
   while (!finished)
   {
      if (socketReady(-1) || socketSelect(-1, 2000))
      {
         socketProcess(-1);
      }

      emfSchedProcess();
   }

   /* Close the socket module, report memory leaks, and close the memory
      allocator. */
   websCloseServer();
   socketClose();
   bclose();
   return;
}




