Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_rampak.asm @ 3169:1ff3d7673e36
mc09 l2: bring sys/makefile in line with latest organisation for other platforms
Revise bootfiles/makefile to remove sysgo from bootfile - it can be
found on the root of the disk.
author | Neal Crook <foofoobedoo@gmail.com> |
---|---|
date | Mon, 17 Apr 2017 22:59:28 +0100 |
parents | e0614e08fa5e |
children |
rev | line source |
---|---|
1187 | 1 ******************************************************************** |
2 * Boot - Disto RAMPak Boot Module | |
3 * | |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
4 * Provides HWInit, HWTerm, HWRead which are called by code in |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
5 * "use"d boot_common.asm |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
6 * |
1187 | 7 * $Id$ |
8 * | |
1287 | 9 * Edt/Rev YYYY/MM/DD Modified by |
10 * Comment | |
1187 | 11 * ------------------------------------------------------------------ |
1287 | 12 * 5 ????/??/?? Alan DeKok |
13 * Created. | |
14 * | |
15 * 6 1998/10/20 Boisy G. Pitre | |
16 * Fixed small bugs, improved speed. | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
17 * |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
18 * 7 2005/10/14 Boisy G. Pitre |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
19 * Now uses boot_common.asm for fragmented bootfile support. |
1187 | 20 |
21 nam Boot | |
22 ttl Disto RAMPak Boot Module | |
23 | |
24 * Disassembled 94/06/25 11:37:47 by Alan DeKok | |
25 | |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
26 IFP1 |
1187 | 27 use defsfile |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
28 ENDC |
1187 | 29 |
30 tylg set Systm+Objct | |
31 atrv set ReEnt+rev | |
32 rev set $00 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
33 edition set 7 |
1187 | 34 |
35 mod eom,name,tylg,atrv,start,size | |
36 | |
1894 | 37 * Common booter-required defines |
38 LSN24BIT equ 0 | |
39 FLOPPY equ 0 | |
40 | |
41 | |
1187 | 42 * on-stack buffer to use |
43 org 0 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
44 mpisave rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
45 * common booter required static variables |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
46 ddtks rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
47 ddfmt rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
48 seglist rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
49 bootsize rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
50 blockloc rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
51 blockimg rmb 2 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
52 LSN0Ptr rmb 2 In memory LSN0 pointer |
1187 | 53 size equ . |
54 | |
55 name equ * | |
56 fcs /Boot/ | |
57 fcb edition | |
58 | |
2049 | 59 use boot_common.asm |
1187 | 60 |
1894 | 61 * HWInit - Initialize the device |
62 * Entry: Y = hardware address | |
63 * Exit: Carry Clear = OK, Set = Error | |
64 * B = error (Carry Set) | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
65 HWInit lda >MPI.Slct get current slot |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
66 sta mpisave,u |
1187 | 67 lda >PakSlot,pcr get multipak slot number |
68 bmi cont if >127, invalid slot number | |
69 anda #$03 force it to be legal | |
70 ldb #$11 | |
71 mul put it into both nibbles | |
72 stb >MPI.Slct go to the desired slot | |
1894 | 73 cont clrb |
74 rts | |
1187 | 75 |
76 | |
1894 | 77 * HWTerm - Terminate the device |
78 * Entry: Y = hardware address | |
79 * Exit: Carry Clear = OK, Set = Error | |
80 * B = error (Carry Set) | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
81 HWTerm lda mpisave,u |
1187 | 82 sta >MPI.Slct |
1894 | 83 clrb |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
84 rts |
1187 | 85 |
86 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
87 * HWRead - Read a 256 byte sector from the device |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
88 * Entry: Y = hardware address |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
89 * B = bits 23-16 of LSN |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
90 * X = bits 15-0 of LSN |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
91 * blockloc,u = ptr to 256 byte sector |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
92 * Exit: X = ptr to data (i.e. ptr in blockloc,u) |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
93 * Carry Clear = OK, Set = Error |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
94 HWRead tfr x,d move 16 bit LSN into 2 8-bit registers |
1187 | 95 sta 2,y save HB LSN |
96 stb 1,y save LB LSN | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
97 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
98 ldx blockloc,u |
1187 | 99 clrb and start out at byte zero |
100 | |
101 ReadLp stb ,y save byte number | |
102 lda 3,y grab the byte | |
103 sta ,x+ save in the buffer | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
104 incb go to the next byte |
1187 | 105 bne ReadLp |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
106 leax -256,x |
1187 | 107 clrb no errors |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
108 rts |
1187 | 109 |
1287 | 110 IFGT Level-1 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
111 * L2 kernel file is composed of rel, boot, krn. The size of each of these |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
112 * is controlled with filler, so that (after relocation): |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
113 * rel starts at $ED00 and is $130 bytes in size |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
114 * boot starts at $EE30 and is $1D0 bytes in size |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
115 * krn starts at $F000 and ends at $FEFF (there is no 'emod' at the end |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
116 * of krn and so there are no module-end boilerplate bytes) |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
117 * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
118 * Filler to get to a total size of $1D0. 3, 2, 1 represent bytes after |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
119 * the filler: the end boilerplate for the module, fdb and fcb respectively. |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
120 Pad fill $39,$1D0-3-2-1-* |
1287 | 121 ENDC |
1187 | 122 |
123 Address fdb $FF40 address of the device to boot from | |
124 PakSlot fcb $01 multipak slot number | |
125 | |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
126 emod |
1187 | 127 eom equ * |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2049
diff
changeset
|
128 end |