summaryrefslogtreecommitdiff
path: root/sys/src/9/alphapc/initcode
blob: a43139dead6f7ec01fe34ecb9876e65326aeb31d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "/sys/src/libc/9syscall/sys.h"

/*
 *  we pass in the argument of the exec parameters as 0(FP)
 */

TEXT	main(SB),$16

	MOVQ	$setSB(SB), R29
	MOVQ	$boot(SB), R0
	ADDQ	$24, R30, R1	/* get a pointer to 0(FP) */
	MOVL	R0, 8(R30)
	MOVL	R1, 12(R30)
	JSR	exec(SB)

	MOVQ	$(1<<4), R0
	MOVL	R0, 8(R30)
	MOVQ	$RFORK, R0
	CALL_PAL $0x83
	MOVQ	$RFORK, R0
	CALL_PAL $0x83
	MOVQ	$RFORK, R0
	CALL_PAL $0x83
again:
	ADDL	$1, R1
	MOVQ	$0, R0	/* print r1 */
	CALL_PAL $0x83
	MOVQ	$100000000, R2
foo:
	SUBQ	$1, R2
	BNE	R2, foo
	MOVQ	$1000, R0
	MOVL	R0, 8(R30)
	MOVQ	$SLEEP, R0
	CALL_PAL $0x83
	JMP	again

TEXT	exec(SB), $0
	MOVQ	$EXEC, R0
	CALL_PAL $0x83
	RET

DATA	boot+0(SB)/5,$"/boot"
DATA	boot+5(SB)/5,$"/boot"
DATA	bootv+0(SB)/4,$boot+6(SB)
GLOBL	boot+0(SB),$11
GLOBL	bootv+0(SB),$8