annotate level1/modules/boot_common.asm @ 3246:be3446f758ca

Updated dwread.asm and dwwrite.asm so that the 6551 routines could have specially defined flags so that some of the addresses could be overridden by the make files if needed.
author David Ladd <drencor-xeen@users.sourceforge.net>
date Sun, 11 Mar 2018 01:30:30 -0600 (2018-03-11)
parents e0614e08fa5e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
1 ********************************************************************
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
2 * Boot Common - Common code for NitrOS-9 booters
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
3 *
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
4 * $Id$
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
5 *
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
6 * This common file is not a stand-alone module, but is 'used' by boot module
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
7 * source files to bring in support for booting from RBF file systems that have
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
8 * either standard or new-style fragmented bootfiles.
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
9 *
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
10 * This code uses several static variables which are expected to be defined in
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
11 * the main boot source code. See a booter like boot_1773.asm for an example on
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
12 * how to write a booter which uses this code.
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
13 *
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
14 * Important Notes:
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
15 * For certain devices, only the lower 16 bits of DD.BT are used. This special
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
16 * case allows us to save some code by ignoring the loading LSN bits 23-16 in
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
17 * DD.BT and FDSL.A. Booters for such devices (floppy, RAMPak) should have the
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
18 * following line in their code to take advantage of this optimization:
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
19 *
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
20 * LSN24BIT equ 0
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
21 *
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
22 * Floppy booters require the acquistion of DD.TKS and DD.FMT from LSN0 to make
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
23 * certain decisions about the boot process. In most cases, non-floppy booters
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
24 * do not need these values. Hence, floppy booters should have this line in their
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
25 * source code file:
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
26 *
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
27 * FLOPPY equ 1
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
28 *
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
29 * Edt/Rev YYYY/MM/DD Modified by
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
30 * Comment
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
31 * ------------------------------------------------------------------
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
32 * 2005/10/14 Boisy G. Pitre
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
33 * Created as a stand-alone file.
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
34 *
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
35 * 2005/10/16 Boisy G. Pitre
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
36 * Further optimizations made
1964
0f25486b1d23 Added pointer to loaded LSN0 to data passed to hardware dependent section
afra
parents: 1952
diff changeset
37 *
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
38 * 2006/01/04 P.Harvey-Smith.
1964
0f25486b1d23 Added pointer to loaded LSN0 to data passed to hardware dependent section
afra
parents: 1952
diff changeset
39 * Added pointer to loaded LSN0 to data passed to hardware dependent section.
0f25486b1d23 Added pointer to loaded LSN0 to data passed to hardware dependent section
afra
parents: 1952
diff changeset
40 *
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
41 * 2007/08/23 Boisy G. Pitre
2117
093b7a304dd1 Added subd #$00FF to undo addd #$00FF... fixed issue where F$SRqMem for bootfile was allocating one additional page more than needed
boisy
parents: 1964
diff changeset
42 * Added 'subd #$00FF' to counteract earlier 'addd #$00FF'. We need to undo
093b7a304dd1 Added subd #$00FF to undo addd #$00FF... fixed issue where F$SRqMem for bootfile was allocating one additional page more than needed
boisy
parents: 1964
diff changeset
43 * to give F$SRqMem the right amount of memory to allocate.
093b7a304dd1 Added subd #$00FF to undo addd #$00FF... fixed issue where F$SRqMem for bootfile was allocating one additional page more than needed
boisy
parents: 1964
diff changeset
44 *
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
45 * 2007/08/24 Boisy G. Pitre
2119
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
46 * We no longer use F$SRqMem to get the 256 byte buffer for LSN0, but
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
47 * instead allocate the memory temporarily off the stack. This gives us
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
48 * two system ram pages that were not available before, and also prevents
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
49 * a needless system call.
2120
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
50 * Note: For Level 1, we actually use the page above the stack at $500-$5FF
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
51 * to hold LSN0 during the bootfile acquisition process. This is because the
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
52 * system stack is only 256 bytes and we are using more than that. Since
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
53 * the module directory table is at $400-$4FF, we must do this; otherwise, we
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
54 * would overwrite the bottom portion of the module directory table and corrupt
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
55 * it (it's already setup by krn before boot is called!)
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
56
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
57 start orcc #IntMasks ensure IRQs are off (necessary?)
2119
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
58 * allocate memory on stack for vars and sector buffer
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
59 IFEQ Level-1
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
60 * Level 1: stack is only 256 bytes and its bottom runs against moddir ptrs..
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
61 * so cheat and use free page just above stack as 256-byte disk buffer
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
62 leas -size,s
2120
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
63 tfr s,u get pointer to data area
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
64 ldx #$500
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
65 ELSE
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
66 leas -size-256,s
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
67 tfr s,u get pointer to data area
2119
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
68 leax size,u point U to 256 byte sector buffer
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
69 ENDC
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
70 pshs u save pointer to data area
2119
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
71 stx blockloc,u
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
72
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
73 * Initialize Hardware
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
74 ldy Address,pcr get hardware address
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
75 lbsr HWInit
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
76
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
77 * Read LSN0
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
78 IFNE LSN24BIT
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
79 clrb MSB sector
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
80 ENDC
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
81 ldx #0 LSW sector
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
82 lbsr HWRead read LSN 0
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
83 bcs error branch if error
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
84
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
85 IFGT Level-1
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
86 lda #'0 --- loaded in LSN0'
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
87 jsr <D.BtBug ---
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
88 ENDC
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
89
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
90 stx LSN0Ptr,u Save LSN0 pointer
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
91 * Pull relevant values from LSN0
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
92 IFNE FLOPPY
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
93 lda DD.TKS,x number of tracks on this disk
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
94 ldb DD.FMT,x disk format byte
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
95 std ddtks,u TAKE NOTE! ASSUMES ADJACENT VARS!
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
96 ENDC
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
97 ldd DD.BSZ,x os9boot size in bytes
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
98 beq FragBoot if zero, do frag boot
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
99 std bootsize,u
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
100 * Old style boot -- make a fake FD segment right from LSN0!
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
101 leax DD.BT,x
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
102 addd #$00FF round up to next page
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
103 * Important note: We are making an assumption that the upper 8 bits of the
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
104 * FDSL.B field will always be zero. That is a safe assumption, since an
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
105 * FDSL.B value of $00FF would mean the file is 65280 bytes. A bootfile
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
106 * under NitrOS-9 cannot be this large, and therefore this assumption
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
107 * is safe.
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
108 sta FDSL.B+1,x save file size
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
109 IFNE LSN24BIT
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
110 clr FDSL.S,x make next segment entry 0
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
111 ENDC
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
112 clr FDSL.S+1,x
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
113 clr FDSL.S+2,x
2117
093b7a304dd1 Added subd #$00FF to undo addd #$00FF... fixed issue where F$SRqMem for bootfile was allocating one additional page more than needed
boisy
parents: 1964
diff changeset
114 subd #$00FF undo previous add #$00FF
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
115 bra GrabBootMem
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
116
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
117 Back2Krn lbsr HWTerm call HW termination routine
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
118 ldx blockimg,u pointer to start of os9boot in memory
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
119 clrb clear carry
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
120 ldd bootsize,u
2120
73a8a7fe0151 fixed issue with stack overwrite in boot_common.asm for level 1.
boisy
parents: 2119
diff changeset
121 error
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
122 IFEQ Level-1
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
123 leas 2+size,s reset the stack same as PULS U
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
124 ELSE
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
125 leas 2+size+256,s reset the stack same as PULS U
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
126 ENDC
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
127 rts return to kernel
2119
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
128
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
129
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
130 * NEW! Fragmented boot support!
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
131 *FragBoot ldb bootloc,u MSB fd sector location
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
132 * ldx bootloc+1,u LSW fd sector location
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
133 FragBoot ldb DD.BT,x MSB fd sector location
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
134 ldx DD.BT+1,x LSW fd sector location
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
135 lbsr HWRead get fd sector
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
136 ldd FD.SIZ+2,x get file size (we skip first two bytes)
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
137 std bootsize,u
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
138 leax FD.SEG,x point to segment table
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
139
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
140 GrabBootMem
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
141 IFGT Level-1
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
142 os9 F$BtMem
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
143 ELSE
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
144 os9 F$SRqMem
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
145 ENDC
2119
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
146 bcs error
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
147 * Save off alloced mem from F$SRqMem into blockloc,u and restore
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
148 * the statics pointer in U
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
149 tfr u,d save pointer to requested memory
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
150 ldu ,s recover pointer to data stack
7759100a08a1 Updated for better use of system RAM
boisy
parents: 2117
diff changeset
151 std blockloc,u
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
152 std blockimg,u
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
153
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
154 * Get os9boot into memory
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
155 BootLoop stx seglist,u update segment list
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
156 IFNE LSN24BIT
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
157 ldb FDSL.A,x MSB sector location
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
158 ENDC
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
159 BL2 ldx FDSL.A+1,x LSW sector location
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
160 IFNE LSN24BIT
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
161 bne BL3
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
162 tstb
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
163 ENDC
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
164 beq Back2Krn
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
165 BL3 lbsr HWRead
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
166 inc blockloc,u point to next input sector in mem
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
167
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
168 IFGT Level-1
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
169 lda #'. show .'
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
170 jsr <D.BtBug
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
171 ENDC
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
172
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
173 ldx seglist,u get pointer to segment list
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
174 dec FDSL.B+1,x get segment size
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
175 beq NextSeg if <=0, get next segment
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
176
1894
6d5bd8549d28 More booter optimizations
boisy
parents: 1893
diff changeset
177 ldd FDSL.A+1,x update sector location by one
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
178 addd #1
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
179 std FDSL.A+1,x
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
180 IFNE LSN24BIT
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
181 ldb FDSL.A,x
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
182 adcb #0
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
183 stb FDSL.A,x
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
184 ENDC
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
185 bra BL2
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
186
1893
1827bb446188 Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
diff changeset
187 NextSeg leax FDSL.S,x advance to next segment entry
3130
e0614e08fa5e l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents: 2120
diff changeset
188 bra BootLoop