972
|
1 <!--
|
|
2 The author has not been contacted about adding this article to the
|
|
3 documentation set.
|
|
4 -->
|
|
5 <article>
|
|
6 <articleinfo>
|
|
7 <author><firstname>Doug</firstname><surname>DeMartinis</surname></author>
|
|
8 <title>dEd</title>
|
|
9 <subtitle>Disk Editor</subtitle>
|
|
10 </articleinfo>
|
|
11 <para>
|
|
12 dEd is a screen-oriented disk editor utility written in
|
|
13 assembly language. It was originally conceived as a floppy
|
|
14 disk editor, so the display is organized around individual
|
|
15 sectors. It performs most of the functions of Patch, from
|
|
16 Computerware, but is faster, more compact, and
|
|
17 screen-oriented rather than line-oriented. Individual files
|
|
18 or the disk itself (hard, floppy, ram) can be examined and
|
|
19 changed, sectors can be written to an output file, and
|
|
20 executable modules can be located, linked to and verified.
|
|
21 With simple changes, it will run on any CoCo Level I OS-9
|
|
22 and possibly others (CoCo Level II OS-9).
|
|
23 </para><para>
|
|
24 To use, type:
|
|
25 <screen>
|
|
26 dEd <pathlist>
|
|
27 </screen>
|
|
28 where <pathlist> is of the form: filename or dirname
|
|
29 or /path/filename
|
|
30 or /D0@ (edits entire disk)
|
|
31 </para><para>
|
|
32 dEd will read in and display the first 256 bytes in the file
|
|
33 (disk). This is Logical Sector Number (LSN) zero. You move
|
|
34 through the file sector (LSN) by sector using the up and
|
|
35 down arrow keys. The current LSN number is displayed in Hex
|
|
36 and Decimal in the upper left corner of the screen. If the
|
|
37 disk itself was accessed (by appending '@' to it's name when
|
|
38 dEd was called), the LSN is the disk sector number. If an
|
|
39 individual file is being editted, however, the LSN displayed
|
|
40 refers to the file, not to the disk. All numbers requested
|
|
41 by dEd must be in Hex format. All commands are accessed by
|
|
42 simply pressing the desired key.
|
|
43 </para>
|
|
44 <table frame="none" pgwide="1">
|
|
45 <title>Commands</title>
|
|
46 <tgroup cols="2">
|
|
47 <colspec colwidth="1.9in" colname="c1" />
|
|
48 <colspec colwidth="4.0in" colname="c2" align="right"/>
|
|
49 <spanspec spanname="all" namest="c1" nameend="c2"/>
|
|
50 <tbody>
|
|
51 <row>
|
|
52 <entry>Up/Down Arrows</entry>
|
|
53 <entry>Display Next/Previous Sector (LSN)</entry>
|
|
54
|
|
55 </row><row>
|
|
56 <entry spanname="all">Each keypress moves the display to the next or previous 256
|
|
57 bytes. Auto-repeat allows skimming quickly through the file.
|
|
58 To halt the key-repeat, type Control-W to pause the display,
|
|
59 then hit any key. The LSN displayed represents the
|
|
60 most-significant byte of the offset of the bytes from the
|
|
61 start of the file (module), so byte number $1457 would be
|
|
62 found in LSN $14 on row 50, column 7.</entry>
|
|
63
|
|
64 </row><row>
|
|
65 <entry>A Command</entry>
|
|
66 <entry>APPEND Current LSN to Output File</entry>
|
|
67
|
|
68 </row><row>
|
|
69 <entry spanname="all">This command writes the sector currently displayed to the
|
|
70 file opened with the O command. Append is inactive unless an
|
|
71 Output file has been created. This mode is useful for
|
|
72 recovering files with unreadable sectors in them, as all the
|
|
73 sectors before and after the crashed sector may be accessed
|
|
74 and saved to a new file. Append also increments the display
|
|
75 to the next LSN automatically to speed this process. At the
|
|
76 end of a file, generally fewer than 256 bytes will be
|
|
77 displayed, as the length of most files is not an even
|
|
78 multiple of 256. The Append command will only write out the
|
|
79 bytes that are displayed, and the display will remain on the
|
|
80 same LSN. Pressing 'A' twice on the last LSN of a file
|
|
81 results in it being written to the output file twice. </entry>
|
|
82
|
|
83 </row><row>
|
|
84 <entry>C Command</entry>
|
|
85 <entry>CLOSE Output File</entry>
|
|
86
|
|
87 </row><row>
|
|
88 <entry spanname="all">This command closes the file opened with the O command and
|
|
89 removes the file name from the display, making Append
|
|
90 inactive.</entry>
|
|
91
|
|
92 </row><row>
|
|
93 <entry>D Command</entry>
|
|
94 <entry>Diddle with the File Length</entry>
|
|
95
|
|
96 </row><row>
|
|
97 <entry spanname="all">This command displays the current file length, in Hex, then
|
|
98 allows you to change it. This is potentially very dangerous
|
|
99 (e.g. if you use it on loadable modules). If you just press
|
|
100 <ENTER> at the prompt, you will be returned to the command
|
|
101 mode (this is useful for just checking the file length). If
|
|
102 you enter a valid length (number of BYTES, not sectors,
|
|
103 in Hex), the file will be expanded or contracted to that
|
|
104 length. This is useful for stripping the Control-Z's ($1A)
|
|
105 off the end of files downloaded with the XModem protocol.
|
|
106 Remember, the LENGTH of a file is 1 greater than the number
|
|
107 of the last byte in the file (remember, counting from 0!)</entry>
|
|
108
|
|
109 </row><row>
|
|
110 <entry>E Command</entry>
|
|
111 <entry>EDIT the displayed Sector</entry>
|
|
112
|
|
113 </row><row>
|
|
114 <entry spanname="all">This is the heart of dEd. The cursor will appear over the
|
|
115 first byte or character in the LSN. If it's over the BYTE,
|
|
116 you can change the value by typing 2 new nibbles in Hex,
|
|
117 e.g. 6c. The display will be updated and the cursor will
|
|
118 move to the next BYTE. If the cursor is over the CHARACTER
|
|
119 part of the display, you can change the value by typing a
|
|
120 new ASCII character. Again, the display will be updated and
|
|
121 the cursor will shift to the next character. You switch
|
|
122 between the BYTE and CHAR modes at any time by hitting the
|
|
123 <BREAK> key, as noted at the bottom of the display. You
|
|
124 navigate through the sector to individual BYTEs or CHARs
|
|
125 using the 4 Arrow keys. The Right and Left Arrows wrap the
|
|
126 cursor around to the next or previous row on the display.
|
|
127 The Up and Down Arrows wrap around from top to bottom and
|
|
128 vice-versa. Once you are done Editting, pressing <ENTER>
|
|
129 will exit the Edit mode, as noted at the bottom of the
|
|
130 display. As with Zap, the sector is NOT written back to the
|
|
131 disk unless the Write command is then used (unless in Expert
|
|
132 mode). </entry>
|
|
133
|
|
134 </row><row>
|
|
135 <entry>F Command</entry>
|
|
136 <entry>FIND</entry>
|
|
137
|
|
138 </row><row>
|
|
139 <entry spanname="all"><para>This searches the file for a
|
|
140 given character or byte string
|
|
141 You will be prompted with 'Find byte string $'. Enter a
|
|
142 series of up to 16 Hex bytes, without spaces (you MUST
|
|
143 enter leading zeroes for the numbers 00 - $0F) then press
|
|
144 <ENTER>. The search begins at the start of the LSN
|
|
145 currently displayed. If a string is located that EXACTLY
|
|
146 matches the string you input, the LSN in which it is
|
|
147 located will be displayed, with the first byte/character in
|
|
148 the string highlighted. By pressing the <BREAK> key at the
|
|
149 prompt, you can toggle between the BYTE and CHARACTER
|
|
150 search modes. In the character mode, the prompt is 'Find
|
|
151 char string: '. Enter up to 16 ASCII characters, then press
|
|
152 <ENTER>. In this mode, dEd will locate any string that
|
|
153 matches the one you input, regardless of the Upper/Lower
|
|
154 case status of either string. As well, characters with bit
|
|
155 7 set (e.g. file names in directories) are treated as if
|
|
156 bit 7 was clear. If no matching string is found, you are
|
|
157 returned to the command prompt. If you enter an invalid
|
|
158 character or byte string, a beep sounds and the same prompt
|
|
159 is re-issued. If you just press <ENTER> at either prompt,
|
|
160 you will be returned to the command mode.
|
|
161 </para><para>
|
|
162 If you wish to abort a search in progress, just press the
|
|
163 <BREAK> key. This will simulate a "string not found" and
|
|
164 return you to the CMD: prompt.</para></entry>
|
|
165 </row><row>
|
|
166 <entry>H (or '?') Command</entry>
|
|
167 <entry>HELP</entry>
|
|
168
|
|
169 </row><row>
|
|
170 <entry spanname="all">This displays a Help screen. </entry>
|
|
171
|
|
172 </row><row>
|
|
173 <entry>L Command</entry>
|
|
174 <entry>LINK to a Module/LIST Modules</entry>
|
|
175
|
|
176 </row><row>
|
|
177 <entry spanname="all">If you are editting a file that consists of various
|
|
178 executable modules merged together (e.g. OS9Boot), this
|
|
179 command allows you to 'Link' to one of the modules. It will
|
|
180 be treated as if it is an individual file, i.e. the start of
|
|
181 the module will be displayed as LSN 0 and only THAT MODULE
|
|
182 will be accessible for display and/or Editting. The LSN
|
|
183 displayed is referenced to the MODULE, not to the main file
|
|
184 or the disk. You will be prompted with 'Link to which
|
|
185 Module? '. You may enter a valid name and press <ENTER>. If
|
|
186 that module can be located AND if it's header information is
|
|
187 correct, it will be 'Linked'. The top row of the display
|
|
188 reflects this by displaying the module name and it's offset,
|
|
189 in bytes, from the beginning of the main file. At the 'Link
|
|
190 to which Module? ' prompt, if you just hit <ENTER>, all the
|
|
191 valid modules and their offsets from the beginning of the
|
|
192 main file as well as their lengths, in bytes Hex, will be
|
|
193 Listed. Hitting any key after this redisplays the current
|
|
194 LSN. The Link mode is useful for changing a given byte in a
|
|
195 module using the offset one would use for Debug. For
|
|
196 example, to permanently change the printer baud rate, you
|
|
197 would call 'dEd /D0/OS9Boot'. Then hit 'L' for Link. At the
|
|
198 prompt 'Link to which Module? ', Type P and hit <ENTER>. If
|
|
199 P is in your OS9Boot file, the top row of the display will
|
|
200 have MODULE: P and give the offset of it from the beginning
|
|
201 of the OS9Boot file. Enter the Edit mode by hitting 'E'
|
|
202 then use the arrows to move the cursor to byte number 27
|
|
203 (row 20, column 7). Type in the new value for the baud rate
|
|
204 then hit <ENTER> to exit Edit mode. Hit 'W' to write the
|
|
205 sector, then 'V' to verify the modules. If a module is
|
|
206 linked, the 'Find' command only searches for strings in
|
|
207 that module.</entry>
|
|
208
|
|
209 </row><row>
|
|
210 <entry>N Command</entry>
|
|
211 <entry>Find Next occurrence of String</entry>
|
|
212
|
|
213 </row><row>
|
|
214 <entry spanname="all">This is used in conjunction with the 'Find' command. Once a
|
|
215 Hex byte or ASCII character string has been located with
|
|
216 'F', the next occurrence may be located by pressing 'N'.
|
|
217 This search starts where the 'Find' search left off, IF the
|
|
218 LSN hasn't changed since the string was initially located.
|
|
219 If the LSN has changed, the search starts at the beginning
|
|
220 of the current LSN. If the search is successful, the string
|
|
221 will be highlighted, as with 'Find', otherwise you are
|
|
222 returned to the command prompt, with a beep.</entry>
|
|
223
|
|
224 </row><row>
|
|
225 <entry>O Command</entry>
|
|
226 <entry>OPEN an Output File</entry>
|
|
227
|
|
228 </row><row>
|
|
229 <entry spanname="all"><para>You will be prompted with 'OUTFILE: '. Type in a file name
|
|
230 or path (that does not already exist) and press <ENTER>. A
|
|
231 new file will be created and opened, with the name
|
|
232 displayed on the second row of the screen. Individual
|
|
233 sectors can be written to this file using the Append
|
|
234 command.
|
|
235 </para><para>
|
|
236 To abort the O Command, just press <ENTER> or <BREAK>.</para></entry>
|
|
237
|
|
238
|
|
239 </row><row>
|
|
240 <entry>P Command</entry>
|
|
241 <entry>Push an LSN onto the Sector Stack</entry>
|
|
242
|
|
243 </row><row>
|
|
244 <entry spanname="all">This pushes the current LSN onto a funtional Stack of
|
|
245 sectors. The 'R' command then can remove (pull) them from
|
|
246 the Stack in the reverse order (Last In, First Out) that
|
|
247 they were pushed. Up to 16 LSN's can be saved on the Stack.
|
|
248 This is very useful when trying to reconstruct a deleted
|
|
249 file that was fragmented on the disk. By pushing each
|
|
250 sector examined onto the Stack, you can retrace your steps
|
|
251 backwards without having to remember the sector number of
|
|
252 each sector along the way.</entry>
|
|
253
|
|
254 </row><row>
|
|
255 <entry>Q Command</entry>
|
|
256 <entry>QUIT dEd</entry>
|
|
257
|
|
258 </row><row>
|
|
259 <entry spanname="all">This exits dEd immediately. You should be sure to Write any
|
|
260 Editted or Zapped sectors back to the disk before Quitting.</entry>
|
|
261
|
|
262 </row><row>
|
|
263 <entry>R Command</entry>
|
|
264 <entry>Remove an LSN from Sector Stack and Display</entry>
|
|
265
|
|
266 </row><row>
|
|
267 <entry spanname="all">This removes (pulls), from the Sector Stack, the last LSN
|
|
268 that was pushed (with the 'P' command) and displays it.</entry>
|
|
269
|
|
270 </row><row>
|
|
271 <entry>S Command</entry>
|
|
272 <entry>SKIP to a given LSN</entry>
|
|
273
|
|
274 </row><row>
|
|
275 <entry spanname="all">You will be prompted with 'LSN=$ '. Type a sector number (in
|
|
276 Hex) and press <ENTER>. That LSN will then be displayed, if
|
|
277 possible. If the LSN entered is greater than the last LSN in
|
|
278 the file, nothing will happen.</entry>
|
|
279
|
|
280 </row><row>
|
|
281 <entry>U Command</entry>
|
|
282 <entry>Unlink a Module</entry>
|
|
283
|
|
284 </row><row>
|
|
285 <entry spanname="all">This 'unlinks' a module that has previously been 'linked'
|
|
286 using the 'L' command. The first sector in the file (LSN 0)
|
|
287 is displayed. Using this command when no module has been
|
|
288 linked has no effect.</entry>
|
|
289
|
|
290 </row><row>
|
|
291 <entry>V Command</entry>
|
|
292 <entry>VERIFY All Modules</entry>
|
|
293
|
|
294 </row><row>
|
|
295 <entry spanname="all">This command calculates and writes a new CRC value for EACH
|
|
296 module in a fale. It must be used after Editting executable
|
|
297 modules or they will not be loadable. Verify is terminated
|
|
298 if an error is located in the header of a module, but each
|
|
299 module is verified individually and the CRC is rewritten to
|
|
300 each before moving to the next module in a file, so modules
|
|
301 in front of one with an error will be verified.</entry>
|
|
302
|
|
303 </row><row>
|
|
304 <entry>W Command</entry>
|
|
305 <entry>WRITE the Sector displayed to the Disk</entry>
|
|
306
|
|
307 </row><row>
|
|
308 <entry spanname="all">WARNING!!! This command can be very dangerous to the well-
|
|
309 being of your disk data. It writes the sector displayed
|
|
310 back to the disk (at the same location from whence it came,
|
|
311 but not necessarily with the same information, hence the
|
|
312 danger). After Zapping or Editting a sector, you must use
|
|
313 this command to make the changes on the disk (unless you're
|
|
314 in the Expert mode). Because you can effectively maim your
|
|
315 data with this command, you will be prompted with 'Are you
|
|
316 sure (Y/N)? '. If you hit any key other than 'Y' (or 'y')
|
|
317 the Write command will be aborted. Otherwise the sector will
|
|
318 be written, with the display advising you that dEd is
|
|
319 'Writing Sector...'. On a hard disk or RAM disk, this is
|
|
320 very quick.</entry>
|
|
321
|
|
322 </row><row>
|
|
323 <entry>X Command</entry>
|
|
324 <entry>EXPERT Mode</entry>
|
|
325
|
|
326 </row><row>
|
|
327 <entry spanname="all">This command is potentially the most dangerous of all. It
|
|
328 should be used only by those who are very brave (fools?) or
|
|
329 those who never make mistakes. In this mode, any sectors
|
|
330 changed by Edit or Zap will be automatically written to the
|
|
331 disk. The Write command is not needed, and is inactivated in
|
|
332 the Expert mode. Any errors made during Edit or Zap WILL be
|
|
333 transferred to the disk, making this mode very good for
|
|
334 crashing directories, etc. Having noted this, there is one
|
|
335 route of escape from errors made in this mode. After
|
|
336 Editting or Zapping a sector, the sector is not actually
|
|
337 written back to the disk until after Edit or Zap is exitted
|
|
338 and the next command is issued (i.e. the next Command Key is
|
|
339 pressed). If you hit Shift-BREAK , before hitting any other
|
|
340 Command Key, the automatic Write will not occur. You must
|
|
341 type Shift-BREAK before any other command or the sector will
|
|
342 be written to the disk. This is a one-time escape, so any
|
|
343 further errors made will require hitting the Shift-BREAK key
|
|
344 again at the appropriate time to avoid writing the bad
|
|
345 sector to the disk. Unless you fully understand the OS-9
|
|
346 disk structure (or enjoy toying with the life of your data),
|
|
347 this mode should probably be avoided. It is entered after
|
|
348 responding with a 'Y' or 'y' to the 'Are you sure (Y/N)?'
|
|
349 prompt, and the display advises you that you are in this
|
|
350 mode. The 'X' command is a toggle switch, so to exit Expert
|
|
351 mode, just hit 'X' again and the 'Expert Mode' message will
|
|
352 be erased.</entry>
|
|
353
|
|
354 </row><row>
|
|
355 <entry>Z Command</entry>
|
|
356 <entry>ZAP the displayed Sector</entry>
|
|
357
|
|
358 </row><row>
|
|
359 <entry spanname="all">You will be prompted with 'Zap Byte: ' or 'Zap Char: '.
|
|
360 Enter either a Hex byte (e.g. 6c) or an ASCII character
|
|
361 (e.g. $) and press <ENTER>. That byte or character will be
|
|
362 written to the ENTIRE SECTOR. You can toggle between the
|
|
363 BYTE/CHAR modes by hitting the <BREAK> key. In the CHAR
|
|
364 mode, hitting ALT-Char then <ENTER> will Zap the sector with
|
|
365 that char with bit 7 set. Unless you're in the Expert mode,
|
|
366 only the buffer will be Zapped with the Zap command. To put
|
|
367 this Zapped sector on the disk, you must use the Write
|
|
368 command. If you decide not to Zap the sector, just hit
|
|
369 <ENTER> without first entering a byte or character. You can
|
|
370 redisplay a sector that has been Zapped, but not Written
|
|
371 back to the disk, by going to the next LSN using the Up
|
|
372 Arrow, then returning to the original LSN with the Down
|
|
373 Arrow (again, provided you're not in the Expert mode). </entry>
|
|
374
|
|
375 </row><row>
|
|
376 <entry>$ Command</entry>
|
|
377 <entry>Fork a SHELL</entry>
|
|
378
|
|
379 </row><row>
|
|
380 <entry spanname="all">A new Shell is forked to allow access to OS-9 without
|
|
381 terminating dEd. To return to dEd, press Ctrl-BREAK (ESC).</entry>
|
|
382
|
|
383 </row><row>
|
|
384 <entry><CR> Command</entry>
|
|
385 <entry>Clean up screen display</entry>
|
|
386
|
|
387 </row><row>
|
|
388 <entry spanname="all">Pressing <ENTER> at the CMD: prompt will clear and re-write
|
|
389 the screen which may have been trashed by an error. Current
|
|
390 editing to the displayed sector is not lost or written. This
|
|
391 command only resets the screen display.</entry>
|
|
392 </row>
|
|
393 </tbody>
|
|
394 </tgroup>
|
|
395 </table>
|
|
396
|
|
397 </article>
|