********************************************************************** * * * GEM Spooler v2.0 - 24 November 1991 * * * * (c) Steven Van Rossen, Marc Billiet * * * ********************************************************************** Table of contents ----------------- 0. Disclaimer 1. Shareware 2. About spoolers 2.1 Wat is a spooler ? 2.2 Spooler types 2.3 Spooling with the Atari ST 3. GEM Spooler 3.1 Installing GEM Spooler 3.2 Functions of GEM Spooler 3.3 Manual 3.3.1 Dialogs 3.3.1.1 GEM Spooler dialog 3.3.1.2 Jobs dialog 3.3.1.3 Timing dialog 3.3.1.4 Printer dialog 3.3.1.5 Setup dialog 3.3.2 Adding a job 3.3.3 Activating GEM Spooler from the keyboard 3.3.4 BURST mode 3.3.5 Resetting a job 3.4 Known problems with GEM Spooler 3.5 GEM Spooler with Gemini 3.6 GEM Spooler with Chameleon 4. Technical notes 5. Credits... 6. Adresses 0. Disclaimer ------------- Although GEM Spooler has been thoroughly tested and works very fine, the authors take no responsibility for any damage that might occur (implicit or explicit) when using GEM Spooler v2.0 or one of the related programs. 1. Shareware ------------ GEM Spooler v2.0 is shareware. It may be copied and distributed freely among users, but if you use it regularly you have to pay a registra- tion fee. By doing this you support the authors and in exchange you are sent the latest update. Registering has several advantages: - We let you know if a new update is available - You can ask us to help you with eventual problems - You get some extra software to ease the use of GEM Spooler: GSPINST.PRG Printer installation program for GEM Spooler CFGGRAB.PRG Wordplus CFG to GEM Spooler CTB file convertor LOGVIEW.PRG Utility to view log files - You get technical documentation and examples on how to use GEM Spooler from within your own programs How do you register ? You have two possibilities: 1) You send 500 BEF (or: 30 Fl., 25 DM, 15 US$) (in notes !): Steven Van Rossen or: Marc Billiet Sportstraat 20 A Terlinckstraat 33 B-9250 Waasmunster B-2600 Berchem 2) You pay into one of the following bank accounts: 413-9186221-87 (Steven Van Rossen), Kredietbank St-Niklaas or: 412-9170341-39 (Marc Billiet), Kredietbank Berchem mentioning: Registration fee GEM Spooler v2.0. IMPORTANT: The distribution of GEM Spooler through public domain lists is forbidden, unless one has the explicit permission of the authors. This normally im- plies the public domain service has to proove that their charges don't include abnormal profits (after deduction of their costs). Abnormal profits are profits that can't be justified by the original aim of a public domain service: distributing cheap software to as many people as possible. Distribution by electronic mail and networks however, is permitted. 2. About spoolers ----------------- 2.1 What is a spooler ? ----------------------- Everybody who prints a lot knows the problem: it takes very long before the computer is available again, because the computer has to wait for the slow printer. Fortunately there are spoolers... Spoolers collect very fast all output to the printer and return control to the computer. While the user can go on with his other work, the spooler will send the output little by little to the printer. 2.2 Spooler types ----------------- To collect the printer output, spoolers will need a (fast) buffer in RAM or on disk. According to the type of this buffer, there are two types of spoolers: ram spoolers and disk spoolers. Disk spoolers are mainly used on large systems (mainframes, minis). Ram spoolers are mostly found on microcomputers. A ram spooler reserves a part of the internal memory as buffer. The size of this buffer can be chosen. The advantage of a ram spooler is speed (RAM is fast memory), but there are also some disadvantages: - The buffer consumes (expensive) RAM - There is a limit to the printer output. e.g.: if you print some graphics, this can easily create up to 1 Mb of output. But if your spooler's buffer is 512 Kb, the computer will have to wait to receive the last 512 Kb until the printer has processed the first 512 Kb. - You can't delete something you printed without clearing the whole buffer (which could contain other print jobs !) - If there is a system crash, the whole buffer is lost (in RAM !) Disk spoolers don't have these problems. They make it possible to follow up each print job individually: every job is added to a queue where it can be changed or deleted at any time. After a reset, disk spoolers resume their work as if nothing ever happened (all information is still on disk !) The only disadvantage of disk spoolers is that they require fast disk capacity, usually a hard disk. 2.3 Spooling with the Atari ST ------------------------------ The Atari ST has always been a computer with lots of RAM (compared to the competition). Programmers responded to this with a large offer of ram spooler utilities (accessory or program), in many cases combined with a ram disk. Without doubt, this is a very good solution for ST users without harddisk. The latest evolution in computing however, changes this situation thoroughly. Desktop publishing programs, powerful wordprocessors, graphic programs etc. use more and more RAM. As RAM is quite expensive, these programs tend to use the hard disk instead: parts of RAM memory are save to disk and loaded whenever needed. This technique is refered to as 'virtual memory'. As a result of this evolution, lots of ST users now have a harddisk. This makes disk spooling (as found on large systems) also interesting for those users. GEM Spooler makes it possible ! 3. GEM Spooler -------------- GEM Spooler is - as far as we know - the first disk spooler for the Atari ST. While other operating systems have always used disk spooling (minis, OS/2, Macintosh, Windows 3) the ST missed this feature. With GEM Spooler this is history. 3.1 Installing GEM Spooler -------------------------- GEM Spooler runs on every Atari ST, STE, Mega ST and Mega STE. Theoretically there shouldn't be difficulties with the TT either (GEM Spooler was written following all official programming guidelines), but as we don't have one we can't really verify this. Therefore we encourage TT users to react and contact us ! A harddisk is not necessarily, but recommended. GEM Spooler doesn't need much RAM (see: Technical notes) and even feels at ease at a 520ST. To install GEM Spooler, you proceed as follows: a) Insert the GEM Spooler diskette in a drive and open a window to show its contents. b) Copy the folder GEMSPOOL to the root directory of your boot disk (e.g. A:\ or C:\). c) Open the folder GEMSPOOL (diskette) and copy GSPOOL2.ACC to the root directory of your boot disk. d) Open the folder PDF, select the appropriate *.PDF file (e.g. EPSON.PDF) for your printer, copy it to the root of your boot disk and rename it to GSPOOL2.PDF. e) Open the folder CTB, select the appropriate *.CTB file (e.g. EPSON.CTB) for your printer, copy it to the root of your boot disk and rename it to GSPOOL2.CTB. f) Reboot your ST. 3.2 Functions of GEM Spooler ---------------------------- GEM Spooler redirects all printer output to files (jobs). For each print you start, a job is created. These jobs are put in a queue (the printer queue) and are processed in FIFO order (First in, first out). GEM Spooler is an accessory and can be accessed from within every GEM program to watch and control the queue: - the job sequence can be changed (priority, status) - jobs can be deleted - jobs can be sent to different output ports (printer/modem) - jobs can be filtered (character table): e.g. ‰ can be translated to e, backspace, trema before sending it to the printer - a job can be processed several times (copies) - jobs can be kept on disk to use later; e.g. you could spool something on your ST, keep the job and spool it on a friend's ST (who has a laser printer !) - the whole queue can be halted (and released) with one mouse click ! - the whole queue can be deleted GEM Spooler's queue 'survives' system crashes. After a reset, the spooler simply resumes its work. GEM Spooler is also very safe to use: it is pure GEM, respects the XBRA-protocol, places a system cookie and cooperates with Gemini through the AV-protocol (more about this under: Technical notes). 3.3 Manual ---------- 3.3.1 Dialogs ------------- 3.3.1.1 GEM Spooler dialog -------------------------- Choose GEM Spooler v2.0 in the accessory menu and the GEM Spooler dialog is opened. There you see (top, middel and bottom): * Top: GEM Spooler v2.0 Name and version number of GEM Spooler. Click on it to see the copyright notice. NO ERROR(S) OCCURED Error indicator: if an error occured during the spooling process, this text will change to 'ERROR(S) OCCURED) BYTES PROCESSED: Shows the number of bytes that have been processed for the active job * Middle In the middle you see the queue window where jobs are displayed: C:\TEXT\ASCII.TST P Wait 1 --R 1 D:\DOCS\README M Hold 3 F-- 10 C:\SPOOLING\SPL0.PRN P Wait 3 -T- 2 | | | ||| |-> Copies | | | ||| | | | |||-> Reset printer: R (on) | | | || - (off) | | | || | | | ||-> Trash: T (on) | | | | - (off) | | | | | | | |--> Filter: F (on) | | | - (off) | | | | | |-> Priority: 1-5 | | |-> job path + filename |-> Port: P - Printer M - Modem * Bottom You can click the following buttons: Spool Select a file to spool (the GEM fileselector appears) Jobs Changes the attributes of a chosen job (selection) or the attributes of every new job (no selection) (see: Jobs dialog) Printer Give printer commands, choose the printer driver and the filter (character table) Delete Deletes all jobs (no selection) or a job (selection). GEM Spooler always asks you to confirm this operation: Delete jobs ? / Delete all jobs ? (yes/no) Sort Resort the queue (after a change) immediately. Normally, GEM spooler resorts the queue in background before opening a new. But if you changed a job's attributes you and you want to see the result immediately, you can click 'Sort' The criteria for sorting the queue are: Status: Wait = Keep > Hold = Error (> priority, = equal) Priority: 1 > 2 > 3 > 4 > 5 (> priority) Setup Set the defaults for GEM Spooler (see: Setup dialog) Timing Set the timing variables for the spooler. These variables determine the spooler's speed. Save Save all defaults. All defaults are saved in a file "GSPOOL2.INF" in the root directory of your boot disk. Halt all Click on this square to halt or release the queue (if the square is crossed, the queue is halted). Quit Quit the spooler... 3.3.1.2 Jobs dialog ------------------- With this dialog, you can change a job's attributes. If no job is selected, this dialog will show the attributes that are assigned to every new job (job defaults). If a job is selected, the dialog shows the attributes for the selected job. The difference is visible in the right upper corner: (new jobs) for the 'job defaults' (this job) for the selected job Filter Enable character translation while printing. This option only works if a character translation table (CTB) is loaded (see: Printer dialog). Trash Trash the job file after spooling. If selected, the file is deleted. Reset Reset the printer. If selected, the printer will be reset before and after spooling a job. Copies The number of copies (1 to 99) for this job Status The job status: Wait The job is waiting to be processed Hold The job is held (will not be processed) Keep The job is processed once and put in hold Error An error occured while processing the job You can change the status by clicking on it (have a try !). If you click on an error status, an alert box with the reason for the error is shown. Answer 'OK' and the job will be reset to Wait status. Priority The job's priority, varying from 1 (highest) to 5 (lowest). A job with higher priority will be processed before a job with lower priority. To change the priority, click on the priority number. Output port The port GEM Spooler wil spool the job to: printer/modem, in other words: parallel or serial. IMPORTANT: when spooling to the serial port, the printer output is sent in blocks without any further control. Actually, serial spooling was built in to experiment with null-modem cabling etc. Form feeds Indicates when GEM Spooler has to send a form feed instruction to the printer. You have the choice: Begin Form feed at the begin of a job End Form feed at the end of a job Begin+End Form feeds at the begin and the end of a job Accept Accept all changes and close the dialog Cancel Cancel all changes and close the dialog NOTE: a double click on a job will automatically open the 'Jobs dialog' for that job 3.3.1.3 Timing dialoog ---------------------- The timing dialog shows all parameters that determine the spooling speed. Before we go into detail, we first have to explain the two types of spooling GEM Spooler is capable of: block driven and interrupt driven spooling. Both methods are event driven. This means that the spooling process is activated every x seconds if and only if the program on the foreground is waiting for an event, e.g. a key pressed, a mouse click etc. All GEM programs behave this way. Thus, every x seconds GEM Spooler is given control by GEM. What happens at this moment ? If the spooling is block driven, a whole block of data is sent to the printer. This block with size Y is taken out of a RAM buffer with size Z that contains the output. This buffer is a so called 'file buffer', a small part of memory where GEM Spooler will store a piece of the file it has to spool to reduce the number of disk operations. An example: A printjob of 500 Kb is spooled in blocks of 5 Kb. The file buffer is 50 Kb and the event timer is set to 3. To complete this job, GEM Spooler will have to read 10 times 50 Kb from disk. Every 3 seconds, 5 Kb are sent to the printer. Without file buffer GEM Spooler had to read 100 times 5 Kb ! Block driven spooling is very fast but also has a disadvantage: it can happen that a blocks is sent to the printer before the previous block was completely printed. This causes a slight delay in foreground tasks. Example: the printer has its own buffer of 10 Kb and GEM Spooler sends blocks of 5 Kb every 3 seconds. After 6 seconds of spooling, the printer's buffer will be full (2 times 5 Kb). The printer then has 3 seconds to free 5 Kb of its buffer before the next 5 Kb are sent. Suppose that for some reason the printing is slow (e.g. graphics) and the printer has only freed 3 Kb when the next block is sent. In that case, there will be a slight delay: the ST waits till the printer accepts the new block, in other words: till the printer has freed the full 5 Kb (instead of 3Kb). If the block size is not greater than the printer's buffer and if the event timer interval (x seconds) is large enough to enable the printer to process all data in time, there will be no significant delays. If there is a delay, it will only be visible during intensive foreground tasks (e.g. scrolling). To avoid this problem, GEM Spooler also offers interrupt driven spooling; a job is started by sending a block to the printer, but to decide when a new block is to be sent, GEM Spooler uses the busy interrupt: The printer continuously sends a signal to the computer. If the printer is busy, the signal is high; if the printer is ready, the signal is low. This signal is called the BUSY signal. GEM Spooler links the BUSY signal to an interrupt: if the signal goes high (printer busy) the ST interrupt system waits till the signal goes low again (printer ready). The change from high to low starts the actual BUSY interrupt: all foreground task are halted and control is given to GEM Spooler. GEM Spooler then sends byte per byte to the printer until he's busy again... The result is fast spooling to the printer without delays (because GEM Spooler knows exactly when the printer is ready to receive new data). To control all this, the timing dialog offers: Use busy interrupt (BOOT) If selected, spooling is interrupt driven, other- wise it's block driven. Changes only become ef- fective after saving the defaults and rebooting. Event timer The event timer interval: the spooler is activa- ted by GEM every x seconds (x is the value). Print block The size of the blocks that are sent to the printer. RAM buffer (BOOT) The size of the file buffer (in RAM). Changes only become effective after saving the defaults and rebooting. Accept Accept all changes and quit the timing dialog. Cancel Cancel all changes and quit the timing dialog. 3.3.1.4 Printer dialog ---------------------- This dialog gives you direct control over your printer: e.g. to send a form feed command (page eject) to the printer. At the right of the dialog title, you can see for which printer GEM Spooler has been installed. You can change the printer driver by clicking on the printer name. A fileselector appears and asks you for a Printer Definition File (PDF). A click on 'OK' loads the new driver. A PDF file can be created or changed with the printer installation utility GSPINST.PRG (please read GSPINST.TXT for additional information). If you want GEM Spooler to start up with a certain PDF automatically, rename the PDF file to GSPOOL2.PDF and place it in the root of the boot disk. Other choices in the printer dialog are: FF Sends a form feed LF Sends a line feed Reset Resets the printer. This can take some time, because the printer first processes all information in its buffer. Clear Clears the printer's buffer. This can take some time too. User1 User 1 to 4; these are user defined printer commands User2 (use GSPINST.PRG to install them) User3 User4 Filter The name of the filter that will be used when spooling jobs with the filter option set. The filter is a table with all ASCII characters and their translation in printer codes. e.g. 139 = 105, 008, 126 or: = i If no filter is installed, the button indicates 'NO FILTER!'. You can load/change a filter by clicking on the filter's name. A fileselector will appear to ask you for a CTB file (Character TaBle). Select a CTB and click OK to install the filter. You can make CTB files with the CFGGRAB or CTBMAKE program (read CTBMAKE.TXT or CFGGRAB.TXT for more information). GEM Spooler automatically loads a filter when starting up if it's named GSPOOL2.CTB and if it's located in the root direc- tory of your boot disk. 3.3.1.5 Setup dialog -------------------- This dialog controls some general settings for GEM Spooler: Grow/shrink boxes Indicates whether GEM Spooler has to draw grow/shrink boxes when opening a dialog. Queue logging Turns the queue logging on or off. If queue logging is on, GEM Spooler will create a log file in the spooling directory to keep track of all spooling operations. If queue logging is activated, GEM Spooler will resume spooling automatically after system crashes (reset). Redirect output With this option activated, GEM Spooler will redirect and spool all printer output generated by the programs you run. If the option is deactivated, printer output will not be redirected and only the manually selected files (see: 'Spool') are spooled. [ PATH ] Click this button to select the path were GEM Spooler has to store the redirected output (the jobs). A file- selector appears. Select the desired path and confirm with 'OK' (you can save this path as default with 'Save' in the GEM Spooler dialog). NOTE: jobs with redirected output are given a name with PRN as prefix, followed by a number and the suffix .SPL; e.g. PRN0.SPL, PRN1.SPL, PRN5.SPL For all these files, the TRASH option is set. Timeout: x seconds The timeout is a very important parameter to GEM Spooler. It is used to determine when an application has stopped printing. Example: you are printing with your wordprocessor. GEM Spooler redirects the output. After 60 seconds, GEM Spooler receives no further printer output. What is happening ? There are two possibilities: either the printing is done or the application has to think some time before continuing to print. GEM Spooler will now use the timeout to determine what's up. If the timeout is 10 seconds, GEM Spooler will wait 10 seconds for new printer output. If new printer output is received within these 10 seconds, GEM Spooler will continue redirecting, otherwise the redirection is stopped and all received data is saved to a new job. NOTE: the correct setting for the timeout depends on the speed with which your applications print. However, it is consulted to set the timeout neither too low but nor too high. 5 to 20 seconds should work fine. Accept Accept the changes and quit the setup dialog. Cancel Cancel the changes and quit the setup dialog. 3.3.2 Adding a job ------------------ A job can be added to the spooler queue in two ways: 1) As redirected output of a program. In that case, GEM Spooler gives the file (the job) a temporary name PRNxxxxx.SPL (x: 0, ..., 9) and stores it in the 'spooling directory' (see: Setup dialog). The job is assigned the default job attributes, except for the TRASH option. This option is always enabled. 2) As a file selected by the user: You select a file to spool with the 'Spool' option. GEM Spooler will give this job all the default job attributes ( be careful with the TRASH option !). There is however an exception: the options TRASH and FILTER can be forced to 'enabled', regardless of the default job attributes. To do this, hold the following keys while clicking 'OK' in the file- selector: to enable FILTER to enable TRASH to enable FILTER and TRASH 3.3.3 Activating GEM Spooler from the keyboard --------------------------------------------- GEM Spooler can be activated from the keyboard: hold both and and wait for GEM Spooler to appear. This option can be very useful if for some reason the menu bar can't be used (this will only work in GEM Programs). 3.3.4 BURST mode ---------------- If BURST mode is activated, spooling in background is stopped and all jobs are continuously printed in foreground. Burst mode thus provides in a fast method to 'empty' the whole queue. To activate BURST mode, hold the and keys until an alertbox - "Enable burst mode. Yes/No" - appears. 'Yes' starts burst mode. 3.3.5 Resetting a job --------------------- Sometimes, it can be useful to reset a job. Resetting a job stops the spooling and restores the previous status of the job. To reset a job, hold the CONTROL key down and click on the job. GEM Spooler will ask you to confirm. Answer 'Yes' to reset the job. NOTE: You can only reset a job if it has the 'Print' status. 3.4 Known problems with GEM Spooler ----------------------------------- As far as we know, GEM Spooler v2.0 works fine with all applications, exception made for: - Other spoolers. This is obvious, because there can only be one spooler to spool efficiently. - GEM Spooler is unable (like all other spoolers) to redirect the output from applications that print directly to the parallel port. - The editor Tempus crashes. As Tempus is probably the most frequently patched program on the Atari ST/TT, the solution is simple: don't use it. - The clock of the powerful desk accessory Butler James together with GEM Spooler v2.0 make the system crash. Disable the clock option in Butler James and everything will work fine (Note: Pascal Fellerich told us that future versions of Butler James will use another method to display the clock). That's all. If someone should discover a new problem, don't hesitate to write us ! We always try to fix the problem as fast as possible ! 3.5 GEM Spooler and Gemini -------------------------- GEM Spooler communicates with the popular desktop replacement Gemini (shareware from Gereon Steffens and Stefan Eissing), using the AV-protocol (read the technical notes that come with Gemini). You can install GEM Spooler as an icon on the Gemini desktop. Every file you drop on this icon will be spooled. There is no limitation to the number of icons you can drop. If you double click the GEM Spooler icon, you can activate the accessory. It is also possible to assign files with a certain extension to GEM Spooler. You can double click such a file to spool it. To install this: - select the GEM Spooler icon - choose 'Install application' - enter the desired extension, e.g. *.PRT;*.OUT - click 'OK' - save the defaults (Save defaults) 3.6 GEM Spooler and Chameleon ----------------------------- GEM Spooler can also be used with Chameleon. Chameleon is an accessory from Karsten Isakovic (public domain, also on the Gemini distribution disks) that allows you to load and remove accessories ! This also works with GEM Spooler v2.0 but there are two things you should pay attention to: 1. On the Gemini dekstop, you can drop files on the Chameleon icon. Chame- leon automatically passes these files to the accessory loaded, in this case GEM Spooler. However, while there is no limit for GEM Spooler in accepting files from Gemini, Chameleon (v1.19) could crash if you drop too many files on its icon. 10 seems to be the maximum. This problem does not occur if GEM Spooler is installed as independent accessory. 2. If you removed GEM Spooler with Chameleon and you want to reload it afterwards, GEM Spooler will warn you that it has already been instal- led before. You can answer with: Desinfect: Neutralize GEM Spooler. If there is an other GEM Spooler installed, this is the only correct answer. It is dangerous to install a spooler two times. Tolerate: Tolerate a second installation. If GEM Spooler was already installed but afterwards removed (Chameleon), you can still reinstall it by answering 'Tolerate'. REMARK: Those who adore danger and try to install GEM Spooler 2 times (with 'Tolerate') will notice that one GEM Spooler will redirect the output of the other GEM Spooler. At the end everything will be printed as usual (did you expect a crash ? Sorry !) 4. Technical notes ------------------ GEM Spooler redirects some system vectors/functions: Gemdos trap #1 Bios trap #13 MFP Parallel port prt_stat prt_vec This is done following the XBRA protocol. The identification code is 'GSP1'. If a cookie jar is installed, GEM Spooler also places a cookie in the jar with the name 'GSP1'. By using this cookie, other programs can pass information to GEM Spooler (read the Programmers's notes). GEM Spooler consumes about 57 Kb of RAM without the file buffer (1 Kb mini- mum). 5. Credits ---------- We want to thank everybody who helped us to write GEM Spooler v2.0: - Patrick Op de Beeck, Jan De Smedt and the people of Hobby Computer Club Belgium, Atari gg for their beta testing. - Pascal Fellerich for his suggestions on the busy interrupt, the filter and file buffer - Julian F. Reschke for his monthly article "Atarium" in ST Magazin - where we found lots of useful information on accessory programs - and for all his efforts in promoting serious standards for ST/TT development (these articles are a must for every programmer !) 6. Adresses ----------- If you have questions or remarks, you can always send these to (Belgium): Steven Van Rossen or: Marc Billiet Sportstraat 20 A Teirlinckstraat 33 B-9250 Waasmunster B-2600 Berchem Write us ! Success ! 27 november, Steven Van Rossen