|
30 | 30 | #include "bsp-impl.h" |
31 | 31 | #include <rtems.h> |
32 | 32 |
|
| 33 | +#ifdef RTEMS_INCLUDE_TARFS |
| 34 | + |
| 35 | +#include <rtems/untar.h> |
| 36 | +/* |
| 37 | +** Tar file symbols |
| 38 | +*/ |
| 39 | +extern int _binary_tarfile_start; |
| 40 | +extern int _binary_tarfile_size; |
| 41 | +#define TARFILE_START _binary_tarfile_start |
| 42 | +#define TARFILE_SIZE _binary_tarfile_size |
| 43 | + |
| 44 | +#endif |
| 45 | + |
33 | 46 | /* |
34 | 47 | ** A simple entry point to start from the loader |
35 | 48 | */ |
36 | 49 | rtems_task Init(rtems_task_argument ignored) |
37 | 50 | { |
| 51 | + |
| 52 | +#ifdef RTEMS_INCLUDE_TARFS |
| 53 | + /* |
| 54 | + ** Initialize the file system |
| 55 | + */ |
| 56 | + printf("Populating Root file system from TAR file.\n"); |
| 57 | + int status = Untar_FromMemory( |
| 58 | + (unsigned char *)(&TARFILE_START), |
| 59 | + (unsigned long)&TARFILE_SIZE); |
| 60 | + if (status != RTEMS_SUCCESSFUL) |
| 61 | + { |
| 62 | + printf("Error while untaring from memory\n"); |
| 63 | + } |
| 64 | + |
| 65 | +#endif |
| 66 | + |
38 | 67 | OS_BSPMain(); |
39 | 68 | } |
40 | 69 |
|
@@ -95,4 +124,29 @@ rtems_task Init(rtems_task_argument ignored) |
95 | 124 | #define CONFIGURE_MICROSECONDS_PER_TICK 10000 |
96 | 125 | #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY 9 |
97 | 126 |
|
| 127 | +/* |
| 128 | +** This include file must be AFTER the |
| 129 | +** configuration data. |
| 130 | +*/ |
98 | 131 | #include <rtems/confdefs.h> |
| 132 | + |
| 133 | +/* TODO Enablibg the GRETH driver is a platform specific setting. This is supposed to be a "generic" rtems psp. */ |
| 134 | +#ifdef RTEMS_INCLUDE_TARFS /* TODO Is there a better networking-related define? */ |
| 135 | + |
| 136 | +#include <drvmgr/drvmgr.h> |
| 137 | + |
| 138 | +/* Configure Driver manager */ |
| 139 | +#if defined(RTEMS_DRVMGR_STARTUP) && defined(LEON3) /* if --drvmgr was given to configure */ |
| 140 | + /* Add Timer and UART Driver for this example */ |
| 141 | + #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
| 142 | + #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER |
| 143 | + #endif |
| 144 | + #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
| 145 | + #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART |
| 146 | + #endif |
| 147 | +#endif |
| 148 | +#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH |
| 149 | + |
| 150 | +#include <drvmgr/drvmgr_confdefs.h> |
| 151 | + |
| 152 | +#endif |
0 commit comments