Skip to contentSkip to conversation

True Parallel Port Interface for Bit-banging?

DISCUSSION Sebastian Frias 5 participants 14 messages Oct 25, 2016 – Nov 7, 2016 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 2 lines

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?

Quoted 3 lines

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 :)

#2 lore raw
Quoted 5 lines · Wolfram Sang
Quoted 2 lines

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.

Quoted 2 lines

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?

#3 lore raw
Quoted 4 lines

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.

Quoted 1 line

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.

#4 lore raw
Quoted 6 lines · Wolfram Sang
Quoted 1 line

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?

#5 lore raw
Quoted 3 lines

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.

Quoted 1 line

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...

#6 lore raw
In reply to Sebastian Frias
Quoted 14 lines · Sebastian Frias
Quoted 6 lines · Wolfram Sang
Quoted 1 line

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?

Quoted 4 lines

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

#7 lore raw

Am 26.10.2016 um 02:04 schrieb Maciej S. Szmigiero:

Quoted 6 lines

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

#8 lore raw
In reply to Maciej S. Szmigiero
Quoted 10 lines · Maciej S. Szmigiero

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.

Quoted 3 lines

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?

Quoted 7 lines

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

Quoted 5 lines

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?

Quoted 5 lines

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.

#9 lore raw
Quoted 12 lines · Sebastian Frias
Quoted 10 lines · Maciej S. Szmigiero

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.

Quoted 2 lines

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 14 lines
Quoted 6 lines

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

Quoted 3 lines

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

Quoted 6 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 5 lines

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

#10 lore raw
Quoted 3 lines · Maciej S. Szmigiero
Quoted 1 line

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!

Quoted 19 lines
Quoted 4 lines

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).

Quoted 2 lines

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

Thanks for the information.

Quoted 8 lines
Quoted 3 lines

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.

#11 lore raw
Quoted 10 lines · Sebastian Frias
Quoted 3 lines · Maciej S. Szmigiero
Quoted 1 line

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.

Quoted 1 line

Thanks a lot for the pointer!

You are welcome.

Maciej

#12 lore raw
In reply to Sebastian Frias
Quoted 3 lines · Sebastian Frias

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.

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#13 lore raw
Quoted 9 lines · Jean Delvare
Quoted 3 lines · Sebastian Frias

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?