mpcc ports hang with TS_BUSY; bug report 4.3BSD-tahoe/sys/23
[unix-history] / usr / src / sys / tahoe / stand / srt0.c
CommitLineData
f0239511 1/* srt0.c 1.6 87/04/02 */
1e1f58c3
SL
2
3#include "../machine/mtpr.h"
4#define LOCORE
5
6/*
7 * Startup code for standalone system
8 */
9
10 .globl _end
1e1f58c3
SL
11 .globl _main
12 .globl __rtt
13 .globl _openfirst
14 .globl _start
f0239511
MK
15 .globl _boothowto
16 .globl _bootdev
1e1f58c3
SL
17
18 .set HIGH,31 # mask for total disable
19
947ad8db
SL
20#ifndef REL
21 .globl _device_space
22_device_space: # Tapemaster config block, etc.
23 .space 0x1000-RELOC
24
8de65f23
MK
25 .globl _entry
26_entry:
1e1f58c3
SL
27 .word 0x00 # 'call' by relsrt0.
28#endif
29_start:
30 mtpr $HIGH,$IPL # just in case
8de65f23 31#ifdef REL
947ad8db 32 movl $BOOTRELOC,sp
ae12cb14 33
947ad8db
SL
34 movl $RELOC,r0 /* source address to copy from */
35 movl $BOOTRELOC,r1 /* destination address */
600e8234 36 movl tdlen,r2 /* length to copy */
ae12cb14
BJ
37 addl2 r2,r0
38 addl2 r2,r1
1e1f58c3 39mvloop:
ae12cb14
BJ
40 decl r0
41 decl r1
1e1f58c3 42 movb (r0),(r1)
1e1f58c3 43 decl r2
ae12cb14
BJ
44 bgeq mvloop
45
8de65f23
MK
46/*
47 * zero bss
48 */
600e8234
MK
49 movl aedata,r1 /* destination address */
50 subl3 $_edata,$_end,r2 /* length to zero */
8de65f23
MK
51zloop:
52 movb $0,(r1)
53 incl r1
54 decl r2
55 bgeq zloop
56
600e8234
MK
57 mtpr $1,$PACC
58 mtpr $1,$PADC
1e1f58c3 59 jmp *abegin
8de65f23 60#endif
ae12cb14 61
1e1f58c3 62begin:
8de65f23 63 movl fp,ofp
f0239511
MK
64 movl r11,_boothowto
65 movl r10,_bootdev
1e1f58c3
SL
66 movl $1,_openfirst
67 callf $4,_main
8de65f23
MK
68#ifdef REL
69 halt
70#endif
71 ret
1e1f58c3
SL
72
73__rtt:
74 .word 0x0
8de65f23
MK
75#ifdef REL
76 halt
77#endif
78 movl ofp,fp
79 ret
1e1f58c3
SL
80
81 .data
82abegin: .long begin
947ad8db 83#ifdef REL
600e8234
MK
84aedata: .long _edata
85tdlen: .long _edata-BOOTRELOC
947ad8db 86#endif
8de65f23 87ofp: .long 0
f0239511
MK
88_boothowto: .long 0
89_bootdev: .long 0