source: rtems/c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c @ 16a384cf

4.104.114.84.95
Last change on this file since 16a384cf was 16a384cf, checked in by Joel Sherrill <joel.sherrill@…>, on 04/23/99 at 16:35:11

New BSP from Tony R. Ambardar <tonya@…> from the
University of British Columbia. The BSP is for:

Yes, this is the "entry model" of a series of boards from Technologic
Systems. Costs <$200 I believe. They have a WWW page at www.t-systems.com.
I am letting them know about the availability of this BSP too.

  • Property mode set to 100644
File size: 4.1 KB
Line 
1/*
2 *  This routine starts the application.  It includes application,
3 *  board, and monitor specific initialization and configuration.
4 *  The generic CPU dependent initialization has been performed
5 *  before this routine is invoked.
6 *
7 *  COPYRIGHT (c) 1989-1998.
8 *  On-Line Applications Research Corporation (OAR).
9 *  Copyright assigned to U.S. Government, 1994.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.OARcorp.com/rtems/license.html.
14 *
15 *  Ported to the i386ex and submitted by:
16 *
17 *    Erik Ivanenko
18 *    University of Toronto
19 *    erik.ivanenko@utoronto.ca
20 * 
21 *  $Id$
22 */
23
24void bsp_clean_up(void);
25
26#include <bsp.h>
27#include <rtems/libio.h>
28 
29#include <libcsupport.h>
30
31/*
32 *  The original table from the application and our copy of it with
33 *  some changes.
34 */
35
36extern rtems_configuration_table  Configuration;
37rtems_configuration_table  BSP_Configuration;
38
39rtems_cpu_table Cpu_table;
40
41/*
42 *  Tells us where to put the workspace in case remote debugger is present.
43 */
44
45extern rtems_unsigned32  rdb_start;
46
47/*
48 *  Use the shared implementations of the following routines
49 */
50 
51void bsp_postdriver_hook(void);
52void bsp_libc_init( void *, unsigned32, int );
53
54/*
55 *  Function:   bsp_pretasking_hook
56 *  Created:    95/03/10
57 *
58 *  Description:
59 *      BSP pretasking hook.  Called just before drivers are initialized.
60 *      Used to setup libc and install any BSP extensions.
61 *
62 *  NOTES:
63 *      Must not use libc (to do io) from here, since drivers are
64 *      not yet initialized.
65 *
66 */
67 
68void bsp_pretasking_hook(void)
69{
70    extern int heap_bottom;
71    rtems_unsigned32 heap_start;
72    rtems_unsigned32 heap_size;
73
74    heap_start = (rtems_unsigned32) &heap_bottom;
75    if (heap_start & (CPU_ALIGNMENT-1))
76      heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
77
78    heap_size = BSP_Configuration.work_space_start -(void *) heap_start ;
79    heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
80
81    heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
82    bsp_libc_init((void *) heap_start, heap_size, 0);
83
84
85#ifdef RTEMS_DEBUG
86    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
87#endif
88}
89
90/*
91 *  bsp_start
92 *
93 *  This routine does the bulk of the system initialization.
94 */
95
96void bsp_start( void )
97{
98     /*
99    *  we do not use the pretasking_hook.
100   */
101
102  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
103  Cpu_table.postdriver_hook = bsp_postdriver_hook;
104  Cpu_table.interrupt_table_segment = get_ds();
105  Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table;
106  Cpu_table.interrupt_stack_size = 8192;
107  /*
108#if defined(RTEMS_POSIX_API)
109  BSP_Configuration.work_space_size *= 3;
110#endif
111  */
112    BSP_Configuration.work_space_start = (void *)
113     RAM_END - BSP_Configuration.work_space_size;
114
115  /*
116   *  Account for the console's resources
117   */
118  console_reserve_resources( &BSP_Configuration );
119
120  /*
121   * Init rtems_interrupt_management
122   */
123  rtems_irq_mngt_init();
124
125  /*
126   * Init rtems exceptions management
127   */
128  rtems_exception_init_mngt();
129
130  /*
131   *  The following information is very useful when debugging.
132   */
133
134#ifdef BSP_DEBUG
135  printk( "RAM_START = 0x%x\nRAM_END = 0x%x\n", RAM_START, RAM_END );
136  printk( "work_space_start = 0x%x\n",
137     BSP_Configuration.work_space_start );
138  printk( "work_space_size = 0x%x\n",
139     BSP_Configuration.work_space_size );
140  printk( "maximum_extensions = 0x%x\n",
141     BSP_Configuration.maximum_extensions );
142  printk( "microseconds_per_tick = 0x%x\n",
143     BSP_Configuration.microseconds_per_tick );
144  printk( "ticks_per_timeslice = 0x%x\n",
145     BSP_Configuration.ticks_per_timeslice );
146  printk( "maximum_devices = 0x%x\n",
147     BSP_Configuration.maximum_devices );
148  printk( "number_of_device_drivers = 0x%x\n",
149     BSP_Configuration.number_of_device_drivers );
150  printk( "Device_driver_table = 0x%x\n",
151     BSP_Configuration.Device_driver_table );
152
153  /*  printk( "_heap_size = 0x%x\n", _heap_size );
154      printk( "_stack_size = 0x%x\n", _stack_size ); */
155#endif
156}
157
158void bsp_clean_up(void) {
159  printk("bsp_cleanup called\n");
160}
161
Note: See TracBrowser for help on using the repository browser.