VOGONS


First post, by deimond

User metadata
Rank Newbie
Rank
Newbie

Hi,
I'm trying to run some old software that uses multiport isa adapter.
Software communicate on port com3(this is port 1 on multiport isa card) (adress 2a0 irq5 - hardcoded in software).
All i want to do is to recompile code of megabuild that com3 base address were 2a0 and irq 5. Then I will redirect this to realport of my computer.

I've changed

extern CSerial* serialports[];
const Bit8u serial_defaultirq[] = { 4, 3, 5, 3 };
const Bit16u serial_baseaddr[] = {0x3f8,0x2f8,0x2a0,0x2e8};
const char* const serial_comname[]={"COM1","COM2","COM3","COM4"};

in serialport.h

but still i have no comunication ,

Can you help me with this?

Reply 1 of 13, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

This should be sufficient.
The serial port logging (dbgtr etc.) may help you to further investigate the issue.

1+1=10

Reply 3 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie
danoon wrote:

The default in the config file is to disable serial 3 and 4. Did you make sure to change the config file?

I have enabled port 3 in config.

I think the problem is in interrupt vector adress.
software talks directly to the isa hardware(uarts).
This is isa 4 RS232 port card with four Uarts on board (16c450).

first port base adress is 2a0
second 2a8
2b0
2b8
and the interuupd vector has adress 2BF.
Now main problem is : how to create custom interrupt vector in dosbox at that adress using megabuild serial libraries.

Program uses also com1 and com2 ports (and this ports working without a problem). LPT works too.
Com3(port 1 on isa multiport card) is used for barcode scanner.So i think i have to leave this ports(com1 and com2) configurations unchanged, and add some custom uart emulation. Can i use somehow existing serial functions for this purpose?

Last edited by deimond on 2012-12-02, 11:29. Edited 1 time in total.

Reply 4 of 13, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The program itself has to care for interrupt vectors. Did you use some sort of driver for the multi I/O card?

1+1=10

Reply 5 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie
h-a-l-9000 wrote:

The program itself has to care for interrupt vectors. Did you use some sort of driver for the multi I/O card?

This program works without drivers in dos.
Card config has to be set like i wrote (by jumpers - all 4 uarts share the same interrupt irq5 thats why program uses interuupt vector 2BF to check witch uart generate irq.).
So i think program acces uarts on the card directly by adress not by com name.
From dosbox debug i've notice that program(test function of barcode scaner) first try to access
2a3 adress wich is port 1 LCR line control register.

The multiport card : http://www.pccompci.com/catalog/isabus-4p232-Ca.html

So the only solution is to emulate uart on adress 2a0 wich uses irq5 and has interrupt vector adress at 2bf(wich is selectable by jumpers too on real card)and then redirect communication to any windows com port.

Reply 6 of 13, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

This "interrupt vector" mechanism is a speciality of the card. It is not present in usual PCs, neither emulated by DOSBox.

It's an I/O port where the interrupt output level of the four chips can be read.

1+1=10

Reply 7 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie
h-a-l-9000 wrote:

This "interrupt vector" mechanism is a speciality of the card. It is not present in usual PCs, neither emulated by DOSBox.

It's an I/O port where the interrupt output level of the four chips can be read.

Yes - you are right Haal.
Thank you for help.
I have had similiar problem with this program when i run it with win xp.
I have used direct IO program (http://www.direct-io.com/ )and allow for this programm direct acces to io space 2a0-2bf and irq5, and it works with xp dos emulation.
Now i have harder task - run tis program on win 7:/

Now if interrupt vector is a status byte of four uarts , and i want to use only 1 uart and only this uart will generate an interrupt - so i can use a fixed value of this byte.
I can use a static value at 2BF that will be indicate that only first uart will be generate an interrupt.

How i can declare in source code (and where) some static variable at that adress?

Another solution for me is to use InpOut64 library and use real isa card - but then i will have to use an old isa motherboard with win 7 😒

Reply 8 of 13, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Is this register actually used before the program fails (debugger)? There could be other reasons too.

1+1=10

Reply 9 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie
h-a-l-9000 wrote:

Is this register actually used before the program fails (debugger)? There could be other reasons too.

I have two problems:

- I compiled binaries on win 7(in config i chose x86 architecture and win32 bit) in visual studio express 2010 and when i try to run it on xp i get message the program configuration is invalid

- I have changed adress and irq of port com3 in serialport.cpp in two places :

1.
static void SERIAL_Write (Bitu port, Bitu val, Bitu) {
Bitu i;
Bitu index = port & 0x7;
switch(port&0xff8) {
case 0x3f8: i=0; break;
case 0x2f8: i=1; break;
case 0x2a0: i=2; break; // isa port emu
case 0x2e8: i=3; break;
default: return;
}
if(serialports==0) return;
2.
static Bitu SERIAL_Read (Bitu port, Bitu iolen) {
Bitu i;
Bitu retval;
Bitu index = port & 0x7;
switch(port&0xff8) {
case 0x3f8: i=0; break;
case 0x2f8: i=1; break;
case 0x2a0: i=2; break; // isa port emu
case 0x2e8: i=3; break;
default: return 0xff;

and what i have is attached log files.
edit :
From LOGCPU it seems that program try to read next port on the isa card at adress 2AA (base adress 2A8).
base + 2 IIR(interrupt
identification).
And it is hanging.
So i added next port at 2a8 (com4) and the result is that program try to read nex port IIR (2b2).

So my question is : Can i add some 2 extra serial ports in code ?

Reply 10 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie

Ok - so I've found a working solution.

I've changed ports adresses to (2b0,2b8,2a0,2a8)
Then i patched dos program to use my adressess(2b0 and 2b8) instead of 3f8 and 2f8 (com1 and com2) ports.

This is a 'dirty' solution but it's work.

Thank you H-a-a-l for uart emulation. It looks like with your libraries you can emulate isa multiport cards with no problem.
The better solution is to add some uart emulation on additional two adresses without touching standart com ports.
Unfortunately, I have low programming skills in C.

Best Regards.

Reply 11 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie

I have some problems building dosbox using visual studio 2008 without internal debugger.
Serial communiccation did not work when i compile dosbox with debugger disabled
#define C_DEBUG 0

h-a-l-9000 - can you kindly tell witch compiler do you use with your relase to obtain win binaries with debug and without debug.
I have tried latest mingw but this is a hell:/

Reply 12 of 13, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

That was MSVC 2003.

1+1=10

Reply 13 of 13, by deimond

User metadata
Rank Newbie
Rank
Newbie

It was my mistake:) Just forget to save changes in c file before "no debug" compilation:)
Now it's working with versions.