xref: /csrg-svn/sys/tahoe/stand/srt0.c (revision 25870)
1 /*	srt0.c	1.1	86/01/12	*/
2 /*	srt0.c	4.8	81/04/03	*/
3 /*  Tahoe version.	82/11/09	*/
4 
5 #include "../machine/mtpr.h"
6 #define	LOCORE
7 
8 /*
9  * Startup code for standalone system
10  */
11 
12 	.globl	_end
13 	.globl	_edata
14 	.globl	_main
15 	.globl	__rtt
16 	.globl	_openfirst
17 	.globl	_start
18 
19 	.set	HIGH,31		# mask for total disable
20 
21 #ifndef	REL
22 	.word	0x00			# 'call' by relsrt0.
23 #endif
24 _start:
25 	mtpr	$HIGH,$IPL		# just in case
26 	movl	$(RELOC),sp
27 	movl	$RELOC,r0
28 	subl2	aedata,r0
29 	shar	$2,r0,r0
30 	clrl	r1		/* used to clear the memory */
31 clr:
32 	pushl	r1
33 	decl	r0		/* decrement counter */
34 	jgeq	clr		/* more to clear */
35 
36 	movl	$RELOC,sp
37 	movl	$0x800,r0	/* source address to copy from */
38 	movl	$RELOC,r1	/* destination address */
39 	movl	aend,r2		/* length */
40 	subl2	$0x800,r2
41  #	movblk
42  # simple loop replaces movblk - until hardware people are ready
43 mvloop:
44 	movb	(r0),(r1)
45 	incl	r0
46 	incl	r1
47 	decl	r2
48 	bneq	mvloop
49 	.globl	goup
50 	mtpr	$0,$PACC
51 jumphigh:
52 	.set	goup,jumphigh+0x800-RELOC
53 	jmp	*abegin
54 begin:
55 	movl	$1,_openfirst
56 	callf	$4,_main
57 	jmp	begin
58 
59 __rtt:
60 	.word	0x0
61 	jmp	begin
62 
63 	.data
64 abegin:	.long	begin
65 aend:	.long	_end-RELOC+0x800
66 aedata:	.long	_edata-RELOC+0x800
67 	.globl	_entry
68 	.set	_entry,0x800
69