Mercurial > hg > Members > kono > nitros9-code
annotate 3rdparty/booters/boot_rom.asm @ 657:d2ce1c213a9c
Changed boot_ktlr and boot_tc3 to add id0 for SCSI ID
author | boisy |
---|---|
date | Sat, 21 Dec 2002 15:30:11 +0000 |
parents | 3e3f1f79ba00 |
children |
rev | line source |
---|---|
45 | 1 ******************************************************************** |
392 | 2 * Boot - OS-9 Level Two ROM Boot Module |
45 | 3 * |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
8 * 1 Created BGP 98/??/?? | |
9 | |
10 nam Boot | |
392 | 11 ttl OS-9 Level Two ROM Boot Module |
45 | 12 |
13 ifp1 | |
14 use defsfile | |
15 endc | |
16 | |
17 tylg set Systm+Objct | |
18 atrv set ReEnt+rev | |
19 rev set $01 | |
20 edition set 1 | |
21 | |
22 mod eom,name,tylg,atrv,start,size | |
23 | |
24 size equ . | |
25 | |
26 name fcs /Boot/ | |
27 fcb edition | |
28 | |
29 start equ * | |
30 * obtain bootfile size at known offset | |
31 pshs u,y,x,a,b,cc | |
32 orcc #IntMasks mask interrupts | |
33 | |
34 * allocate memory from system | |
35 * memory will start at $8000, blocks 1, 2, 3 and 3F | |
36 * we allocate $100 bytes more so that the memory will start | |
37 * exactly at $8000 | |
38 ldd #$8000-$1300 | |
39 os9 F$BtMem | |
40 bcs Uhoh | |
41 | |
42 stu 3,s save pointer in X on stack | |
43 std 1,s save size in D on stack | |
44 | |
45 * TRICK! Map block 4 into $4000, copy our special ROM copy code | |
46 * there, then jmp to it! | |
47 lda $FFA2 | |
48 pshs a | |
49 lda #$04 | |
50 sta $FFA2 | |
51 ldd #RelCodeL code less than 256 bytes | |
52 leax RelCode,pcr | |
53 ldy #$4800 | |
54 Copy lda ,x+ | |
55 sta ,y+ | |
56 decb | |
57 bne Copy | |
58 | |
59 Jump jsr $4800 * jump to rel code | |
60 puls a restore original block at $4000 | |
61 sta $FFA2 | |
62 | |
63 * Upon exit, we return to the kernel with: | |
64 * X = address of bootfile | |
65 * D = size of bootfile | |
66 * CC = carry cleared | |
67 ExitOK andcc #^Carry clear carry | |
68 Uhoh puls u,y,x,a,b,cc,pc | |
69 | |
70 | |
71 * this code executes at $4800 | |
72 RelCode equ * | |
73 lda #$4E CC3 mode, MMU, 32K ROM | |
74 sta $FF90 | |
75 sta $FFDE ROM/RAM mode | |
76 | |
77 * Map ROM Blocks in | |
78 ldd #$3C3D | |
79 std $FFA4 | |
80 lda #$3E | |
81 sta $FFA6 | |
82 | |
83 * Map block 1 at $6000 | |
84 lda $FFA3 | |
85 pshs a | |
86 lda #$01 | |
87 sta $FFA3 | |
88 * Copy first 8K of ROM | |
89 ldx #$8000 | |
90 ldy #$6000 | |
91 Loop1 ldd ,x++ | |
92 std ,y++ | |
93 cmpx #$A000 | |
94 blt Loop1 | |
95 | |
96 * Map block 2 at $6000 | |
97 lda #$02 | |
98 sta $FFA3 | |
99 * Copy second 8K of ROM | |
100 ldx #$A000 | |
101 ldy #$6000 | |
102 Loop2 ldd ,x++ | |
103 std ,y++ | |
104 cmpx #$C000 | |
105 blt Loop2 | |
106 | |
107 * Map block 3 at $6000 | |
108 lda #$03 | |
109 sta $FFA3 | |
110 * Copy third 8K of ROM | |
111 ldx #$C000 | |
112 ldy #$6000 | |
113 Loop3 ldd ,x++ | |
114 std ,y++ | |
115 cmpx #$E000 | |
116 blt Loop3 | |
117 | |
118 * Copy remaining ROM area ($8000-$1400) | |
119 lda #$3F | |
120 sta $FFA3 | |
121 ldx #$E000 | |
122 ldy #$6000 | |
123 Loop4 clr $FFDE put in ROM/RAM mode to get byte | |
124 ldd ,x++ | |
125 clr $FFDF put back in RAM mode to store byte | |
126 std ,y++ | |
127 cmpx #$EC00 | |
128 blt Loop4 | |
129 * ldx #$6000 | |
130 * ldy #$E000 | |
131 *Loop5 ldd ,x++ | |
132 * std ,y++ | |
133 * cmpx #$6C00 | |
134 * blt Loop5 | |
135 | |
136 lda D.HINIT restore GIME HINIT value | |
137 sta $FF90 | |
138 puls a restore org block at $6000 | |
139 sta $FFA3 | |
140 lda #$03 | |
141 sta $FFA6 | |
142 ldd #$0102 | |
143 std $FFA4 | |
144 rts | |
145 | |
146 RelCodeL equ *-RelCode | |
147 | |
148 * Fillers to get to $1D0 | |
459
3e3f1f79ba00
Sources now use 'fill' pseudo-op to fill out for L2 modules
boisy
parents:
392
diff
changeset
|
149 Pad fill $39,$1D0-3-* |
45 | 150 |
151 emod | |
152 eom equ * | |
153 end |