summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-12 16:47:38 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-07-12 16:47:38 +0000
commit1a1b41cdd862e822459c9f5441927b7e1f4b942c (patch)
tree2db277deb4fb1435b800a2d6caf677194c3ae4b5
parentAdding and deleting files for branch and main trunk. (diff)
downloadnetwork-demos-1a1b41cdd862e822459c9f5441927b7e1f4b942c.tar.bz2
Patch from Andrew Bythell <abythell@nortelnetworks.com> that should
allow the http demo to build a correct starting filesystem and run. Formerly, the http demo did not configure the filesystem as needed or build the tar file such that GoAhead could find it.
-rw-r--r--http/Makefile6
-rw-r--r--http/init.c26
-rw-r--r--http/rootfs/etc/host.conf1
-rw-r--r--http/rootfs/etc/hosts2
-rw-r--r--http/rootfs/web/index.html15
5 files changed, 42 insertions, 8 deletions
diff --git a/http/Makefile b/http/Makefile
index 26224d4..cb05daf 100644
--- a/http/Makefile
+++ b/http/Makefile
@@ -55,8 +55,10 @@ 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
+ cd rootfs ; tar cf ../$(ARCH)/tarfile web etc
+ cp $(ARCH)/tarfile .
+ $(OBJCOPY) -I binary -O elf32-powerpc tarfile $(ARCH)/tarfile.o
+ $(LD) -r -o $(ARCH)/temp.o $(ARCH)/init.o $(ARCH)/tarfile.o
$(MV) $(ARCH)/temp.o $(ARCH)/init.o
$(RM) $(ARCH)/temp.o
$(make-exe)
diff --git a/http/init.c b/http/init.c
index d6008b8..eea4873 100644
--- a/http/init.c
+++ b/http/init.c
@@ -10,6 +10,8 @@
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
+#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024)
#define CONFIGURE_MAXIMUM_SEMAPHORES 20
@@ -50,13 +52,27 @@
#define ARGUMENT 0
-extern int _binary_tarfile_start;
-extern int _binary_tarfile_size;
+/*
+ * The tarfile is built in $(ARCH) so includes whether we were
+ * built optimized or debug.
+ */
+
+#if defined(RTEMS_DEBUG)
+extern int _binary_o_debug_tarfile_start;
+extern int _binary_o_debug_tarfile_size;
+#define TARFILE_START _binary_o_debug_tarfile_start
+#define TARFILE_SIZE _binary_o_debug_tarfile_size
+#else
+extern int _binary_o_optimize_tarfile_start;
+extern int _binary_o_optimize_tarfile_size;
+#define TARFILE_START _binary_o_optimize_tarfile_start
+#define TARFILE_SIZE _binary_o_optimize_tarfile_size
+#endif
struct rtems_ftpd_configuration rtems_ftpd_configuration = {
10, /* FTPD task priority */
1024, /* Maximum buffersize for hooks */
- 80, /* Well-known port */
+ 21, /* Well-known port */
NULL /* List of hooks */
};
rtems_task Init(
@@ -70,11 +86,9 @@ rtems_task Init(
/* init_paging(); */
rtems_bsdnet_initialize_network ();
-
rtems_initialize_ftpd();
- status = Untar_FromMemory((unsigned char *)(&_binary_tarfile_start),
- &_binary_tarfile_size);
+ status = Untar_FromMemory((unsigned char *)(&TARFILE_START), &TARFILE_SIZE);
rtems_initialize_webserver();
diff --git a/http/rootfs/etc/host.conf b/http/rootfs/etc/host.conf
index e69de29..0e9eeb1 100644
--- a/http/rootfs/etc/host.conf
+++ b/http/rootfs/etc/host.conf
@@ -0,0 +1 @@
+order hosts, bind
diff --git a/http/rootfs/etc/hosts b/http/rootfs/etc/hosts
index e69de29..0027f9d 100644
--- a/http/rootfs/etc/hosts
+++ b/http/rootfs/etc/hosts
@@ -0,0 +1,2 @@
+127.0.0.0 localhost
+192.168.1.2 rtems # ip address of webserver
diff --git a/http/rootfs/web/index.html b/http/rootfs/web/index.html
index e69de29..15e5c9f 100644
--- a/http/rootfs/web/index.html
+++ b/http/rootfs/web/index.html
@@ -0,0 +1,15 @@
+<HTML>
+<HEAD><TITLE>RTEMS GoAhead Test Page</TITLE></HEAD>
+<BODY BGCOLOR="FFFFFF">
+<A HREF="http://www.oarcorp.com" target="Text Frame">
+ <IMG align=right BORDER=0 SRC="oaronly.jpg" ALT="OAR"> </A>
+<H1>RTEMS GoAhead Test Page</H1>
+<HR>
+<BODY>
+
+<P>Congratulations, you have successfully loaded your first page
+from the GoAhead Web Server running on RTEMS.</P>
+
+<HR>
+Copyright &copy; 1988-1999 <A HREF="http://www.oarcorp.com" target="Text Frame">OAR Corporation</A>
+</BODY></HTML>