1 ! $Id: startSUN.s,v 1.3 1996/06/04 09:01:33 paul Exp $
2
3 #include <minix/config.h>
4 #include <minix/const.h>
5 #include "const.h"
6
7 ! This is kernel entry point which is jumped to by the boot strap program.
8
9 .global start
10 start:
11 set k_stack, %l0
12 set CLICK_SIZE-1, %l1 ! Align %sp on the next lowest click
13 andn %l0, %l1, %sp ! boundary (for protection reasons)
14
15 set savedsp, %l0 ! Remember where the kernel stack
16 st %sp,[%l0] ! ends
17
18 sub %sp, 8, %sp ! sp now points to the last double word in a
19 ! click
20 sub %sp, INIT_SP, %sp ! leave space for a stack frame
21
22 call main ! Execute the C startup code
23 nop
24
25 L0: ba L0 ! Should never return
26 nop
27
28
29 ! getksp takes no parameters, and returns the highest address + 1 of the
30 ! kernel stack.
31
32 .global getksp
33 getksp:
34 set savedsp,%o0
35 retl
36 ld [%o0],%o0
37
38
39 .seg "bss"
40 ! Place to save the top of the stack.
41 .align 4
42 savedsp:
43 .skip 4
44
45
46 ! Here is the "kernel stack". It is used by the bootstrap code,
47 ! and by all layer 1 (interrupt handler) code. K_STACK_BYTES are used,
48 ! but CLICK_SIZE bytes are added to this so that we can be sure of
49 ! having a click-aligned K_STACK_BYTES region (the bss segment doesn't
50 ! start on a click boundary). This is important for proection, as
51 ! all bytes in a click have the same protection. See src/kernel/sunprotect.c
52 ! for more info on protection
53
54 .seg "bss"
55 .align 8
56 .skip K_STACK_BYTES + CLICK_SIZE ! leave click aligned space
57 k_stack: ! label the top of the stack
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.