;****************************************************
;*
;* Globals
;*
;****************************************************

	.global	_T0S0, _T1S0, _T1S1

;****************************************************
;*
;* Constants
;*
;****************************************************


SYSTEM	.equ	0A000000h	; system address
SYSSTK	.equ	SYSTEM+0BFFEh	; system stack top
rtc_ext	.equ	02000022h	; real-time clock
				;  ext. call addr

BPT	.equ	16		; #blocks in a track
BPS	.equ	256		; #bytes in a sector
NBLKS	.equ	2*16		; #blocks in boot 
HDRSIZE	.equ	24		; #bytes in header
FILSIZE .equ	256*(NBLKS-1)	; file data size
SYSSIZE	.equ	FILSIZE-HDRSIZE	; total system size
S1SIZE	.equ	BPS-HDRSIZE	; data in sector 1

SEG4	.equ	04000000h
SEG2	.equ	02000000h

SYSPSA	.equ	SEG2+100h	; system PSA
BOOTPSA	.equ	SEG4+100h	; PSA in PROM for boot



;****************************************************
;*
;* Track 0 Sector 0
;*
;*	This sector contains the pointer to the
;*	bootstrap file's FDB.
;*
;****************************************************

__data:	.sect

_T0S0:

	.byte	0		; major version
	.byte	0		; minor version
	.word	40		; #tracks/surface ?? 35 ??
	.byte	2		; #surfaces
	.byte	16		; #sectors/track
	.word	256		; #bytes/sector
	.word	40		; ??? track # of control blk
	.word	38h		; ??? vdb size
	.word	136		; ??? block bitmap size
	.byte	30		; ??? directory bitmap size
	.byte	0		; ??? track count direction ???
	.byte	0		; number of uses (if 0, no boot)
	.byte	0		; copy protection (OFF)
	.byte	0		; boot block read protect (OFF)
	.byte	0		; boot block write protect (OFF)
	.word	0		; soft error count
	.word	0		; hard error count
	.word	0		; lowest useable track side 0 ?1?
	.word	39		; highest 
	.word	0		;			side 1
	.word	39		;
	.word	0		;			side 2
	.word	0		;
	.word	0		;			side 3
	.word	0		;
	.long	BPT		; BOOT FILE FDB BLOCK NUMBER
	.byte	"PCOS"		; system name??
	.long	2		; ??? directory start addr
	.long	0		; ??? drive data ???
	.long	0
	.long	0
	.long	0
	.long	0
	.word	1		; disk valid (VALID)
	.byte	0		; drive number required ???
	.byte	0		; disk open
	.byte	0		; format major version #
	.byte	0		;        minor
	.byte	2		; disk type = 320Kb
	.byte	0		; 27 bytes of nothing
	.byte	0		; 26
	.byte	0		; 25
	.byte	0		; 24
	.byte	0		; 23
	.byte	0		; 22
	.byte	0		; 21
	.byte	0		; 20
	.byte	0		; 19
	.byte	0		; 18
	.byte	0		; 17
	.byte	0		; 16
	.byte	0		; 15
	.byte	0		; 14
	.byte	0		; 13
	.byte	0		; 12
	.byte	0		; 11
	.byte	0		; 10
	.byte	0		;  9
	.byte	0		;  8
	.byte	0		;  7
	.byte	0		;  6
	.byte	0		;  5
	.byte	0		;  4
	.byte	0		;  3
	.byte	0		;  2
	.byte	0		;  1
	.block  22		;  forgotten, aparently






;****************************************************
;*
;* Track 1 Sector 0
;*
;*	This sector is the FDB for the bootstrap 
;*	file.  It has a single extent.
;*
;****************************************************

_T1S0:
	.long	FILSIZE		; file length in bytes
	.word	1		; #extents
	.byte	0		; 14 password (14 bytes)
	.byte	0		; 13
	.byte	0		; 12
	.byte	0		; 11
	.byte	0		; 10
	.byte	0		;  9
	.byte	0		;  8
	.byte	0		;  7
	.byte	0		;  6
	.byte	0		;  5
	.byte	0		;  4
	.byte	0		;  3
	.byte	0		;  2
	.byte	0		;  1
	.word	0		; ??? verify location ???
	.byte	0		; write protect
	.byte	0		; future
	.long	BPT+1		; STARTING BLOCK OF EXTENT
	.word	NBLKS-1		; NUMBER OF BLOCKS IN EXTENT
	.block	222		; other extents
	.long	0		; next fdb





;****************************************************
;*
;* Track 1 Sector 1
;*
;*	This sector is the header for the bootstrap
;*	file, followed by the first S1SIZE bytes of
;*	data, which are copied in.
;*
;****************************************************

_T1S1:

	.word	0101h		; magic number
	.byte	"PCPM"		; identifier
	.byte	"x01."
	.byte	"01"

	.long	SYSTEM		; starting addr.
	.word	1		; #code blocks

	.long	SYSTEM		; load address
	.word	SYSSIZE/2	; #words

s1data  .block	S1SIZE		; data area


