Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:01

0001 /*
0002  *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
0003  *           Bernd Becker (becker@faw.uni-ulm.de)
0004  *
0005  *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
0006  *
0007  *  This program is distributed in the hope that it will be useful,
0008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0010  *
0011  *
0012  *  COPYRIGHT (c) 1998.
0013  *  On-Line Applications Research Corporation (OAR).
0014  *
0015  *  The license and distribution terms for this file may be
0016  *  found in the file LICENSE in this distribution or at
0017  *  http://www.rtems.org/license/LICENSE.
0018  */
0019 
0020 #include <rtems/asm.h>
0021 
0022     BEGIN_CODE
0023     PUBLIC(start)
0024 SYM (start):
0025         ! install the stack pointer
0026     mov.l   stack_k,r15
0027 
0028     ! zero out bss
0029     mov.l   edata_k,r0
0030     mov.l   end_k,r1
0031     mov #0,r2
0032 0:
0033     mov.l   r2,@r0
0034     add #4,r0
0035     cmp/ge  r0,r1
0036     bt  0b
0037 
0038     ! copy the vector table from rom to ram
0039     mov.l   vects_k,r0      ! vectab
0040     mov #0,r1       ! address of boot vector table
0041     mov     #0,r2       ! number of bytes copied
0042     mov.w   vects_size,r3   ! size of entries in vectab
0043 1:
0044     mov.l   @r1+,r4
0045     mov.l   r4,@r0
0046     add     #4,r0
0047     add     #1,r2
0048     cmp/hi  r3,r2
0049     bf      1b
0050 
0051     mov.l   vects_k,r0      ! update vbr to point to vectab
0052     ldc     r0,vbr
0053 
0054     ! call the mainline
0055     mov #0,r4       ! command line
0056     mov.l main_k,r0
0057     jsr @r0
0058 
0059     ! call exit
0060     mov r0,r4
0061     mov.l   exit_k,r0
0062     jsr @r0
0063     or  r0,r0
0064 
0065     END_CODE
0066 
0067     .align 2
0068 stack_k:
0069     .long   SYM(_ISR_Stack_area_end)
0070 edata_k:
0071     .long   SYM(edata)
0072 end_k:
0073     .long   SYM(end)
0074 main_k:
0075     .long   SYM(boot_card)
0076 exit_k:
0077     .long   SYM(exit)
0078 
0079 vects_k:
0080     .long   SYM(vectab)
0081 vects_size:
0082     .word   255