OpenQNX :: The QNX Community Portal

May 13, 2008 - 02:09 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 74 unlogged users and 2 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
thuongshoo
Post subject: How to know address of an ISA card by programming?  PostPosted: Mar 25, 2008 - 05:04 AM
Active Member


Joined: Feb 20, 2008
Posts: 12

Hi All! Smile
To be more comfortable, I wish my driver can detect and know address of an ISA card automaticlly. So how can I do by programming?

Thank you! Smile
 
 View user's profile Send private message  
Reply with quote Back to top
rgallen
Post subject: Re: How to know address of an ISA card by programming?  PostPosted: Mar 25, 2008 - 11:09 PM
QNX Master


Joined: Jul 11, 2002
Posts: 557

thuongshoo wrote:
Hi All! Smile
To be more comfortable, I wish my driver can detect and know address of an ISA card automaticlly. So how can I do by programming?

Thank you! Smile


This will require that you probe for the card. This can hang the computer, and there isn't much you can do about it (remember when Windows 95, used to say "checking for new hardware - this may hang your computer"? That's what it was talking about, and is one of the reasons PCI was created...
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
thuongshoo
Post subject: RE: Re: How to know address of an ISA card by programming?  PostPosted: Mar 26, 2008 - 03:43 AM
Active Member


Joined: Feb 20, 2008
Posts: 12

Thank your information! Smile
But how can I probe?
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject: RE: Re: How to know address of an ISA card by programming?  PostPosted: Mar 26, 2008 - 02:16 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2667

mmap_device_io() and in8(). The rest depends on the hardware you are trying to detect.

But I think you will feel more comfortable NOT probing because if you happen to probe on existing hardware (not the one you are looking for ) all hell could break loose.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
rgallen
Post subject: Re: RE: Re: How to know address of an ISA card by programmin  PostPosted: Mar 26, 2008 - 04:55 PM
QNX Master


Joined: Jul 11, 2002
Posts: 557

mario wrote:
mmap_device_io() and in8(). The rest depends on the hardware you are trying to detect.

But I think you will feel more comfortable NOT probing because if you happen to probe on existing hardware (not the one you are looking for ) all hell could break loose.


Yes, for instance, in order to auto-detect the IRQ you need to do whatever magic it is for the hardware you are searching for to generate the IRQ. If this same magic happens to also trigger some other piece of hardware, then the code that clears the interrupt for your intended device probably won't clear the interrupt for the actual device, and then you have an unserviced interrupt...

That said, depending on how much control you have of the environment, it might not be too bad. It was much worse in the days when there were lots of ISA devices, now your board might be the only device.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
maschoen
Post subject: RE: Re: RE: Re: How to know address of an ISA card by progra  PostPosted: Mar 26, 2008 - 05:21 PM
QNX Master


Joined: Jun 25, 2003
Posts: 974

Some more advanced ISA hardware had readable registers that would not only tell you if you found the hardware, but advise you as to what interrupt and/or dma it was using. An example would be the AHA1520 SCSI controller. Ironically, you set jumpers on the card that would be read, but you also had to set separate jumpers to actually set the IRQ and DMA, so if you did not set the card up correctly, your probe would give you wrong information.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
rgallen
Post subject: Re: RE: Re: RE: Re: How to know address of an ISA card by pr  PostPosted: Mar 26, 2008 - 05:54 PM
QNX Master


Joined: Jul 11, 2002
Posts: 557

maschoen wrote:
Some more advanced ISA hardware had readable registers that would not only tell you if you found the hardware, but advise you as to what interrupt and/or dma it was using. An example would be the AHA1520 SCSI controller. Ironically, you set jumpers on the card that would be read, but you also had to set separate jumpers to actually set the IRQ and DMA, so if you did not set the card up correctly, your probe would give you wrong information.


That was PnP ISA. Didn't last long (fortunately)
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
maschoen
Post subject: RE: Re: RE: Re: RE: Re: How to know address of an ISA card b  PostPosted: Mar 26, 2008 - 06:05 PM
QNX Master


Joined: Jun 25, 2003
Posts: 974

Actually no. PnP was standardized. This was pre-PnP. My example was just something that Adaptec did, and without their specs, you would not know this. I'm sure that this was done ad hoc by other cards.

Although your point about PnP is a good one. PnP cards can be located, and their equipment (IRQ's, DMA, Memory-Map) can be located. There is source for a utility that helps with this.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
thuongshoo
Post subject: RE: Re: RE: Re: RE: Re: How to know address of an ISA card b  PostPosted: Mar 28, 2008 - 05:01 AM
Active Member


Joined: Feb 20, 2008
Posts: 12

Thank you! Smile

Quote:
There is source for a utility that helps with this.

Do you mean isapnp ?
ftp://ftp.qnx.com/usr/free/qnx4/os/utils/misc/isapnp.tgz

I tried to build this project but not success. Sad
 
 View user's profile Send private message  
Reply with quote Back to top
maschoen
Post subject: Re: RE: Re: RE: Re: RE: Re: How to know address of an ISA ca  PostPosted: Mar 28, 2008 - 05:48 AM
QNX Master


Joined: Jun 25, 2003
Posts: 974

thuongshoo wrote:
Thank you! Smile

Quote:
There is source for a utility that helps with this.

Do you mean isapnp ?


Yes

Quote:


ftp://ftp.qnx.com/usr/free/qnx4/os/utils/misc/isapnp.tgz

I tried to build this project but not success. Sad


That's too bad. As porting projects go, this should not be very challenging. Did you just see if it would compile out of the box?
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
thuongshoo
Post subject: RE: Re: RE: Re: RE: Re: RE: Re: How to know address of an IS  PostPosted: Mar 28, 2008 - 08:57 AM
Active Member


Joined: Feb 20, 2008
Posts: 12

Quote:

That's too bad. As porting projects go, this should not be very challenging. Did you just see if it would compile out of the box?

Oh! Yes! Razz . So isapnp for QNX still is in Porting process ?
Razz

This project has some strange. This is the first time which I see a file with .y extension in a C project Confused
 
 View user's profile Send private message  
Reply with quote Back to top
maschoen
Post subject: Re: RE: Re: RE: Re: RE: Re: RE: Re: How to know address of a  PostPosted: Mar 28, 2008 - 04:33 PM
QNX Master


Joined: Jun 25, 2003
Posts: 974

Quote:

Oh! Yes! Razz . So isapnp for QNX still is in Porting process ?


No, you misunderstand me. I meant that it should not be a very difficult porting problem for you. The original isaPnP code came from Linux. It's been ported to QNX 2, and QNX 4. It probably hasn't been ported to QNX 6 because not many people using QNX 6 use legacy ISA cards. In any case, the port involves changing the names of I/O instructions to ones that work, figuring out how to give a program privileges to do I/O, adjusting the makefile so that the correct libraries are used, and possibly a few minor compiler problems. That should be easy. If you don't find it easy, maybe you should hire someone to do it for you.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.