Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread Eric Auer

Hi all,

> I added help screen, possibility to scan other LPT ports and a little
> modyfied delay routine. For help screen write lpttest /? link:
> http://www.laaca-mirror.ic.cz/lpttest.zip
(compiles with TASM and TLINK)

I have thrown Michael Devore's NoMySo Perl script at the source
and made a NASM version for people who prefer free assemblers :-)

http://www.coli.uni-saarland.de/~eric/stuff/soft/by-others/lpttest-nasm.zip



In addition, I messed with the code and modified a few things:

- made the code nicely indented for easy reading
- buffer is in BSS again now (and btw, 1024h is not 1024 ;-)
  so binary size is 2 kilobytes again now
- multi line strings are only one string, not multi

- modified the port number / address display, new hex2str
- modified int2str for fun, now uses 1x div and 2x aam ;-)
- there is no lpt4, only lpt1 to lpt3. suggestion: probe all
  printers and ignore command line? depends on whether and
  how you want to use lpttest in batch files...
- commented out the "out baseport,4" for testing. GOOD: this
  means you no longer print a diamond in dosemu and non-pnp
  printers. BAD: it is quite possible that some printers now
  no longer show their pnp string, please test
- modified the delay and delay calibration functions: now
  waits 0.5 sec for calibration and 1 msec for each delay,
  using a 48 bit counter. Note: In dosemu on my 2 GHz PC,
  1 msec is only 600 delay loop iterations (because the loop
  contains I/O port access which is slow). Suggestion: use a
  32 bit counter and calibrate during only 0.054 sec?

I hope you like the changes, Laaca :-).



As said, open issues are:

- tune delay handling further?
- make "show for all printers" the default?
- maybe even remove command line handling?

- out baseport,4 should be re-enabled after somebody figures
  out how to check for ieee1284 printer presence before that

The last point has most priority now if you ask me :-).

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


Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread Jim Hall
On 7/12/07, Ladislav Lacina <[EMAIL PROTECTED]> wrote:
>
>
> I added help screen, possibility to scan other LPT ports and a little
> modyfied delay routine.
> For help screen write lpttest /?
> link: http://www.laaca-mirror.ic.cz/lpttest.zip
>

Hi Ladislav,


You _need_ to include a copy of the GNU GPL with a copy of your
program.  I don't see one here.  This file is usually named COPYING.

Also, I recommend you update the GNU GPL comment in your source code.
At the top of your program, you have this GPL statement:

;This program can be spread under conditions of GNU/GPL licence.


That's too brief.  To provide the best protection, you should include
this full text as a comment at the top of your LPTTEST.ASM file {I'm
only using GNU GPL v2 here, since the Linux code you reference
(derived from) is still covered ONLY BY GNU GPL v2.  Therefore, it
would be inappropriate to automatically promote this derivation to GNU
GPL v3.}:

   
   Copyright (C)   

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, only version 2 of the License.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see .

Also add information on how to contact you by electronic and paper mail.


If my assumption about GPL v2 only is correct, you'll need to update
the GPL statement you make in your help screen.  Here's what you have:

warr1 db 'This program is free software; you can redistribute it and/or modify',
13,10,0
warr2 db 'it under the terms of the GNU General Public License as published by',
13,10,0
warr3 db 'the Free Software Foundation; either version 2 of the License, or (at'
,13,10,0
warr4 db 'your option) any later version.',13,10,0


Specifically, you need to update warr3 and warr4 to not give the
option of a later version.  See my text, above.


-jh

-
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


Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread Ladislav Lacina
Wow! It is a touch of master!
Despite I prefer TASM conventions your code is much cleaner than mine. I
like your use of AAM instruction :-)
The only thing I think was better in my code was common procedure for
converting number to string for both numeric systems :-/

>Note: In dosemu on my 2 GHz PC, 1 msec is only 600 delay loop iterations
And how many for pure DOS system?

>probe all printers and ignore command line?
No, I don't like this idea. Better would be to add switch "/A" for all
ports. However this is not needed because you can call LPTtest from batch
file for all ports.
Are you really, absolutely sure that PC can't have LPT4? My eletronical
manual about PC says (translation from czech): 0:040Eh - port LPT4, PS/2:
Extended BIOS data segment
BTW: My computer shows on 0:040Eh value 208h - it doesn't look as BIOS data
segment, IMO

> - tune delay handling further?
I think it is not necessary to more tune delay routine.
> - make "show for all printers" the default?
No.

> - out baseport,4 should be re-enabled after somebody figures out how to
check for ieee1284 printer presence before that
Or we can add some command line switch "/C" (compatibility)

- Original Message -
From: "Eric Auer" <[EMAIL PROTECTED]>
To: 
Sent: Friday, July 13, 2007 5:22 PM
Subject: Re: [Freedos-devel] LPTtest v1.3


>
> Hi all,
>
> > I added help screen, possibility to scan other LPT ports and a little
> > modyfied delay routine. For help screen write lpttest /? link:
> > http://www.laaca-mirror.ic.cz/lpttest.zip
> (compiles with TASM and TLINK)
>
> I have thrown Michael Devore's NoMySo Perl script at the source
> and made a NASM version for people who prefer free assemblers :-)
>
>
http://www.coli.uni-saarland.de/~eric/stuff/soft/by-others/lpttest-nasm.zip
>
>
>
> In addition, I messed with the code and modified a few things:
>
> - made the code nicely indented for easy reading
> - buffer is in BSS again now (and btw, 1024h is not 1024 ;-)
>   so binary size is 2 kilobytes again now
> - multi line strings are only one string, not multi
>
> - modified the port number / address display, new hex2str
> - modified int2str for fun, now uses 1x div and 2x aam ;-)
> - there is no lpt4, only lpt1 to lpt3. suggestion: probe all
>   printers and ignore command line? depends on whether and
>   how you want to use lpttest in batch files...
> - commented out the "out baseport,4" for testing. GOOD: this
>   means you no longer print a diamond in dosemu and non-pnp
>   printers. BAD: it is quite possible that some printers now
>   no longer show their pnp string, please test
> - modified the delay and delay calibration functions: now
>   waits 0.5 sec for calibration and 1 msec for each delay,
>   using a 48 bit counter. Note: In dosemu on my 2 GHz PC,
>   1 msec is only 600 delay loop iterations (because the loop
>   contains I/O port access which is slow). Suggestion: use a
>   32 bit counter and calibrate during only 0.054 sec?
>
> I hope you like the changes, Laaca :-).
>
>
>
> As said, open issues are:
>
> - tune delay handling further?
> - make "show for all printers" the default?
> - maybe even remove command line handling?
>
> - out baseport,4 should be re-enabled after somebody figures
>   out how to check for ieee1284 printer presence before that
>
> The last point has most priority now if you ask me :-).
>
> 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


-
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


Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread Ladislav Lacina
> You _need_ to include a copy of the GNU GPL with a copy of your
> program.  I don't see one here.  This file is usually named COPYING.

But it has no sense. LPTtest is supposed to be a part of FreeDOS and FreeDOS
itself has own copy of COPYING. Why should every small binary to have own
copy of this license?
Maybe rather to spread it as public domain?

> Also, I recommend you update the GNU GPL comment in your source code.
GNU GPL statement is exactly the same like in COMMAND.COM. (I used "ver /d >
gnu.txt")



-
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


Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread Eric Auer

Hi Ladislav,

> > You _need_ to include a copy of the GNU GPL with a copy of your
> > program. I don't see one here. This file is usually named COPYING.

> But it has no sense. LPTtest is supposed to be a part of FreeDOS and
> FreeDOS itself has own copy of COPYING. Why should every small binary
> to have own copy of this license?

I myself solve this by having a copy of the GNU GPL text on my
homepage. It is indeed strange to force people to download binary
and source and GPL in one zip, in particular for tools where the
GPL and/or sources is way larger than the tool itself.

> Maybe rather to spread it as public domain?

Unfortunately, you cannot - your code is still only a TRANSLATION
of Linux kernel code written in C with GPL license FIRST to Pascal
and THEN to Assembly language,  but it still has some smell of GPL
sticking to it. As you have written several functions from scratch,
and as I have written some other functions from scratch, WE as the
authors of THOSE functions can re-publish those functions under a
Public Domain license. Then you could rewrite (stupid but true) the
rest of LPTTEST from scratch based on the ieee1284 specs or another
similar howto and then the whole of LPTTEST can become Public Domain.

This should be feasible: If you subtract the text messages and the
complex Assembly language way to do delay, xwait, command line
parsing and string and number output for DOS, only something about
maybe 0.5 kilobytes of the 2 kilobytes of the LPTTEST.com binary are
still made based on GPL source code anyway.

While I do like the GPL, in particular version 2, I also agree that
it makes life unnecessarily complicated if you only write a quick
tool of a kilobyte or two and do not really care if others recycle
your code under whatever (maybe proprietary) license they like. So
the really TINY tools from my collection are often Public Domain.

Eric

PS: You should also have a look at some of the shorter alternative
licenses, including some copyleft ones... Check the list and...:
www.gnu.org/licenses/license-list.html
www.xfree86.org/3.3.6/COPYRIGHT2.html#3 and #5
www.jclark.com/xml/copying.txt
www.gnu.org/licenses/info/Sleepycat.html <-- a copyleft one :-)
www.freebsd.org/copyright/freebsd-license.html


-
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


Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread Eric Auer

Hi Ladislav,

> Wow! It is a touch of master!

Thanks, but a real master would have fixed the "out base,4 only if"
problem before uploading ;-).

> Despite I prefer TASM conventions your code is much cleaner...

Yeah I made sure that all commands are indented by 1 tab and all
comments are indented by another tab. Simply nicer to read, even
though it does not matter at all for the machine :-).

> I like your use of AAM instruction :-)

It is maybe evil and not portable to 64bit but it is also cool X-).

> The only thing I think was better in my code was common procedure
> for converting number to string for both numeric systems :-/

Depends. Your code is more flexible but using a loop of divides
just to display hex felt strange, too. So I made other code for
hex and, for fun, rewrote the decimal version with AAM. Your code
was also somewhat hard to read afair, but tastes differ.

> >probe all printers and ignore command line?
> No, I don't like this idea. Better would be to add switch "/A"

... or use a batch file ... okay!

> Are you really, absolutely sure that PC can't have LPT4?

The 40:0e value is used for EBDA on PS/2 and newer, and I do
not remember having any "LPT4" ISA hardware at any time, max
was two multi I/O with 1 LPT and 2 COM each plus a Hercules
graphics with a 3rd LPT during an attempt to have as many I/O
ports as possible. Plus FreeDOS kernel supports no LPT4 either.

> > - tune delay handling further?
> I think it is not necessary to more tune delay routine.

Well what I would suggest is to use only ONE tick for calibrate
and only 32 bit for counting. Might make division by 54 easier?
But then, my current division by 512 by shifting is easiest, only
problem with my method is that LPTTEST now takes half a second
for calibrating the delay loop.

> > - make "show for all printers" the default?

Your choice :-).

> > - out baseport,4 should be re-enabled after somebody figures out
> how to check for ieee1284 printer presence before that
> Or we can add some command line switch "/C" (compatibility)

Hmmm well it would make command line parsing more complicated
to allow 2 options simultaneously. And I would actually make
the default choice "yes - do the out baseport,4" anyway. Only
have to figure out how to detect the non-ieee1284 situation
where should abort before the out baseport,4 to avoid printing.


Eric


PS: Default state in DOSEMU is baseport+0/1/2 = 0, d8, 4
(tested with debug "i 378" etc), you can do the whole pnp
id stuff manually with debug and keep watching the state
to find out what changes when and how it differs from "no
printer" or "dosemu" or other non-ieee1284 situations...

Host sends clock via "autofeed" (hostbusy), device replies
via "ack" (ptrclk), note that "strobe" / "init" is not used.
Host sets "selin" for 1284. Printer "busy", "pe", "sel" and
"error" are (ab-)used for nibble data: www.fapo.com/1284int.htm
Normal printing, for comparison, sends clock via "strobe" and
gets replies via "busy" and then "ack".

There is also negotiation: www.fapo.com/negoti8.htm there,
you send nselin high, nautofeed low after setting data to
the requested mode (4 for LPTTEST), printer replies with
correct "ack" / "error" / "pe" / "sel" states, you "strobe",
at end of strobe flip "autofeed", printer replies with "pe"
state and (depending on capabilities) "error" and "select"
to tell if reverse channel and the requested mode are avail.
Then printer flips ack to tell that negotiation is done.


-
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


Re: [Freedos-devel] LPTtest v1.3

2007-07-13 Thread lyricalnanoha


On Sat, 14 Jul 2007, Eric Auer wrote:

> Unfortunately, you cannot - your code is still only a TRANSLATION
> of Linux kernel code written in C with GPL license FIRST to Pascal
> and THEN to Assembly language,  but it still has some smell of GPL
> sticking to it. As you have written several functions from scratch,
> and as I have written some other functions from scratch, WE as the
> authors of THOSE functions can re-publish those functions under a
> Public Domain license. Then you could rewrite (stupid but true) the
> rest of LPTTEST from scratch based on the ieee1284 specs or another
> similar howto and then the whole of LPTTEST can become Public Domain.

One measly line in Diman (a disk image reader I wrote some years ago in 
QuickBasic) is the entire reason I had to gpl it, when I would rather have 
released it BSD.  (it was for parsing a FAT12 table; the code came from 
the FreeDOS kernel.)

I'm not anti-GPL, don't get me wrong, I just don't like tethering others 
down with it, so when I write simple userland tools, I usually BSD or PD 
them.

-uso.

-
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