3 Written by Olaf `Olsen' Barthel <olsen@sourcery.han.de>
7 Sashimi intercepts raw serial debugging output on your own machine; command
10 Startup: [RECOVER=name]
11 [ON] [BUFK=n (n must be a power of 2)] [BUFFERSIZE=n] [NOPROMPT]
12 [QUIET] [ASKEXIT] [ASKSAVE] [TIMERON] [CONSOLE] [WINDOW=name]
14 Runtime: [OFF] [SAVE] [SAVEAS=name] [EMPTY]
17 Sashimi is a tool to intercept the raw serial output of Enforcer, Mungwall,
18 and all tool and application debugging output that uses kprintf(). This
19 makes it possible to use serial debugging on a single Amiga, without
20 interfering with attached serial hardware such as modems and serial
23 This is a drop-in replacement for the "Sushi" tool, as written by Carolyn
24 Scheppner. Well, not exactly. Sashimi has a few different/new features and
25 does not support the complete feature set of the "Sushi" tool. Sashimi only
26 runs from Shell and requires Kickstart 2.04 or higher. Sashimi cannot patch
27 the older Enforcer at run time which means that you have to use Enforcer
28 V37 or an equivalent like CyberGuard.
33 Here's what's in my "S:User-Startup" file:
35 Run >NIL: MungWall NAMETAG
36 Run >NIL: Enforcer RAWIO
37 Run >NIL: Sashimi CONSOLE BUFK=64 NOPROMPT ASKEXIT ASKSAVE
39 All standard serial debugging functions are intercepted. Currently, the
40 patch to the serial debugging input function just returns a `y'. Standard
41 serial debugging output and Enforcer output go into Sashimi's circular buffer
42 (the size is user-definable, with a default size of 32K), where it is
43 noticed by the Sashimi process and written to the output window. The
44 Sashimi process is signalled whenever a carriage return or linefeed comes
47 Sashimi has several startup options, and several runtime options:
49 Startup: [RECOVER=name]
50 [ON] [BUFK=n (n must be a power of 2)] [BUFFERSIZE=n] [NOPROMPT]
51 [QUIET] [ASKEXIT] [ASKSAVE] [TIMERON] [CONSOLE] [WINDOW=name]
53 Runtime: [OFF] [SAVE] [SAVEAS=name] [EMPTY]
58 RECOVER=name Sashimi will search the Amiga memory for the buffer created
59 and maintained by a previous invocation of Sashimi. This is
60 useful if the system crashed before you had any chance to
61 save the Sashimi buffer to disk. While the search is in
62 progress the system will be frozen. There is no guarantee
63 that Sashimi will find any older buffer or that the contents
64 of the buffer found will still be intact. Once the data is
65 found, it will be saved to the file with the given name.
67 Sashimi will exit immediately after processing the recovery
68 command. No further action will be taken. Depending on whether
69 it was successful in recovering the data, Sashimi's return
70 code will be either 0 (= success) or 5 (= failure).
72 ON Default (not required)
74 BUFK=n Changes the circular buffer size from default 32K to specified
75 power-of-2 K from 4K to whatever you like, i.e. BUFK=8 will
76 allocate a buffer of 8192 bytes.
78 BUFFERSIZE=n Changes the circular buffer size from default 32K to specified
79 buffer size, i.e. BUFFERSIZE=8000 will allocate a buffer
82 NOPROMPT Turns off the "Sashimi installed" prompt. This is useful if
83 the Sashimi output is redirected to an AUTO CON window such
84 as in conjunction with the CONSOLE option.
86 QUIET Causes Sashimi to just buffer all debugging output.
87 This effectively silences serial debugging output.
89 ASKSAVE Cause Sashimi to ask you if you want to save the buffer
90 when you exit Sashimi. If there's nothing in the buffer,
93 ASKEXIT Cause Sashimi to ask you if you *really* want to exit if
94 a [Ctrl]+C signal is received. This is good for people like
95 me who might accidentally [Ctrl]+C in a Sashimi window when
96 they meant to do it somewhere else. This option should
97 only be used if Sashimi has an input stream - i.e. if Sashimi
98 is not run/redirected, or if Sashimi has in/out redirection
101 TIMERON Cause Sashimi to wake up every 1/10 second to check for
102 output. Without this option, Sashimi will just wake up every
103 time a carriage return or linefeed is output.
105 CONSOLE This will make Sashimi open a console output window for itself
106 which all input and output will go into. Unless you provide a
107 console window specifier (see WINDOW option), Sashimi will use:
109 CON:0/20/640/100/Sashimi [Ctrl]+E=Empty [Ctrl]+F=File [Ctrl]+D=Reset console/AUTO/CLOSE/WAIT/INACTIVE
111 WINDOW=name This option works in conjunction with the CONSOLE option and
112 allows you to override the default console window specifier.
117 OFF Signals the active running copy of Sashimi to exit.
119 EMPTY Finds the active running copy of Sashimi and empties its
122 SAVE Finds the active running copy of Sashimi and saves its buffer
125 SAVEAS=name Finds the active running copy of Sashimi and saves its buffer
126 as the specified file name.
129 Example startup usage
130 =====================
132 Sashimi ASKSAVE (in its own shell window)
134 Run >NIL: Sashimi >"CON:0/20/640/120/Sashimi/AUTO/CLOSE/WAIT/INACTIVE" ON NOPROMPT
136 Run Sashimi >ram:hits (all output redirected to a file)
139 Keyboard and Break signals
140 ==========================
141 [Ctrl]+C: To quit Sashimi, [Ctrl]+C it (if it has its own window), send it
142 a [Ctrl]+C signal with the Break command, or run Sashimi a second
143 time with the OFF keyword.
145 [Ctrl]+D: This sends a control sequence to the output console to reset it.
146 Very handy in case garbage data has changed the character set
147 or the text rendering colours.
149 [Ctrl]+E: Tells Sashimi to empty (clear) its buffer.
151 [Ctrl]+F: Tells Sashimi to save its own buffer to the file "T:sashimi.out"
156 Sashimi OFF ; tell active running Sashimi to try to exit
157 Sashimi SAVE ; save buffer of active Sashimi
158 Sashimi SAVEAS ram:myhits EMPTY ; save buffer as ram:myhits and clear buffer
160 Usually, I just hit [Ctrl]+F in the Sashimi window, and it saves its buffer
166 Sorry, no programmer interface. "Sushi" had one, but I did not see much
167 sense in replicating this functionality.
172 I got bitten by bugs in "Sushi", and not just once. Whenever the Sushi
173 circular buffer would wrap around, there was a good chance part of the buffer
174 would still be filled with random data when getting saved to disk. If a large
175 amount of data would be sent through the kprintf() interface, Sushi would
176 occasionally "hickup" and regurgitate stale data from its buffer. I took
177 this as indications that the Sushi buffer management code was none too
178 robust. Another thing that struck me as odd was the fact that sometimes
179 Sushi would stop reporting incoming kprintf() output and effectively behave
180 as if it had been stopped with [Ctrl]+C. Sushi also had a tendency to block
181 screen output when printing its buffer; it would output the buffer in a
182 single Write() operation, causing the console window to lock the display.
183 And while that operation was in progress, you could not suspend window output
186 Sashimi tries to do better in these situations. The algorithms for
187 maintaining the circular buffer (or FIFO) are different. And just in case
188 there is a bug in the code, I have provided the complete tool source code.
193 Sashimi was written by Olaf `Olsen' Barthel, with "Sushi" by Carolyn
194 Scheppner as a reference. Sushi was in turn influenced by the "Reporter"
195 and "Detective" tools written by Steve Tibbett and Christian E. Hopps.
202 Federal Republic of Germany
206 olsen@sourcery.han.de
212 Sashimi 1.6 (20.6.99)
214 - Sashimi could cause the entire system to hang due to an
215 unmatched Disable() in the RawPutChar wedge [David Gerber].
217 - If Sashimi is not already running "Sashimi OFF" will no
222 - Made the FIFO access routines into atomic operations. This
223 reduces the risk of two programs trying to modify the
224 FIFO bookkeeping variables at the same time.
226 - Fixed a bug in the FIFO management code which would cause
227 Sashimi to regurgitate stale data after a buffer overrun.
228 Strangely, this was one of the bugs in Sushi I wanted to
231 - Added the new RECOVER functionality.
233 Sashimi 1.4 (11.9.98)
235 - The Sashimi RawPutChar() patch now saves and restores
236 the contents of A0 and A1. This is necessary since
237 the KPutStr() code relies upon A0 to remain unchanged
238 after each call to RawPutChar() [Stuart Kyzer Caie].
240 Sashimi 1.3 (07.04.98)
242 - Updated the console window title text
244 Sashimi 1.2 (05.04.98)
246 - Added the [Ctrl]+D console reset command.