All of lore.kernel.org
 help / color / mirror / Atom feed
* True Parallel Port Interface for Bit-banging?
@ 2016-10-25 11:21 Sebastian Frias
  2016-10-25 12:09 ` Wolfram Sang
  2016-10-25 13:22 ` Jean Delvare
  0 siblings, 2 replies; 14+ messages in thread
From: Sebastian Frias @ 2016-10-25 11:21 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: philb, Jean Delvare, linux-parport, tim, linux-i2c

Hi,

(NOTE: I also included "I2C over Parallel Port" maintainers in CC because
it seems they do bit-banging for it)

I would guess this question may have been asked before but I did not find references
to an answer, sorry for repeating if that's the case.

I have a legacy application that requires a True Parallel port (ISA compatible)
for bit-banging.
As you know, most computers nowadays do not include a True Parallel port anymore.

There are ExpressCard adaptors, but their base address is not ISA compliant
(378h, 278h).

The legacy application is DOS, so I was thinking of virtualising it under Linux
so that Linux works at ExpressCard address, hoping that the port would end up
being exposed to the virtualised DOS at the right (ISA-legacy) address.

Would that make sense and/or be feasible? Are there better/easier solutions?

Alternatively, does anybody knows if the Parallel Port available thru Laptop
docking stations (Dell, HP, Thinkpad, etc.) are True Parallel Ports (ISA
compatible)?

Thanks in advance.
Best regards,

Sebastian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 11:21 True Parallel Port Interface for Bit-banging? Sebastian Frias
@ 2016-10-25 12:09 ` Wolfram Sang
  2016-10-25 14:20   ` Sebastian Frias
  2016-10-25 13:22 ` Jean Delvare
  1 sibling, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2016-10-25 12:09 UTC (permalink / raw)
  To: Sebastian Frias
  Cc: Sudip Mukherjee, linux-parport, philb, tim, Jean Delvare, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]


> Would that make sense and/or be feasible? Are there better/easier solutions?

Binary patching the DOS application? Port accesses should be easy to
find.

Getting a laptop with parallel port via auction site?

> Alternatively, does anybody knows if the Parallel Port available thru Laptop
> docking stations (Dell, HP, Thinkpad, etc.) are True Parallel Ports (ISA
> compatible)?

The older, the likelier, I'd say :)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 11:21 True Parallel Port Interface for Bit-banging? Sebastian Frias
  2016-10-25 12:09 ` Wolfram Sang
@ 2016-10-25 13:22 ` Jean Delvare
  2016-10-25 16:12   ` Sebastian Frias
  1 sibling, 1 reply; 14+ messages in thread
From: Jean Delvare @ 2016-10-25 13:22 UTC (permalink / raw)
  To: Sebastian Frias; +Cc: Sudip Mukherjee, linux-parport, philb, tim, linux-i2c

On mar., 2016-10-25 at 13:21 +0200, Sebastian Frias wrote:
> Alternatively, does anybody knows if the Parallel Port available thru Laptop
> docking stations (Dell, HP, Thinkpad, etc.) are True Parallel Ports (ISA
> compatible)?

Some laptops such as the ThinkPad T42 had parallel ports, without the
need of a docking station. I know because my dad still has one. But well
these are 2004 machines, may be hard to find these days.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 12:09 ` Wolfram Sang
@ 2016-10-25 14:20   ` Sebastian Frias
  2016-10-25 14:29     ` Wolfram Sang
  0 siblings, 1 reply; 14+ messages in thread
From: Sebastian Frias @ 2016-10-25 14:20 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Jean Delvare, linux-parport, linux-i2c, philb, tim

On 10/25/2016 02:09 PM, Wolfram Sang wrote:
> 
>> Would that make sense and/or be feasible? Are there better/easier solutions?
> 
> Binary patching the DOS application? Port accesses should be easy to
> find.

Would the ExpressCard Parallel Port appear always at the same address?
While this could work, it wouldn't be generic. I would have to do the operation
for N apps.

> 
> Getting a laptop with parallel port via auction site?

:-)
I would like to avoid having to buy another laptop.

The virtualisation idea is not good then?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 14:20   ` Sebastian Frias
@ 2016-10-25 14:29     ` Wolfram Sang
  2016-10-25 14:56       ` Sebastian Frias
  0 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2016-10-25 14:29 UTC (permalink / raw)
  To: Sebastian Frias
  Cc: Sudip Mukherjee, linux-parport, philb, tim, Jean Delvare, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]


> Would the ExpressCard Parallel Port appear always at the same address?
> While this could work, it wouldn't be generic. I would have to do the operation
> for N apps.

I see.

> The virtualisation idea is not good then?

It is not that. I think good old DOSEMU could do that. Bit-Banging ports
can be timing critical, though, and in this department virtualization
solutions often fail.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 14:29     ` Wolfram Sang
@ 2016-10-25 14:56       ` Sebastian Frias
  2016-10-25 17:17         ` Wolfram Sang
  2016-10-26  0:04         ` Maciej S. Szmigiero
  0 siblings, 2 replies; 14+ messages in thread
From: Sebastian Frias @ 2016-10-25 14:56 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Sudip Mukherjee, linux-parport, philb, tim, Jean Delvare, linux-i2c

On 10/25/2016 04:29 PM, Wolfram Sang wrote:
>> The virtualisation idea is not good then?
> 
> It is not that. I think good old DOSEMU could do that. Bit-Banging ports
> can be timing critical, though, and in this department virtualization
> solutions often fail.
> 

Thanks.
I understand your point, but I'm guessing that the big-banging routine (or the
protocol to be used) should be time-independent in order to run on different
real HW PCs, right? Otherwise a 386DX and a 486DX2 could behave differently,
right?

Or is the "timing issue" you talk about more related to unpredictable
latencies due to the way the SW virtualisation works?

What about emulation? Do you think emulation would be more predictable?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 13:22 ` Jean Delvare
@ 2016-10-25 16:12   ` Sebastian Frias
  0 siblings, 0 replies; 14+ messages in thread
From: Sebastian Frias @ 2016-10-25 16:12 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Sudip Mukherjee, linux-parport, philb, tim, linux-i2c

On 10/25/2016 03:22 PM, Jean Delvare wrote:
> On mar., 2016-10-25 at 13:21 +0200, Sebastian Frias wrote:
>> Alternatively, does anybody knows if the Parallel Port available thru Laptop
>> docking stations (Dell, HP, Thinkpad, etc.) are True Parallel Ports (ISA
>> compatible)?
> 
> Some laptops such as the ThinkPad T42 had parallel ports, without the
> need of a docking station. I know because my dad still has one. But well
> these are 2004 machines, may be hard to find these days.
> 

Actually, according to this:

https://www-user.tu-chemnitz.de/~heha/basteln/PC/USB2LPT/index.en.htm

PCMCIA cards could work, is anybody able to confirm?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 14:56       ` Sebastian Frias
@ 2016-10-25 17:17         ` Wolfram Sang
  2016-10-26  0:04         ` Maciej S. Szmigiero
  1 sibling, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2016-10-25 17:17 UTC (permalink / raw)
  To: Sebastian Frias
  Cc: Sudip Mukherjee, linux-parport, philb, tim, Jean Delvare, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]


> Or is the "timing issue" you talk about more related to unpredictable
> latencies due to the way the SW virtualisation works?

Yes, it is all about latencies and meeting deadlines. This is probably
why the application is DOS after all.

> What about emulation? Do you think emulation would be more predictable?

No difference as long as there is a multi-tasking OS in the background.
Yes, the RT patchset might help...


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: True Parallel Port Interface for Bit-banging?
  2016-10-25 14:56       ` Sebastian Frias
  2016-10-25 17:17         ` Wolfram Sang
@ 2016-10-26  0:04         ` Maciej S. Szmigiero
  2016-10-26  5:20           ` [Linux-parport] " Jan Kandziora
  2016-10-28 10:25           ` Sebastian Frias
  1 sibling, 2 replies; 14+ messages in thread
From: Maciej S. Szmigiero @ 2016-10-26  0:04 UTC (permalink / raw)
  To: Sebastian Frias
  Cc: Jean Delvare, linux-parport, Wolfram Sang, linux-i2c, philb, tim

On 25.10.2016 16:56, Sebastian Frias wrote:
> On 10/25/2016 04:29 PM, Wolfram Sang wrote:
>>> The virtualisation idea is not good then?
>>
>> It is not that. I think good old DOSEMU could do that. Bit-Banging ports
>> can be timing critical, though, and in this department virtualization
>> solutions often fail.
>>
> 
> Thanks.
> I understand your point, but I'm guessing that the big-banging routine (or the
> protocol to be used) should be time-independent in order to run on different
> real HW PCs, right? Otherwise a 386DX and a 486DX2 could behave differently,
> right?
> 
> Or is the "timing issue" you talk about more related to unpredictable
> latencies due to the way the SW virtualisation works?
> 
> What about emulation? Do you think emulation would be more predictable?

I don't have experience with bit-banging parallel port but I do have
some with bit-banging PC serial ports (which should be very similar)
and can confirm that old DOS software can be *very* fragile with regard
to timing.
I have tried dosemu, dosbox and as far I remember also VirtualBox
with an old, DOS car service app.
Wasn't able to make it communicate until I booted true DOS.
That machine had old-style ISA serial ports so it was possible.

You also have asked previously whether laptop port would work.
On my current HP Elitebook ports of both types are wired to Super IO,
and using PC standard IO port and interrupt numbers.

I also remember that at least on ThinkPads and HP Compaqs that I had
contact with (these were laptops from 10+ years ago) both serial and
parallel ports were wired to Super IO chip (including ones available
only via port replicator).
So they were also at PC standard resources.

However, other issue is that sometimes such ports are inactive by
default (don't respond) until enabled by PnP.

This is also a problem with PCMCIA cards - they are disabled
by default.
I have Argosy 2xRS232 PCMCIA card and remember it came with
DOS driver which could enable them on I/O port close to standard
one - this was one of their major selling points.
So your ExpressCard would probably need similar software.

Maciej

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-parport] True Parallel Port Interface for Bit-banging?
  2016-10-26  0:04         ` Maciej S. Szmigiero
@ 2016-10-26  5:20           ` Jan Kandziora
  2016-10-28 10:25           ` Sebastian Frias
  1 sibling, 0 replies; 14+ messages in thread
From: Jan Kandziora @ 2016-10-26  5:20 UTC (permalink / raw)
  To: Maciej S. Szmigiero, Sebastian Frias
  Cc: Wolfram Sang, Sudip Mukherjee, linux-parport, philb, tim,
	Jean Delvare, linux-i2c

Am 26.10.2016 um 02:04 schrieb Maciej S. Szmigiero:
>
> I have tried dosemu, dosbox and as far I remember also VirtualBox
> with an old, DOS car service app.
> Wasn't able to make it communicate until I booted true DOS.
> That machine had old-style ISA serial ports so it was possible.
>
This is because it most likely uses the K-Line protocol, which needs to
output two bytes at 5 (in words: FIVE) baud at the very beginning of
each package.

It's no possible to have such a bitrate through any standard driver.
Those old car service apps tweak the UART hardware heavily to output
that signalling. It literally needs a 8250 chip. May even fail with some
SuperIO "16550" emulations in current mainboards.

Newer cars have CAN, but these K-Line cars (up to model year 2005 I
think) can give you headaches.

Kind regards

	Jan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-parport] True Parallel Port Interface for Bit-banging?
  2016-10-26  0:04         ` Maciej S. Szmigiero
  2016-10-26  5:20           ` [Linux-parport] " Jan Kandziora
@ 2016-10-28 10:25           ` Sebastian Frias
  2016-10-28 23:12             ` Maciej S. Szmigiero
  1 sibling, 1 reply; 14+ messages in thread
From: Sebastian Frias @ 2016-10-28 10:25 UTC (permalink / raw)
  To: Maciej S. Szmigiero
  Cc: Wolfram Sang, Sudip Mukherjee, linux-parport, philb, tim,
	Jean Delvare, linux-i2c

On 10/26/2016 02:04 AM, Maciej S. Szmigiero wrote:
> 
> I don't have experience with bit-banging parallel port but I do have
> some with bit-banging PC serial ports (which should be very similar)
> and can confirm that old DOS software can be *very* fragile with regard
> to timing.
> I have tried dosemu, dosbox and as far I remember also VirtualBox
> with an old, DOS car service app.
> Wasn't able to make it communicate until I booted true DOS.
> That machine had old-style ISA serial ports so it was possible.
> 

Thanks for sharing your experience.
I think it should be related to the latencies Wolfram discussed.

> You also have asked previously whether laptop port would work.
> On my current HP Elitebook ports of both types are wired to Super IO,
> and using PC standard IO port and interrupt numbers.

Would you mind sharing the laptop's model? There are a bunch of
Elitebooks and maybe not all have the ports wired.
Does your laptop has the Parallel Port on the docking or on the laptop
itself?

> 
> I also remember that at least on ThinkPads and HP Compaqs that I had
> contact with (these were laptops from 10+ years ago) both serial and
> parallel ports were wired to Super IO chip (including ones available
> only via port replicator).
> So they were also at PC standard resources.
> 

Yes, it appears that Thinkad T42 could work:

https://forum.linuxcnc.org/forum/49-basic-configuration/15999-thinkpad-t42-parallel-port-not-working

> However, other issue is that sometimes such ports are inactive by
> default (don't respond) until enabled by PnP.
> 
> This is also a problem with PCMCIA cards - they are disabled
> by default.

Do you know the command to enable them thru PnP? Shouldn't loading
the kernel module be enough? Or is it the other way around and 
enabling thru PnP triggers the kernel module load process?

> I have Argosy 2xRS232 PCMCIA card and remember it came with
> DOS driver which could enable them on I/O port close to standard
> one - this was one of their major selling points.
> So your ExpressCard would probably need similar software.
> 

Thanks for the pointer.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-parport] True Parallel Port Interface for Bit-banging?
  2016-10-28 10:25           ` Sebastian Frias
@ 2016-10-28 23:12             ` Maciej S. Szmigiero
  2016-11-07 12:44               ` Sebastian Frias
  0 siblings, 1 reply; 14+ messages in thread
From: Maciej S. Szmigiero @ 2016-10-28 23:12 UTC (permalink / raw)
  To: Sebastian Frias
  Cc: Wolfram Sang, Sudip Mukherjee, linux-parport, philb, tim,
	Jean Delvare, linux-i2c

On 28.10.2016 12:25, Sebastian Frias wrote:
> On 10/26/2016 02:04 AM, Maciej S. Szmigiero wrote:
>>
>> I don't have experience with bit-banging parallel port but I do have
>> some with bit-banging PC serial ports (which should be very similar)
>> and can confirm that old DOS software can be *very* fragile with regard
>> to timing.
>> I have tried dosemu, dosbox and as far I remember also VirtualBox
>> with an old, DOS car service app.
>> Wasn't able to make it communicate until I booted true DOS.
>> That machine had old-style ISA serial ports so it was possible.
>>
> 
> Thanks for sharing your experience.
> I think it should be related to the latencies Wolfram discussed.

And probably also baudrate UART tweaks than Jan wrote about.

>> You also have asked previously whether laptop port would work.
>> On my current HP Elitebook ports of both types are wired to Super IO,
>> and using PC standard IO port and interrupt numbers.
> 
> Would you mind sharing the laptop's model?

This is Elitebook model 8570p.

> There are a bunch of
> Elitebooks and maybe not all have the ports wired.
> Does your laptop has the Parallel Port on the docking or on the laptop
> itself?

Only a serial port socket is built-it, parallel port socket is
available only via a port replicator.

According to description of this replicator it is compatible with
a lot of different Elitebooks and Probooks:
http://h30094.www3.hp.com/product.aspx?sku=10432928&mfg_part=A7E34AA&pagemode=ca

I wasn't able find any note in this replicator description that port
availability depends on connected laptop model.
You can try to search for particular laptop model schematics, even
if it is available only for sale sometimes there is a preview
page with block diagram which clearly show where the parallel port
is connected (this is true for my laptop model for example).

However, whether the port is on standard I/O address and interrupt
line requires some more digging.

>> I also remember that at least on ThinkPads and HP Compaqs that I had
>> contact with (these were laptops from 10+ years ago) both serial and
>> parallel ports were wired to Super IO chip (including ones available
>> only via port replicator).
>> So they were also at PC standard resources.
>>
> 
> Yes, it appears that Thinkad T42 could work:
> 
> https://forum.linuxcnc.org/forum/49-basic-configuration/15999-thinkpad-t42-parallel-port-not-working
> 
>> However, other issue is that sometimes such ports are inactive by
>> default (don't respond) until enabled by PnP.
>>
>> This is also a problem with PCMCIA cards - they are disabled
>> by default.
> 
> Do you know the command to enable them thru PnP? Shouldn't loading
> the kernel module be enough? Or is it the other way around and 
> enabling thru PnP triggers the kernel module load process?

If you want to use them under Linux then everything should be taken
care of by kernel's PnP support.
It can be problem if you want to use them under pure DOS.

>> I have Argosy 2xRS232 PCMCIA card and remember it came with
>> DOS driver which could enable them on I/O port close to standard
>> one - this was one of their major selling points.
>> So your ExpressCard would probably need similar software.
>>
> 
> Thanks for the pointer.

Maciej

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-parport] True Parallel Port Interface for Bit-banging?
  2016-10-28 23:12             ` Maciej S. Szmigiero
@ 2016-11-07 12:44               ` Sebastian Frias
  2016-11-07 23:53                 ` Maciej S. Szmigiero
  0 siblings, 1 reply; 14+ messages in thread
From: Sebastian Frias @ 2016-11-07 12:44 UTC (permalink / raw)
  To: Maciej S. Szmigiero
  Cc: Wolfram Sang, Sudip Mukherjee, linux-parport, philb, tim,
	Jean Delvare, linux-i2c

On 10/29/2016 01:12 AM, Maciej S. Szmigiero wrote:
>> Would you mind sharing the laptop's model?
> 
> This is Elitebook model 8570p.

That seems like a fairly recent laptop:

http://www.notebookcheck.net/Review-HP-EliteBook-8570p-B6Q03EA-ABD-Notebook.82291.0.html

and it has a true parallel port? Thanks a lot for the pointer!

>> There are a bunch of
>> Elitebooks and maybe not all have the ports wired.
>> Does your laptop has the Parallel Port on the docking or on the laptop
>> itself?
> 
> Only a serial port socket is built-it, parallel port socket is
> available only via a port replicator.
> 
> According to description of this replicator it is compatible with
> a lot of different Elitebooks and Probooks:
> http://h30094.www3.hp.com/product.aspx?sku=10432928&mfg_part=A7E34AA&pagemode=ca
> 
> I wasn't able find any note in this replicator description that port
> availability depends on connected laptop model.
> You can try to search for particular laptop model schematics, even
> if it is available only for sale sometimes there is a preview
> page with block diagram which clearly show where the parallel port
> is connected (this is true for my laptop model for example).
> 
> However, whether the port is on standard I/O address and interrupt
> line requires some more digging.

Thanks for the information.

>> Do you know the command to enable them thru PnP? Shouldn't loading
>> the kernel module be enough? Or is it the other way around and 
>> enabling thru PnP triggers the kernel module load process?
> 
> If you want to use them under Linux then everything should be taken
> care of by kernel's PnP support.
> It can be problem if you want to use them under pure DOS.
> 

I see, thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Linux-parport] True Parallel Port Interface for Bit-banging?
  2016-11-07 12:44               ` Sebastian Frias
@ 2016-11-07 23:53                 ` Maciej S. Szmigiero
  0 siblings, 0 replies; 14+ messages in thread
From: Maciej S. Szmigiero @ 2016-11-07 23:53 UTC (permalink / raw)
  To: Sebastian Frias
  Cc: Wolfram Sang, Sudip Mukherjee, linux-parport, philb, tim,
	Jean Delvare, linux-i2c

On 07.11.2016 13:44, Sebastian Frias wrote:
> On 10/29/2016 01:12 AM, Maciej S. Szmigiero wrote:
>>> Would you mind sharing the laptop's model?
>>
>> This is Elitebook model 8570p.
> 
> That seems like a fairly recent laptop:
> 
> http://www.notebookcheck.net/Review-HP-EliteBook-8570p-B6Q03EA-ABD-Notebook.82291.0.html
> 
> and it has a true parallel port?

It has parallel port on address 0x378/0x778, IRQ 5 by default which is
realized by Super IO chip.

In PnP config also available for selection are addresses 0x278/0x678,
0x3bc/0x7bc, IRQ 7 and ISA DMA channels 1 and 3.

Although I have never used this port personally it looks like what can
be considered a "true" parallel port.

> Thanks a lot for the pointer!

You are welcome.

Maciej

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-11-07 23:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 11:21 True Parallel Port Interface for Bit-banging? Sebastian Frias
2016-10-25 12:09 ` Wolfram Sang
2016-10-25 14:20   ` Sebastian Frias
2016-10-25 14:29     ` Wolfram Sang
2016-10-25 14:56       ` Sebastian Frias
2016-10-25 17:17         ` Wolfram Sang
2016-10-26  0:04         ` Maciej S. Szmigiero
2016-10-26  5:20           ` [Linux-parport] " Jan Kandziora
2016-10-28 10:25           ` Sebastian Frias
2016-10-28 23:12             ` Maciej S. Szmigiero
2016-11-07 12:44               ` Sebastian Frias
2016-11-07 23:53                 ` Maciej S. Szmigiero
2016-10-25 13:22 ` Jean Delvare
2016-10-25 16:12   ` Sebastian Frias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.