Hi Ladislav, > Hello all, I wrote small and simple program which can detect > any device attached to parallel port. > (It displays parallel port Plug and play device info) > Maybe it isn't so useful for end users but may help to programmers. > URL: http://www.laaca-mirror.ic.cz/lpttest.zip
I would like to report some bugs, so you can make lpttest more useful for end users :-). Thank you for writing lpttest! - lpttest only checks LPT1 and does not check if the baseport of LPT1 is nonzero (in other words, if LPT1 exists...). It should check all of LPT1 / LPT2 / LPT3 if they exist. - lpttest writes the value 4 to the data port without first doing some ieee1284 control / status handshake test. This means it will print a diamond sign on non plug and play printers and in dosemu. That should be avoided. See for example www.theiling.de/parport/introduction.html etc? - lpttest uses an array of 8 bytes as 64 bit delay counter. This is overly complicated. Please use 3 or four 16 bit registers instead, code will be more compact and easier to maintain. - lpttest does not use I/O port reads in the delay counter and the delay counter calibration. This means that counts will be very high (CPU can count much faster than it can read I/O) and that calibration and count durations can differ more (inner loops should be the same in both functions ideally). - lpttest uses some "shl/shr reg,imm" (neither 1 nor CL). This seems to be the only thing which makes it 8086 incompatible? As 8086 compatibility is easy to repair, please support 8086. - lpttest assumes that a timer tick is 64 msec, not 55, and I am not sure if the calculation works out okay on the byte string. A chain of shr/rcr over 3-4 registers would be nice for 64 msec but you can also calibrate 9 ticks as "512" msec ;-). - your stack seems to be very small. In a .com program, it is better to leave the stack setup to the operating system unless you need to shrink the stack eg to allocate more heap or go TSR. Wishes: - the Linux printer port plug and play probe combines per inter- action timeouts with two global limits: Plug and play is aborted if the printer sends more than 2 kB of data or if the whole communication takes more than 5 seconds. Nice idea :-). - you could try to make lpttest fit into 1 kilobyte ;-) For example present / second / ok_id / err_id / our_size + ret_size / failed_1 and failed_2 could be shorter and delay stuff could be simpler. - on PS/2 or newer, int 15 with ah=86 cx:dx=ysec might be useful for delays (usually 1024 Hz granularity, your 1000 ysec should be fine) but you will have to check first if the delay works, for example by checking the BIOS ID or by checking 40:[6c] before/after a call. Have a nice lpttest time :-) Eric ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel