              <<< NOTED::NOTES$7:[NOTES$LIBRARY]HACKERS.NOTE;1 >>>
                               -< ** Hackers ** >-
================================================================================
Note 1633.11             Change Boot Device on Alpha AXP                11 of 21
BRSTR2::SYSMAN "Dirk Van de moortel"                 89 lines  23-MAR-1994 04:03
                       -< BOOT.MAR without the bugcheck >-
--------------------------------------------------------------------------------
re .your_mail

>	the returned status in R0 from the console routine isn't in the
>	same format as the usual VMS statuses, i.e. it is a 64-bit value
>	with:
>		status = R0;	
>			R0<63:61> '000'   success
>			          '001'   success, byte-stream truncated
>			          '110'   failure, variable not recognized
>			R0<60:32> SBZ
>			R0<31:0>  count of returned bytes
>
>	So in order to get a clean run, you should add a
>
>		movl	#ss$_normal,r0
>
>	before RET'ing out of kernel mode. And of course for a very clean
>	programming practice, you should also the above mentioned status.
>
>	/cmos

Excellent... now it's clean!

Thanks very very very much: finally I can backup/restore my AXP's without
leaving my desk :-)

Dirk

P.S. Just for clarity: here is the complete macro source of the program

;==============================================================================
; Instructions:
; -------------
; - If you want the bugchek, remove the comments at the bottom...
; - Customize the values of boot_dev and bootcmd_dev in the source
; - save this file into BOOT.MAR
;
; $ macro boot
; $ link/notrace/nodebug/sysexe boot, -
;     sys$share:vms$volatile_private_interfaces.olb/incl=bugcheck_codes
; $ run
; $ @sys$system:shutdown [...]		! unless bugcheck is included
; ---------------------------------------------------------------------------
	.library	/sys$library:lib/

	$hwrpbdef
	$syspardef

	.psect	data	quad,rd,wrt,noexe
boot_dev:	.ascii	/SCSI 0 6 0 0 300 0 FLAMG-IO/
boot_dev_l	= .-boot_dev
bootcmd_dev:	.ascii	/DKA300/
bootcmd_dev_l	= .-bootcmd_dev


	.psect	code	quad,rd,nowrt,exe

	.entry	boot,^m<>
	$cmkrnl_s -				; must do it from kernel mode
		routin=boot_krnl
	ret					; should end up here

	.entry	boot_krnl,^m<r2,r3,r4>
	movl	g^exe$gpq_hwrpb,r2		; point to HWRPB
	addl3	hwrpb$iq_crb_offset(r2),r2,r3	; point to CRB
	movl	hwrpb_crb$iq_va_dispatch_pd(r3),r4
						; dispatch PD
	pushl	#bootcmd_dev_l			; length and pointer
	pushab	bootcmd_dev			; to boot command device
	pushl	#hwrpb_crb$k_bootcmd_dev	; which env variable
	pushl	#hwrpb_crb$k_set_env		; want to set environment var
	calls	#4,(r4)				; call dispatch routine
	pushl	#boot_dev_l			; length and pointer
	pushab	boot_dev			; to boot device
	pushl	#hwrpb_crb$k_boot_dev		; which env variable
	pushl	#hwrpb_crb$k_set_env		; want to set env variable
	calls	#4,(r4)				; call dispatch routine
	
; next 3 lines removed: I prefer a clean system shutdown with autoreboot.
; -----------------------------------------------------------------------
;	moval	g^exe$gl_flags,r2		; exec flags
;	bbcc	#exe$v_bugdump,(r2),10$		; clear bug dump flag bit
;10$:	bug_check	halt,fatal,cold_boot	; bugcheck and force cold boot
; -----------------------------------------------------------------------
	movl    #ss$_normal,r0			; force normal exit
	ret					; should end up here

	.end	boot
;==============================================================================
