xref: /csrg-svn/sys/tahoe/stand/srt0.c (revision 29553)
1 /*	srt0.c	1.2	86/07/13	*/
2 
3 #include "../machine/mtpr.h"
4 #define	LOCORE
5 
6 /*
7  * Startup code for standalone system
8  */
9 
10 	.globl	_end
11 	.globl	_main
12 	.globl	__rtt
13 	.globl	_openfirst
14 	.globl	_start
15 
16 	.set	HIGH,31		# mask for total disable
17 
18 #ifndef	REL
19 	.word	0x00			# 'call' by relsrt0.
20 #endif
21 _start:
22 	mtpr	$HIGH,$IPL		# just in case
23 	movl	$RELOC,sp
24 
25 	movl	$0x800,r0	/* source address to copy from */
26 	movl	$RELOC,r1	/* destination address */
27 	movl	aend,r2		/* length */
28 	addl2	r2,r0
29 	addl2	r2,r1
30 mvloop:
31 	decl	r0
32 	decl	r1
33 	movb	(r0),(r1)
34 	decl	r2
35 	bgeq	mvloop
36 
37 	mtpr	$0,$PACC
38 	jmp	*abegin
39 
40 begin:
41 	movl	$1,_openfirst
42 	callf	$4,_main
43 	jmp	begin
44 
45 __rtt:
46 	.word	0x0
47 	jmp	begin
48 
49 	.data
50 abegin:	.long	begin
51 aend:	.long	_end-RELOC-0x800
52 aedata:	.long	_edata-RELOC-0x800
53 	.globl	_entry
54 	.set	_entry,0x800
55