1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2009. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #include "pcmmio_commands.h" |
---|
13 | |
---|
14 | #include <stdlib.h> |
---|
15 | |
---|
16 | #include <rtems/untar.h> |
---|
17 | /* |
---|
18 | * The tarfile image is built automatically externally. |
---|
19 | */ |
---|
20 | #include "FilesystemImage.h" |
---|
21 | |
---|
22 | rtems_task Init( |
---|
23 | rtems_task_argument ignored |
---|
24 | ) |
---|
25 | { |
---|
26 | int status; |
---|
27 | |
---|
28 | /* |
---|
29 | * Initialize the PCMMIO module to use IRQ6. Ours is jumpered for 0x300 |
---|
30 | * base address. We use discrete input interrupts so enable all of the |
---|
31 | * as edge triggered on 1. |
---|
32 | */ |
---|
33 | pcmmio_initialize(0x300, 6); |
---|
34 | enable_dio_interrupt(); |
---|
35 | { int i; |
---|
36 | for (i=1 ; i<=48 ; i++ ) |
---|
37 | dio_enab_bit_int(i, 1); |
---|
38 | } |
---|
39 | |
---|
40 | /* |
---|
41 | * Untar initial filesystem contents from program image |
---|
42 | */ |
---|
43 | printk("Loading filesystem image\n"); |
---|
44 | status = Untar_FromMemory( (char *)FilesystemImage, FilesystemImage_size ); |
---|
45 | if ( status ) { |
---|
46 | printf("Unable to untar initial filesystem contents\n"); |
---|
47 | exit(0); |
---|
48 | } |
---|
49 | |
---|
50 | /* |
---|
51 | * Display a herald with some hints on usage |
---|
52 | */ |
---|
53 | printf( |
---|
54 | "\n" |
---|
55 | "\n" |
---|
56 | "*** Shell Configured with WinSystems PCMMIO Commands ***\n" |
---|
57 | "Type \"help pcmmio\" for more information\n" |
---|
58 | "\n" |
---|
59 | ); |
---|
60 | rtems_shell_init( |
---|
61 | "SHLL", /* task_name */ |
---|
62 | RTEMS_MINIMUM_STACK_SIZE * 4, /* task_stacksize */ |
---|
63 | 100, /* task_priority */ |
---|
64 | "/dev/console", /* devname */ |
---|
65 | false, /* forever */ |
---|
66 | true, /* wait */ |
---|
67 | NULL /* login */ |
---|
68 | ); |
---|
69 | } |
---|
70 | |
---|
71 | /* RTEMS configuration */ |
---|
72 | |
---|
73 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
74 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
75 | #ifdef RTEMS_BSP_HAS_IDE_DRIVER |
---|
76 | #define CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
77 | #endif |
---|
78 | #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
79 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
80 | |
---|
81 | #define CONFIGURE_MICROSECONDS_PER_TICK 1000 |
---|
82 | |
---|
83 | #define CONFIGURE_MAXIMUM_TASKS 20 |
---|
84 | #define CONFIGURE_MAXIMUM_SEMAPHORES 20 |
---|
85 | #define CONFIGURE_MAXIMUM_BARRIERS 3 |
---|
86 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 |
---|
87 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 |
---|
88 | |
---|
89 | /* |
---|
90 | * discrete in messages are 12 bytes and there are 1024 of them |
---|
91 | */ |
---|
92 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ |
---|
93 | CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(1024, 12) |
---|
94 | |
---|
95 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
96 | #define CONFIGURE_EXTRA_TASK_STACKS (6 * RTEMS_MINIMUM_STACK_SIZE) |
---|
97 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT |
---|
98 | |
---|
99 | /* We need the full IMFS to create initial files */ |
---|
100 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
101 | |
---|
102 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
103 | #define CONFIGURE_MALLOC_STATISTICS |
---|
104 | |
---|
105 | #define CONFIGURE_INIT |
---|
106 | #include <rtems/confdefs.h> |
---|
107 | |
---|
108 | #define CONFIGURE_SHELL_USER_COMMANDS \ |
---|
109 | CONFIGURE_PCMMIO_COMMANDS |
---|
110 | #define CONFIGURE_SHELL_USER_ALIASES \ |
---|
111 | CONFIGURE_PCMMIO_ALIASES |
---|
112 | |
---|
113 | #define CONFIGURE_SHELL_COMMANDS_INIT |
---|
114 | #define CONFIGURE_SHELL_COMMANDS_ALL |
---|
115 | |
---|
116 | #include <rtems/shellconfig.h> |
---|
117 | |
---|