From 40185386b9a3793a3381211f47fb97a0d8728488 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 28 Oct 1999 18:55:25 +0000 Subject: New httpd sample test from Emmanuel Raguet. --- http/Makefile | 67 ++++++++++++++++++++++++++++++++++++++++++++ http/index.html | 15 ++++++++++ http/init.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ http/system.h | 33 ++++++++++++++++++++++ 4 files changed, 201 insertions(+) create mode 100644 http/Makefile create mode 100644 http/index.html create mode 100644 http/init.c create mode 100644 http/system.h diff --git a/http/Makefile b/http/Makefile new file mode 100644 index 0000000..26224d4 --- /dev/null +++ b/http/Makefile @@ -0,0 +1,67 @@ +# +# $Id$ +# + +SAMPLE=http +PGM=${ARCH}/$(SAMPLE).exe + +MANAGERS=io event semaphore timer rate_monotonic + +# C source names, if any, go here -- minus the .c +C_PIECES=init +C_FILES=$(C_PIECES:%=%.c) +C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) + +H_FILES= + +DOCTYPES= +DOCS=$(DOCTYPES:%=$(SAMPLE).%) + +SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) +OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) + +PRINT_SRCS=$(DOCS) + +PGM=${ARCH}/$(SAMPLE).exe + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +# +# (OPTIONAL) Add local stuff here using += +# + +DEFINES += +CPPFLAGS += +CFLAGS += +CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0xC0000 +CFLAGS_OPTIMIZE_V += +CFLAGS_DEBUG_V += -v -qrtems_debug + +LD_PATHS += +LD_LIBS += + +# +# Add your list of files to delete here. The config files +# already know how to delete some stuff, so you may want +# to just run 'make clean' first to see what gets missed. +# 'make clobber' already includes 'make clean' +# + +CLEAN_ADDITIONS += +CLOBBER_ADDITIONS += + +all: ${ARCH} $(SRCS) $(PGM) + +${PGM}: $(OBJS) $(LINK_FILES) + tar cf $(ARCH)/tarfile index.html + $(LD) -r -o $(ARCH)/temp.o $(ARCH)/init.o -b binary $(ARCH)/tarfile + $(MV) $(ARCH)/temp.o $(ARCH)/init.o + $(RM) $(ARCH)/temp.o + $(make-exe) + +# Install the program(s), appending _g or _p as appropriate. +# for include files, just use $(INSTALL) +install: all + $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/tests diff --git a/http/index.html b/http/index.html new file mode 100644 index 0000000..15e5c9f --- /dev/null +++ b/http/index.html @@ -0,0 +1,15 @@ + +RTEMS GoAhead Test Page + + + OAR +

RTEMS GoAhead Test Page

+
+ + +

Congratulations, you have successfully loaded your first page +from the GoAhead Web Server running on RTEMS.

+ +
+Copyright © 1988-1999 OAR Corporation + diff --git a/http/init.c b/http/init.c new file mode 100644 index 0000000..44f9fc8 --- /dev/null +++ b/http/init.c @@ -0,0 +1,86 @@ +/* Init + * + * This routine is the initialization task for this test program. + * + * Don't forget to change the IP addresses + */ + +#define TEST_INIT + +#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) +#define CONFIGURE_MAXIMUM_SEMAPHORES 20 +#define CONFIGURE_MAXIMUM_TASKS 20 + +#define CONFIGURE_MICROSECONDS_PER_TICK 10486 + +#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) +#define CONFIGURE_INIT_TASK_PRIORITY 120 +#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ + RTEMS_NO_TIMESLICE | \ + RTEMS_NO_ASR | \ + RTEMS_INTERRUPT_LEVEL(0)) + +#define CONFIGURE_INIT + +#include "system.h" + +#include +#include + +#include +#include +#include +#include + + +#include +#include +#include +#include + +#include +#include +#include "../networkconfig.h" + +#include + +#define ARGUMENT 0 + +extern int _binary_tarfile_start; +extern int _binary_tarfile_size; + +struct rtems_ftpd_configuration rtems_ftpd_configuration = { + 10, /* FTPD task priority */ + 1024, /* Maximum buffersize for hooks */ + 80, /* Well-known port */ + NULL /* List of hooks */ +}; +rtems_task Init( + rtems_task_argument argument +) +{ + rtems_status_code status; + + printf("\n\n*** HTTP TEST ***\n\r" ); + + /* init_paging(); */ + + rtems_bsdnet_initialize_network (); + + rtems_initialize_ftpd(); + + status = Untar_FromMemory((unsigned char *)(&_binary_tarfile_start), + &_binary_tarfile_size); + + rtems_initialize_webserver(); + + status = rtems_task_delete( RTEMS_SELF ); +} + + + + diff --git a/http/system.h b/http/system.h new file mode 100644 index 0000000..aa9e56c --- /dev/null +++ b/http/system.h @@ -0,0 +1,33 @@ +/* system.h + * + * This include file contains information that is included in every + * function in the test set. + * + * COPYRIGHT (c) 1989-1998. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include + +/* functions */ + +rtems_task Init( + rtems_task_argument argument +); + +/* configuration information */ + +#include + +/* global variables */ + +TEST_EXTERN rtems_id Global_variable; /* example global variable */ + +/* end of include file */ -- cgit v1.2.3