XINU
start.S
Go to the documentation of this file.
1 /* start.S - start, bzero */
2 
3 #include <armv7a.h>
4 
5 /*------------------------------------------------------------------------
6  * start - Initial entry point for a Xinu image (ARM)
7  *------------------------------------------------------------------------
8  */
9  .text
10  .globl start /* Declare entry point global */
11 
12 start:
13  /* Load the stack pointer with end of memory */
14 
15  ldr sp, =MAXADDR
16 
17  /* Enable the Instruction Cache */
18 
19  mrc p15, 0, r0, c1, c0, 0
20  orr r0, r0, #ARMV7A_C1CTL_I
21  mcr p15, 0, r0, c1, c0, 0
22 
23  /* Use bzero (below) to zero out the BSS area */
24 
25  ldr r0, =edata
26  ldr r1, =end
27  bl bzero
28 
29  /* Call nulluser to initialize the Xinu system */
30  /* (Note: the call never returns) */
31 
32  bl nulluser
33 
34  /* Function to zero memory (r0 is lowest addr; r1 is highest) */
35 
36 bzero:
37  mov r2, #0 /* Round address to multiple */
38  add r0, r0, #3 /* of four by adding 3 and */
39  and r0, r0, #0xFFFFFFFC /* taking the result module 4 */
40 bloop: cmp r0, r1 /* Loop until last address */
41  bhs bexit /* has been reached */
42  str r2, [r0] /* Zero four-byte word of memory*/
43  add r0, r0, #4 /* Move to next word */
44  b bloop /* Continue to iterate */
45 bexit: mov pc, lr /* Return to caller */