diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-09-19 21:52:02 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-09-19 21:52:02 +0000 |
commit | 046d88cc0163bf6828beef043f011acdd9c43426 (patch) | |
tree | 1d4efdb6bba1768d1ccb802b2e4c3391c6c07051 /mcast/init.c | |
parent | 2007-09-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | network-demos-046d88cc0163bf6828beef043f011acdd9c43426.tar.bz2 |
2007-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* ChangeLog, Makefile, README, init.c, listener.c, mcast.c,
mcast_params.h, mcast_route.c, rootfs/etc/host.conf,
rootfs/etc/hosts: New files.
Diffstat (limited to 'mcast/init.c')
-rw-r--r-- | mcast/init.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/mcast/init.c b/mcast/init.c new file mode 100644 index 0000000..af00d90 --- /dev/null +++ b/mcast/init.c @@ -0,0 +1,88 @@ +/* + * RTEMS configuration/initialization + * + * This program may be distributed and used for any purpose. + * I ask only that you: + * 1. Leave this author information intact. + * 2. Document any changes you make. + * + * W. Eric Norum + * Saskatchewan Accelerator Laboratory + * University of Saskatchewan + * Saskatoon, Saskatchewan, CANADA + * eric@skatter.usask.ca + * + * $Id$ + */ + +#include <bsp.h> + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_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 +#define CONFIGURE_MAXIMUM_TASKS 20 + +#define CONFIGURE_MICROSECONDS_PER_TICK 10000 + +#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 +rtems_task Init (rtems_task_argument argument); + +#include <rtems/confdefs.h> + +#include <stdio.h> +#include <stdlib.h> +#include <rtems/rtems_bsdnet.h> +#include "../networkconfig.h" + +#include <rtems/untar.h> +#include "FilesystemImage.h" + +#if 0 +int add_mcast_route( + char *multi_address, + char *multi_netmask, + char *multi_gateway +); + +#define MULTI_ADDRESS "239.9.8.0" +#define MULTI_NETMASK "255.255.255.0" +#define MULTI_GATEWAY "192.168.1.244" +#endif + +/* + * RTEMS Startup Task + */ +rtems_task +Init (rtems_task_argument ignored) +{ + int mcast_main(int ac, char **av); + rtems_status_code status; + + printf("Loading filesystem image\n"); + status = Untar_FromMemory( (char *)FilesystemImage, FilesystemImage_size ); + + printk( "Initializing network\n" ); + rtems_bsdnet_initialize_network (); + + // This appears to have no effect. + // add_mcast_route( MULTI_ADDRESS, MULTI_NETMASK, MULTI_GATEWAY ); + + printk( "Network initialized\n" ); + rtems_bsdnet_show_inet_routes (); + + printk( "Initiating mcast test\n" ); + mcast_main ( 0, 0 ); + exit (0); +} |