Ramdinit.sys

Zdrojový kód

3      5b00            *s
4      5b00            ;==============================================================;
5      5b00            ;== Verzia 07 == Ramdinit.sys ===== (c) 28.07.1996 Busy soft ==;
6      5b00            ;==============================================================;
7      5b00            *z!
8      5b00                   org  #8000               "Rini"
9      8000            p
10     8000 185e       boot   jr   run                 Format (log.cisla):
11     8002 8002              dw   #0280               0=boot , 1=zaloha
12     8004 2000       numtrk dw   #20                 2=1.fat, 3=2.fat, 4=dirs
13     8006 0f00       numsec dw   #0f
14     8008 0200       numsur dw   #02
15     800a 0100       numclu dw   #01
16     800c 0400       numdir dw   #04
17     800e 0100       secfat dw   #01
18     8010 0004       lenfat dw   #0400
19     8012 0200       fat1   dw   #02
20     8014 0300       fat2   dw   #03
21     8016 ffff       hhxor  dw   -1
22     8018 0100              dw   #01
23     801a ffffffff   fatnxt dw   -1,-1,-1
            ffff        
24     8020             
25     8020 00000000   meno   dw   0,0,0
            0000        
26     8026 3e72616d          db   '>ramdrive<'
            64726976    
            653c        
27     8030 4d616465          db   'Made by '
            20627920    
28     8038 52414d44          db   'RAMDINIT'
            494e4954    
29     8040             
30     8040 00000000   ident  dw   0,0,0,0,0,0,0,0
            00000000    
            00000000    
            00000000    
31     8050 00000000   pass   dw   0,0,0,0,0,0,0,0
            00000000    
            00000000    
            00000000    
32     8060             
33     8060 cd9e3c     run    call ram
34     8063 af                xor  a                   Znacka ktory disk
35     8064 32815c            ld   (23681),a           bol inicializovany
36     8067 2a785c            ld   hl,(23672)
37     806a 224080            ld   (ident+0),hl
38     806d 224280            ld   (ident+2),hl
39     8070 06ff              ld   b,#ff
40     8072 c5         alldrv push bc
41     8073 58                ld   e,b
42     8074 3e0e              ld   a,info
43     8076 df                rst  #18
44     8077 210110            ld   hl,#1001
45     807a af                xor  a
46     807b ed52              sbc  hl,de
47     807d 2008              jr   nz,nxtdrv
48     807f c1                pop  bc
49     8080 c5                push bc
50     8081 cd9080            call test
51     8084 cda681            call pokrnd
52     8087 c1         nxtdrv pop  bc
53     8088 10e8              djnz alldrv
54     808a 3e0d              ld   a,pasive
55     808c df                rst  #18
56     808d c3983c            jp   rom
57     8090             
58     8090 78         test   ld   a,b
59     8091 5f                ld   e,a
60     8092 322180            ld   (meno+1),a
61     8095 3e0c              ld   a,aktive
62     8097 df                rst  #18
63     8098 fe02              cp   #02
64     809a d8                ret  c
65     809b 210092            ld   hl,buff
66     809e 110100            ld   de,#01
67     80a1 3e04              ld   a,rdsec
68     80a3 df                rst  #18
69     80a4 4f                ld   c,a
70     80a5 e6f7              and  #f7
71     80a7 c0                ret  nz                  divna chyba, asi to neni ramdisk
72     80a8 cb59              bit  3,c
73     80aa 2013              jr   nz,init
74     80ac 3a0092            ld   a,(buff+#00)
75     80af fe18              cp   #18
76     80b1 200c              jr   nz,init
77     80b3 3a0392            ld   a,(buff+#03)
78     80b6 fe02              cp   #02
79     80b8 2005              jr   nz,init
80     80ba 3a0a92            ld   a,(buff+#0a)
81     80bd 3d                dec  a
82     80be c8                ret  z
83     80bf            init
84     80bf 210082            ld   hl,fat              Inicializacia fatky
85     80c2 110182            ld   de,fat+1
86     80c5 01ff0f            ld   bc,#0fff
87     80c8 71                ld   (hl),c
88     80c9 edb0              ldir
89     80cb                                            Miniformatovac
90     80cb dd210082          ld   ix,fat              ix=adresa vo fat
91     80cf 110100            ld   de,#01              de=fyzicke cislo sektora
92     80d2 d5         ini1   push de
93     80d3 dde5              push ix
94     80d5 210092            ld   hl,buff
95     80d8 3e04              ld   a,rdsec
96     80da df                rst  #18
97     80db 4f                ld   c,a
98     80dc dde1              pop  ix
99     80de d1                pop  de
100    80df 21fbff            ld   hl,#fffb            #fffb = daka divna chyba
101    80e2 e6e7              and  #e7
102    80e4 2009              jr   nz,fatpok
103    80e6 2efd              ld   l,#fd               #fffd = recurd not found
104    80e8 cb61              bit  4,c
105    80ea 2003              jr   nz,fatpok
106    80ec 210000            ld   hl,#00              #0000 = pouzitelny sektor
107    80ef dd7500     fatpok ld   (ix+#00),l
108    80f2 dd7401            ld   (ix+#01),h
109    80f5 dd23              inc  ix
110    80f7 dd23              inc  ix
111    80f9 1c         nxtfyz inc  e
112    80fa 7b                ld   a,e
113    80fb e67f              and  #7f
114    80fd fe10              cp   16
115    80ff 3809              jr   c,nxtok
116    8101 cb7b              bit  7,e
117    8103 1e81              ld   e,#81
118    8105 2803              jr   z,nxtok
119    8107 1e01              ld   e,#01
120    8109 14                inc  d
121    810a 7a         nxtok  ld   a,d
122    810b fe10              cp   #10
123    810d 38c3              jr   c,ini1
124    810f             
125    810f 7f                ld   a,a
126    8110             
127    8110 210082     tstfat ld   hl,fat
128    8113 060a              ld   b,10
129    8115 af                xor  a
130    8116 b6         tstf1  or   (hl)
131    8117 2c                inc  l
132    8118 10fc              djnz tstf1
133    811a b7                or   a                   Chyba!!!
134    811b c0                ret  nz                  Prvych 5 sektorov musi byt OK!!!
135    811c             
136    811c 210084            ld   hl,#8400
137    811f 220882            ld   (fat+8),hl          dirs
138    8122 220682            ld   (fat+6),hl          fat2
139    8125 220482            ld   (fat+4),hl          fat1
140    8128 26ff              ld   h,#ff
141    812a 220282            ld   (fat+2),hl          zaloha
142    812d             
143    812d 210282            ld   hl,fat+2            Vypocita parifu fatky
144    8130 01fe0f            ld   bc,#0ffe
145    8133 af                xor  a
146    8134 e5                push hl
147    8135 86         addfat add  a,(hl)
148    8136 eda1              cpi
149    8138 ea3581            jp   pe,addfat
150    813b e1                pop  hl
151    813c 2b                dec  hl
152    813d 77                ld   (hl),a              parita
153    813e 2b                dec  hl
154    813f 75                ld   (hl),l              poradove cislo sejvnutia
155    8140             
156    8140 210082     save   ld   hl,fat              FAT 1
157    8143 110300            ld   de,#03              log 2
158    8146 3e05              ld   a,wrsec
159    8148 df                rst  #18
160    8149 210082            ld   hl,fat              FAT 2
161    814c 110400            ld   de,#04              log 3
162    814f 3e05              ld   a,wrsec
163    8151 df                rst  #18
164    8152             
165    8152 210092            ld   hl,buff             DIRS
166    8155 110192            ld   de,buff+1
167    8158 01ff03            ld   bc,#03ff
168    815b 75                ld   (hl),l
169    815c edb0              ldir
170    815e 210092            ld   hl,buff
171    8161 110500            ld   de,#05              log 4
172    8164 3e05              ld   a,wrsec
173    8166 df                rst  #18
174    8167             
175    8167 dd215080   xorpas ld   ix,pass
176    816b 0610              ld   b,#10
177    816d 3e20       xxpp   ld   a,' '
178    816f ee55              xor  #55
179    8171 ddaef0            xor  (ix-#10)
180    8174 dd7700            ld   (ix+#00),a
181    8177 dd2c              inc  xl
182    8179 10f2              djnz xxpp
183    817b 214080            ld   hl,ident
184    817e 0620              ld   b,#20
185    8180 af                xor  a
186    8181 ae         ppxx   xor  (hl)
187    8182 2c                inc  l
188    8183 10fc              djnz ppxx
189    8185 321680            ld   (hhxor),a
190    8188             
191    8188 210180            ld   hl,boot+1           BOOT
192    818b 36fe              ld   (hl),#fe
193    818d 2b                dec  hl
194    818e 110092            ld   de,buff
195    8191 016000            ld   bc,run-boot
196    8194 edb0              ldir
197    8196 210092            ld   hl,buff
198    8199 110100            ld   de,#01              log 0
199    819c 3e05              ld   a,wrsec
200    819e df                rst  #18
201    819f             
202    819f 3a2180            ld   a,(meno+1)          Cislo inicializovaneho drajvu
203    81a2 32815c            ld   (23681),a           kvoli nakopirovaniu utilitiek
204    81a5 c9                ret
205    81a6             
206    81a6 e5         pokrnd push hl
207    81a7 f5                push af
208    81a8 214080     pokadd ld   hl,ident
209    81ab ed5f              ld   a,r
210    81ad f680              or   #80
211    81af ae                xor  (hl)
212    81b0 0f                rrca
213    81b1 77                ld   (hl),a
214    81b2 7d                ld   a,l
215    81b3 3c                inc  a
216    81b4 e60f              and  #0f
217    81b6 f640              or   k
226    81be            h2     =    h1+1
227    81be                   org  h2*#0100
228    8200            fat    ds   #1000
229    9200            buff   ds   #0400
230    9600            e
231    9600                                            ------------
232    9600             
233    9600            rom    =    #3c98
234    9600            ram    =    #3c9e
235    9600             
236    9600            getver =    #00
237    9600            status =    #01
238    9600            restor =    #02
239    9600            seek   =    #03
240    9600            rdsec  =    #04
241    9600            wrsec  =    #05
242    9600            rdtrk  =    #06
243    9600            wrtrk  =    #07
244    9600            rdadd  =    #08
245    9600            rezim  =    #09
246    9600            settrk =    #0a
247    9600            gettrk =    #0b
248    9600            aktive =    #0c
249    9600            pasive =    #0d
250    9600            info   =    #0e
251    9600            setmax =    #0f
252    9600            setmlt =    #10
253    9600            setoff =    #11
254    9600             
255    9600            getver =    #00
256    9600            disp   =    #01
257    9600            enter  =    #02
258    9600            tab    =    #03
259    9600            txxt   =    #04
260    9600            dec8x  =    #05
261    9600            dec16x =    #06
262    9600            dec32x =    #07
263    9600            dec32  =    #08
264    9600            inc32  =    #09
265    9600            add32  =    #0a
266    9600            sub32  =    #0b
267    9600            sddx   =    #0c
268    9600            beep   =    #0d
269    9600            prevox =    #0e
270    9600            howsec =    #0f
271    9600             
272    9600            kukni  =    #10
273    9600            kuini  =    #11
274    9600            getcst =    #12
275    9600            setdrv =    #13
276    9600            setdir =    #14
277    9600            setlcx =    #15
278    9600            getsub =    #16
279    9600             
280    9600            kolkox =    #18
281    9600            seasx  =    #19
282    9600            seadx  =    #1a
283    9600            owsub  =    #1b
284    9600             
285    9600            killx  =    #1e
286    9600            freex  =    #1f
287    9600             
288    9600            loa1x  =    #22
289    9600            loa2x  =    #23
290    9600            verix  =    #24
291    9600            savex  =    #25
292    9600            creatx =    #26
293    9600            utrasx =    #27
294    9600            erasex =    #28
295    9600            erasix =    #29
296    9600            movexx =    #2a
297    9600            moveix =    #2b
298    9600            catx   =    #2c
299    9600            seaxxx =    #2d
300    9600            catxd  =    #2e
301    9600            seaxxd =    #2f
302    9600             
303    9600            formx  =    #33
304    9600            messx  =    #34
305    9600            sdmsx  =    #35
306    9600             
307    9600            xxx    =    #03e0
308    9600            color  =    #03e2
309    9600            optio  =    #03e3
310    9600            actual =    #03e4
311    9600            disk   =    #03ee

 actual 03e4  *  add32  000a  *  addfat 8135  *  aktive 000c  *
 alldrv 8072  *  beep   000d  *  boot   8000  *  buff   9200  *
 catx   002c  *  catxd  002e  *  color  03e2  *  creatx 0026  *
 dec16x 0006  *  dec32  0008  *  dec32x 0007  *  dec8x  0005  *
 disk   03ee  *  disp   0001  *  e      9600  *  enter  0002  *
 erasex 0028  *  erasix 0029  *  fat    8200  *  fat1   8012  *
 fat2   8014  *  fatnxt 801a  *  fatpok 80ef  *  formx  0033  *
 freex  001f  *  getcst 0012  *  getsub 0016  *  gettrk 000b  *
 getver 0000  *  h1     0081  *  h2     0082  *  hhxor  8016  *
 howsec 000f  *  ident  8040  *  inc32  0009  *  info   000e  *
 ini1   80d2  *  init   80bf  *  k      81be  *  killx  001e  *
 kolkox 0018  *  kuini  0011  *  kukni  0010  *  l      01be  *
 lenfat 8010  *  loa1x  0022  *  loa2x  0023  *  meno   8020  *
 messx  0034  *  moveix 002b  *  movexx 002a  *  numclu 800a  *
 numdir 800c  *  numsec 8006  *  numsur 8008  *  numtrk 8004  *
 nxtdrv 8087  *  nxtfyz 80f9  *  nxtok  810a  *  optio  03e3  *
 owsub  001b  *  p      8000  *  pasive 000d  *  pass   8050  *
 pokadd 81a8  *  pokrnd 81a6  *  ppxx   8181  *  prevox 000e  *
 ram    3c9e  *  rdadd  0008  *  rdsec  0004  *  rdtrk  0006  *
 restor 0002  *  rezim  0009  *  rom    3c98  *  run    8060  *
 save   8140  *  savex  0025  *  sddx   000c  *  sdmsx  0035  *
 seadx  001a  *  seasx  0019  *  seaxxd 002f  *  seaxxx 002d  *
 secfat 800e  *  seek   0003  *  setdir 0014  *  setdrv 0013  *
 setlcx 0015  *  setmax 000f  *  setmlt 0010  *  setoff 0011  *
 settrk 000a  *  status 0001  *  sub32  000b  *  tab    0003  *
 test   8090  *  tstf1  8116  *  tstfat 8110  *  txxt   0004  *
 utrasx 0027  *  verix  0024  *  wrsec  0005  *  wrtrk  0007  *
 xorpas 8167  *  xxpp   816d  *  xxx    03e0  *                

Bytes:446  labels:111  errors:0   





Popis
Inicializuje ramdisk, jestliže jsou data poškozena, tak ho rovnou naformátuje.

Poznámky
Nic...

Poslal
Busy