|
|
1.1 root 1: #
2: # primitives to stop the machine
3: # with and without rebooting
4: # comet (750) version
5: #
6:
7: #
8: # death stops the machine cold, without rebooting
9: # we're not allowed to halt because it's hard to guarantee
10: # that we'll really halt, and not reboot or restart
11: #
12:
13: .globl _death
14: _death: .word 0x0
15: mtpr $HIGH,$IPL
16: pushab deathmsg
17: calls $1,_printf
18: dl: brb dl
19:
20: deathmsg:
21: .asciz "death\n\n"
22:
23: #
24: # reboot restarts the machine, if possible
25: # we ask for an auto-restart
26: # which will take a crash dump and then boot
27: # registers saved here because comet may spoil them otherwise
28: #
29:
30: .globl _reboot
31: _reboot: .word 0x0
32: clrl r0
33: rb0: aobleq $1000000,r0,rb0 # about 1 sec delay, to let disk finish
34: mtpr $HIGH,$IPL # from here on, no interruptions!
35: movl sp,rebsp # save current stack
36: moval rebsp,sp # get ptr to register save place
37: pushr $0x3fff # save the registers there
38: movl rebsp,sp # and get the real stack back
39: mfpr $PCBB,rebpcb
40: jbr doadump
41:
42: .data
43: .globl rebregs
44: .globl rebsp
45: .globl rebpcb
46: rebregs:
47: .space 14*4 # place to store registers from crash
48: rebsp: .space 4
49: rebpcb: .space 4 # place for pcbb at crash
50:
51: .text
52:
53: #
54: # place to call on auto-restart,
55: # from the restart parameter block
56: #
57:
58: .globl restart
59: .align 2
60: restart:
61: bbss $0,_rpb+12,0f # console should do this, but doesn't
62: 0:
63: # cmpl $PFMAGIC,pfmagic # power fail?
64: # bneq doadump # no
65: # clrl _rpb+12 # yes: flag further restarts ok
66: # jmp Xpowrec # and do power recovery
67:
68: #
69: # not a power fail
70: # take a crash dump and reboot
71: # registers have already been saved (above)
72: #
73: # crash dump routine is called as
74: # dump(dev, low, size)
75: #
76:
77: .globl doadump
78: doadump:
79: mtpr $HIGH,$IPL # no interrupts
80: mtpr $0,$MAPEN # turn off memory management
81: movab dumpstack,sp # set up a clean stack
82: pushab dumping
83: calls $1,_printf
84: # pushl _dumpsize
85: # pushl _dumplow
86: # pushl _dumpdev
87: # calls $3,*_dumprout
88: clrl r5 # boot flags; magic: r5 undisturbed in setboot
89: calls $0,_setboot
90: halt
91:
92: dumping: .asciz "dumping core\n"
93:
94: .data
95: .align 2
96: .globl dumpstack
97: .space 58*4 # separate stack for dumps
98: dumpstack:
99: .space 4
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.