http netdemo with rtems-4.5.0-beta3

Andrew Bythell abythell at nortelnetworks.com
Mon Jun 26 17:04:35 UTC 2000


Hello.  

It took a while but I now have the netdemo http test running with
rtems-4.5.0-beta3.  Attached is a patch as requested.

Problems addressed:

- IMFS not configured or initialized
- too few file descriptors
- GoAhead expects to see web pages under /web (from may mailing list)
- gethostbyname fails without /etc/hosts and /etc/host.conf files ( from
may mailing list)
- ftp server and http server both using port 80

A.

-- 
Andrew Bythell     System Verification 
Nortel Networks Microelectronics Group 
Ottawa, Ontario Canada    esn.39.56930 
tel.613.765-6930      fax.613.763-7795

Joel Sherrill wrote:
> 
> Andrew Bythell wrote:
> >
> > Hello all.
> >
> > I am trying to run the http sample included as part of the netdemos, but
> > I'm not clear on how a tar file is loaded into memory and
> > un-compressed.
> >
> > When I try and build the sample, I get undefined references to the
> > tarfile start and size.  Do I specify these values, or are they
> > determined during linking?
> >
> > I tried changing the values from _binary_tarfile... to
> > _binary_o_optimize_tarfile, which links, but when the app runs, I get
> > "Untar failed to create file index.html".
> >
> > I know this is something simple, but I'm not sure how the In-memory
> > filesystem works.  Can someone offer a quick crash-course?
> 
> My guess is that this is a side-effect of the lowering of configuration
> defaults.  This test really needs a filesystem -- not just the minimal
> one that supports only device nodes.
> 
> Try adding this:
> 
> #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
> 
> You will probably need more than 3 file descriptors so probably
> need to do something like this as well:
> 
> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10
> 
> Send me a patch for the test after it runs for you.
>
-------------- next part --------------
diff -uNr http/README /home/rtems/apps/netdemo/http/README
--- http/README	Wed Dec 31 19:00:00 1969
+++ /home/rtems/apps/netdemo/http/README	Mon Jun 26 12:21:26 2000
@@ -0,0 +1,15 @@
+To configure the http demo, set the IP address of the web server 
+in ./rootfs/etc/hosts.  
+
+You may also have to change the _binary_o_optimize_tarfile_start and 
+_binary_o_optimize_tarfile_size variables in init.c if you are using 
+another RTEMS variant.
+
+When accessing the webserver, give your browser the full path to index.html,
+since by default:
+
+http://webserver  -> http://webserver/home.asp
+http://webserver/ -> http://webserver/home.asp
+
+
+
diff -uNr http/flash.script /home/rtems/apps/netdemo/http/flash.script
--- http/flash.script	Wed Dec 31 19:00:00 1969
+++ /home/rtems/apps/netdemo/http/flash.script	Mon Jun 26 12:32:14 2000
@@ -0,0 +1,34 @@
+#####################################################################
+# IBL FLASH script
+# - Invoke this with "lanload -c <nodename> flash.script"
+# - Also remember to change the nodename used in this
+#   file to the same nodename specified on the command line.
+#####################################################################
+
+# Configure the processor type for lanload
+!echo "Configuring lanload for processor 68360"
+cf proc=68360;rst
+
+cf procck=25;rst
+
+pf -EI 0 1000000 4 2 0 40000
+pf -I 0 1000000 4 2 0 40000
+
+
+# Clear the flash ram at address zero
+m -d4 0x0=0x20202020
+m -d4 0x0=0xd0d0d0d0
+w 2
+m -d4 0x0=0x50505050
+m -d4 0x0
+
+# Clear the flash ram at address 0x40000
+m -d4 0x40000=0x20202020
+m -d4 0x40000=0xd0d0d0d0
+w 2
+m -d4 0x40000=0x50505050
+m -d4 0x40000
+
+# Load the flash with the file given
+!lanload -M -FI pcary0x5 o-optimize/test.srec
+
diff -uNr http/index.html /home/rtems/apps/netdemo/http/index.html
--- http/index.html	Thu Oct 28 14:55:25 1999
+++ /home/rtems/apps/netdemo/http/index.html	Wed Dec 31 19:00:00 1969
@@ -1,15 +0,0 @@
-<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 © 1988-1999 <A HREF="http://www.oarcorp.com" target="Text Frame">OAR Corporation</A>
-</BODY></HTML>
diff -uNr http/init.c /home/rtems/apps/netdemo/http/init.c
--- http/init.c	Tue Dec 14 08:23:56 1999
+++ /home/rtems/apps/netdemo/http/init.c	Mon Jun 26 11:24:26 2000
@@ -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,13 @@
 
 #define ARGUMENT 0
 
-extern int _binary_tarfile_start;
-extern int _binary_tarfile_size;
+extern int _binary_o_optimize_tarfile_start;
+extern int _binary_o_optimize_tarfile_size;
 
 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 +72,11 @@
   /* init_paging(); */
 
   rtems_bsdnet_initialize_network ();
-
+  rtems_filesystem_initialize();
   rtems_initialize_ftpd();
 
-  status = Untar_FromMemory((unsigned char *)(&_binary_tarfile_start),
-			    &_binary_tarfile_size);
+  status = Untar_FromMemory((unsigned char *)(&_binary_o_optimize_tarfile_start),
+			    &_binary_o_optimize_tarfile_size);
    
   rtems_initialize_webserver();
 
diff -uNr http/rootfs/etc/host.conf /home/rtems/apps/netdemo/http/rootfs/etc/host.conf
--- http/rootfs/etc/host.conf	Wed Dec 31 19:00:00 1969
+++ /home/rtems/apps/netdemo/http/rootfs/etc/host.conf	Mon Jun 26 11:34:26 2000
@@ -0,0 +1 @@
+order hosts, bind
diff -uNr http/rootfs/etc/hosts /home/rtems/apps/netdemo/http/rootfs/etc/hosts
--- http/rootfs/etc/hosts	Wed Dec 31 19:00:00 1969
+++ /home/rtems/apps/netdemo/http/rootfs/etc/hosts	Mon Jun 26 12:03:11 2000
@@ -0,0 +1,2 @@
+127.0.0.0	 localhost
+192.168.1.2	 rtems		# ip address of webserver
diff -uNr http/rootfs/web/index.html /home/rtems/apps/netdemo/http/rootfs/web/index.html
--- http/rootfs/web/index.html	Wed Dec 31 19:00:00 1969
+++ /home/rtems/apps/netdemo/http/rootfs/web/index.html	Mon Jun 26 11:35:00 2000
@@ -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 © 1988-1999 <A HREF="http://www.oarcorp.com" target="Text Frame">OAR Corporation</A>
+</BODY></HTML>


More information about the users mailing list