BSD 4_1_snap development
[unix-history] / sys / stand / srt0.c
CommitLineData
76bc8667
C
1/* srt0.c 4.8 81/04/03 */
2
3#include "../h/mtpr.h"
4#define LOCORE
5#include "../h/cpu.h"
6
7/*
8 * Startup code for standalone system
9 * Non-relocating version -- for programs which are loaded by boot
10 */
11
12 .globl _end
13 .globl _edata
14 .globl _main
15 .globl __rtt
16 .globl _configure
17 .globl _cpu
18 .globl _openfirst
19
20 .set HIGH,31 # mask for total disable
21
22entry: .globl entry
23 .word 0x0
24 mtpr $HIGH,$IPL # just in case
25#ifdef REL
26 movl $RELOC,sp
27#else
28 movl $RELOC-0x2400,sp
29#endif
30start:
31 movl aedata,r0
32clr:
33 clrl (r0)+
34 cmpl r0,sp
35 jlss clr
36#ifdef REL
37 movc3 aend,*$0,(sp)
38 jmp *abegin
39begin:
40#endif
41 mtpr $0,$SCBB
42 calls $0,_configure
43 movl $1,_openfirst
44 calls $0,_main
45#ifndef TP
46 jmp start
47#else
48 ret
49#endif
50
51 .data
52#ifdef REL
53abegin: .long begin
54aend: .long _end-RELOC
55aedata: .long _edata-RELOC
56#else
57aedata: .long _edata
58#endif
59
60__rtt:
61 .word 0x0
62 jmp start
63
64 .globl _badloc
65_badloc:
66 .word 0
67 movl $1,r0
68 movl 4(ap),r3
69 movl $4,r2
70 movab 9f,(r2)
71 tstl (r3)
721: clrl r0 # made it w/o machine checks
732: movl $4,r2
74 clrl (r2)
75 ret
76 .align 2
779:
78 casel _cpu,$1,$VAX_MAX
790:
80 .word 8f-0b # 1 is 780
81 .word 5f-0b # 2 is 750
82 .word 5f-0b # 3 is 7ZZ
835:
84 mtpr $0xf,$MCESR
85 brb 1f
868:
87 mtpr $0,$SBIFS
881:
89 addl2 (sp)+,sp # discard mchchk trash
90 movab 2b,(sp)
91 rei