head     1.4;
access   paws bayes danm geli hal jch jws brad larry;
symbols  ;
locks    ; strict;
comment  @# @;


1.4
date     86.08.14.19.08.35;  author hal;  state Exp;
branches ;
next     1.3;

1.3
date     86.08.13.09.56.07;  author hal;  state Exp;
branches ;
next     1.2;

1.2
date     86.08.12.10.57.06;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.08.08.16.56.38;  author hal;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


1.4
log
@Change algorithm a bit.  Load addr now filled in by TURNIT,
not gotten from boot file.  Code size is calculated back from
the lowest high memory used by the boot ROM.  As a result,
we save two passes of the LIBRARIAN per SYSTEM_P version.
It's also 42 bytes instead of 50.
@
text
@*       Relocates a SYSTEM_P file loaded at the wrong address by
*       the HP-UX booter.  Sets hfsbflg to TRUE if relocation
*       was necessary (it's not if SYSTEM_P was loaded directly by
*       the BOOTROM).  Only included in HFS SYSTEM_P.

	mname   relocatesys

	lmode   initload_initload       standard pre-3.2 OS starts here
	refa    initload_initload

	refa    hfsbflg                 relocation flag

* The following line is filled in by TURNIT with the -r arg to the LIBRARIAN
loadaddress equ -25000

* -1344 is first highmem location used by 4.0 BootROM
codesize    equ     -1344-loadaddress

startreloc equ  *

	start   startreloc              SYSTEM_P starts execution here, but
*                                       OS starts at INITLOAD_INITLOAD

	lea     startreloc,a4           where has OS been loaded?
	lea     loadaddress,a5
	cmpa.l  a5,a4
	beq.s   code_in_place           loaded at proper address


	move.l  #codesize,d0
	adda.l  d0,a4
	adda.l  d0,a5
	bra.s   midloop

movecode equ    *
	move.b  -(a4),-(a5)
midloop dbra    d0,movecode

	move.w  #1,hfsbflg              set hfsbflg (short) to 1

code_in_place equ *
	jmp     initload_initload       OS is now at proper address, so start
*                                       execution

	end


@


1.3
log
@Make hfsbflg absolute, not relative, and set it after code is relocated.
@
text
@a10 2
	refr    lowcode                 low code address of standard OS
*                                       MUST be PC relative
d13 2
a14 4
codesize    equ 0                       modified by TURNIT once codesize
*                                       (excluding size of this code) is known
loadaddress equ 0                       modified by TURNIT once loadaddress
*                                       is known
d16 3
d25 2
a26 1
	cmpa.l  #loadaddress,a4
d30 4
a33 4
	movea.l #topend,a5              not at proper address, so move it
	lea     lowcode,a4
	adda.l  #codesize,a4
	move.l  #codesize-1,d0
d37 1
a37 1
	dbra    d0,movecode
a43 6

endreloc equ    *

relocsize equ   endreloc-startreloc

topend  equ     loadaddress+relocsize+codesize    top end of OS + 1
@


1.2
log
@hfsbflg now a short, not a boolean.
@
text
@d13 1
a13 2
	refr    hfsbflg                 relocation flag -- also must be
*                                       PC relative
a28 1
	move.w  #1,hfsbflg              set hfsbflg (short) to 1
d38 2
@


1.1
log
@Initial revision
@
text
@d30 1
a30 2
	lea     hfsbflg,a0              get address of relocate flag
	move.b  #1,(a0)                 set it to true
@
