Back to home page

LXR

 
 

    


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

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 #include <bsp.h>
0022 
0023     BEGIN_CODE
0024     PUBLIC(start)
0025 SYM (start):
0026         ! install the stack pointer
0027     mov.l   stack_k,r15
0028 
0029     ! zero out bss
0030     mov.l   edata_k,r0
0031     mov.l   end_k,r1
0032     mov #0,r2
0033 0:
0034     mov.l   r2,@r0
0035     add #4,r0
0036     cmp/ge  r0,r1
0037     bt  0b
0038 
0039     ! copy the vector table from rom to ram
0040     mov.l   vects_k,r0      ! vectab
0041     mov #0,r1       ! address of boot vector table
0042     mov     #0,r2       ! number of bytes copied
0043     mov.w   vects_size,r3   ! size of entries in vectab
0044 1:
0045     mov.l   @r1+,r4
0046     mov.l   r4,@r0
0047     add     #4,r0
0048     add     #1,r2
0049     cmp/hi  r3,r2
0050     bf      1b
0051 
0052     mov.l   vects_k,r0      ! update vbr to point to vectab
0053     ldc     r0,vbr
0054 
0055     ! call the mainline
0056     mov #0,r4       ! command line
0057     mov.l main_k,r0
0058     jsr @r0
0059 
0060 
0061     ! call exit
0062     mov r0,r4
0063     mov.l   exit_k,r0
0064     jsr @r0
0065     or  r0,r0
0066 
0067     END_CODE
0068 
0069     .align 2
0070 stack_k:
0071     .long   SYM(_ISR_Stack_area_end)
0072 edata_k:
0073     .long   SYM(edata)
0074 end_k:
0075     .long   SYM(end)
0076 main_k:
0077     .long   SYM(boot_card)
0078 exit_k:
0079     .long   SYM(_sys_exit)
0080 
0081 vects_k:
0082     .long   SYM(vectab)
0083 vects_size:
0084     .word   255