Hi Chris,

> I'll give "printq" a try and see what happens

Hmmm I only found a 6/2000 version on the page,
which is described as being from Dr Dobbs and
being a user interface for PRINT.

It tries to highly portable (various DOS compilers)
and seems to be "1991 by Robert Mashlan, Public
Domain". Most files are from 5/2000. There is no
built-in help, but the following commands are okay:

printq /t --> cancels all queued printjobs
printq /c filenames --> cancels all selected printjobs
printq /p filenames --> adds all selected files to the queue

The main code is in prnspool.c, no wildcards supported.

Install check is: int 2f.100 -> if return al=-1 print found

Enqueue file is: int 2f.101 pack=ds:dx -> carry, ax on error
  pack has fields "level=0" and "pathname=(char far *)string"
  (pack is 1 + 4 bytes) (RBIL: if no carry, 01=added 9e=printing)

Unqueue file is: int 2f.102 stringpointer=ds:ds -> ...

Cancel all is: int 2f.103 -> carry, ax on error

List queue is: int 2f.104 returns ds:si, carry, ax on error
  pointer is to array of strings, each padded to 64 bytes
  (RBIL: also returns error count since last read in DX...)
  (first empty string marks end of list)

List queue ack is: int 2f.105 (needed to continue printing
  after getting the pointer to the live list queue array)

Get status is: int 2f.104 -> carry, ax on error, and always
  in dx the count of printing errors (since when?)

Error codes are:
0 okay 1 invalid func 2 file not found 3 path not found
4 too many files open 5 access denied
8 queue full 9 spooler busy
c name too long
f drive invalid

RBIL also tells that int 2f.106 returns carry, ax=8, ds:si=
  pointer to device driver if printing, no carry, ax=0 else
  (useful to know which device PRINT is using at the moment)
  (useful to avoid concurrent printing to the same device)

So... PRINTQ is just a user interface for PRINT :-)
It should also work for MS PRINT, but of course MS
PRINT has those options built-in anyway.




FreeDOS PRINT is ancient, from 1999... It does not
support ANY command line option beyond a name of a
file to be printed. The first time you run it, it
goes resident, and all other times, it expects a file
name as command line option. Simplistic utility. Yet
the source code is ca 1000 lines of Assembly...

FreeDOS PRINT hooks int 5 (prtscr), 8 (timer),
13 (disk), 24 (error), 28 (idle), 2f (print api).
It also checks for dos critical sections.
RUN_CNT is initially TIME_TOGO (18 ticks, 1 sec).
There is a byte marked with "SETONIT> <" where you
can set the printer number to be used, manually.

You can queue at most 10 files. What FreeDOS PRINT
does is, basically, try to send data to the printer
once per second, but only if neither DOS nor the
disk are active at that moment. Both the timer and
the idle int are used to check the moment. The int
5 hook is simply "suppress print screen while a
queued file is printing". The "level" thing is read
by FreeDOS PRINT as "if 0, then send form feed, and
if 1, do not send form feed". PRINT takes a lot of
effort to avoid collisions with other DOS activities.

For example it uses its own PSP, DTA and crit err
handler. It fully implements the interface used by
MS PRINT and PRINTQ apart from the "get device" one.
At most 256 chars are printed at a time (fixed buffer
size: BUFFER DB 258 DUP..., followed by 192 bytes of
local stack, quite small?).



You could *tune* the print speed by patching the bytes
at file offsets (add 0x100 if you are in debug) here:

- 0x348 reduce from 0x12 but maybe better not to < 2
- 0x395 reduce from 0x12 ...

To change the chunk size, you would have to recompile.



For comparison, MS PRINT has the /T /C /P and filename
options handled by the free PRINTQ, plus also:

/d:device (for example LPT1, default PRN, as with ours)
/b:chunksize (512-16384 default 512, twice of ours)
/u:ticks (to wait till ready) /m:ticks (max wait per 1
char, uses printer default in our print) /s:ticks (how
often to try to send, half of ours) /q:queuesize (1-32,
default 10, as ours).



So FreeDOS PRINT has default queue size 10, chunk size
256, printer PRN, poll delay 18, per char timeout as
set by MODE, unknown ready timeout. All unconfigurable.

MS PRINT has default queue size 10, chunk size 256,
printer PRN, poll delay 8, per char timeout unknown,
ready timeout unknown. So default is to print 4x faster.

You said you wanted PRINT /B:1024 /Q:4 /S:1 /D:PRN
which would be chunk size 1024, queue size 4, poll
delay 1, printer PRN. This is 32x faster than the
MS PRINT default and 128x faster than FreeDOS PRINT.

You can make FreeDOS PRINT 9x faster as described
above, though :-). More only with recompiling.



Note that every PRINT takes a filename as input, not
the actual data to be printed, so it should be easy
to write a FAKE PRINT tool which only grabs the file
and copies it to another file instead of actually
printing it :-). I hope you find one on WWW.

Eric



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to