xref: /csrg-svn/sys/tahoe/stand/srt0.c (revision 29553)
1*29553Sroot /*	srt0.c	1.2	86/07/13	*/
225870Ssam 
325870Ssam #include "../machine/mtpr.h"
425870Ssam #define	LOCORE
525870Ssam 
625870Ssam /*
725870Ssam  * Startup code for standalone system
825870Ssam  */
925870Ssam 
1025870Ssam 	.globl	_end
1125870Ssam 	.globl	_main
1225870Ssam 	.globl	__rtt
1325870Ssam 	.globl	_openfirst
1425870Ssam 	.globl	_start
1525870Ssam 
1625870Ssam 	.set	HIGH,31		# mask for total disable
1725870Ssam 
1825870Ssam #ifndef	REL
1925870Ssam 	.word	0x00			# 'call' by relsrt0.
2025870Ssam #endif
2125870Ssam _start:
2225870Ssam 	mtpr	$HIGH,$IPL		# just in case
23*29553Sroot 	movl	$RELOC,sp
2425870Ssam 
2525870Ssam 	movl	$0x800,r0	/* source address to copy from */
2625870Ssam 	movl	$RELOC,r1	/* destination address */
2725870Ssam 	movl	aend,r2		/* length */
28*29553Sroot 	addl2	r2,r0
29*29553Sroot 	addl2	r2,r1
3025870Ssam mvloop:
31*29553Sroot 	decl	r0
32*29553Sroot 	decl	r1
3325870Ssam 	movb	(r0),(r1)
3425870Ssam 	decl	r2
35*29553Sroot 	bgeq	mvloop
36*29553Sroot 
3725870Ssam 	mtpr	$0,$PACC
3825870Ssam 	jmp	*abegin
39*29553Sroot 
4025870Ssam begin:
4125870Ssam 	movl	$1,_openfirst
4225870Ssam 	callf	$4,_main
4325870Ssam 	jmp	begin
4425870Ssam 
4525870Ssam __rtt:
4625870Ssam 	.word	0x0
4725870Ssam 	jmp	begin
4825870Ssam 
4925870Ssam 	.data
5025870Ssam abegin:	.long	begin
51*29553Sroot aend:	.long	_end-RELOC-0x800
52*29553Sroot aedata:	.long	_edata-RELOC-0x800
5325870Ssam 	.globl	_entry
5425870Ssam 	.set	_entry,0x800
55