OpenQNX :: The QNX Community Portal

May 13, 2008 - 12:00 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 51 unlogged users and 0 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
kadalthewizard
Post subject: Mange ISA Hardware...  PostPosted: Jun 15, 2005 - 01:39 PM
Active Member


Joined: Apr 20, 2005
Posts: 80
Location: Italy
http://www.qnx.com/developers/articles/article_304_2.html&printable=1

in here I found how to work with a PCI device which have no driver.
I read that
Code:
Different buses have different mechanisms for determining which resources have been assigned to the device. On some buses, such as the ISA bus, there's no such mechanism. How do you determine whether an ISA device is present in the system and how it's configured? The answer is card-dependent (with the exception of "PnP" ISA devices).


so my question is: there is a similar guide but referencing to ISA busses?

thanks...

_________________
42

In Code we Trust

The end is near...
 
 View user's profile Send private message  
Reply with quote Back to top
jinma
Post subject: RE: Mange ISA Hardware...  PostPosted: Jun 15, 2005 - 04:29 PM
Senior Member


Joined: Oct 28, 2004
Posts: 265

In referencing ISA buses, if it is not a PnP device, then there must be a memory location in the ISA card which you can read and write to. It is this memory address (which should be in the ISA bus memory address range) that you need to map using mmap_device_io() and the pointer returned by this function is used in the in() or out() function to communicate with the device. Hope this help.

_________________
Matthew Jin
Software Engineer
 
 View user's profile Send private message  
Reply with quote Back to top
kadalthewizard
Post subject:   PostPosted: Jun 16, 2005 - 09:14 AM
Active Member


Joined: Apr 20, 2005
Posts: 80
Location: Italy
I solved it just mapping the region (0xD0000) using mmap_device_memory and so using the mapped register as a vector...

it is the only way I found in which it work...

using in/out it access an unknown memory area because it read the same value with the board installed or not...

_________________
42

In Code we Trust

The end is near...
 
 View user's profile Send private message  
Reply with quote Back to top
xuyong
Post subject:   PostPosted: Jun 16, 2005 - 02:07 PM
Senior Member


Joined: Mar 02, 2003
Posts: 277

by the way,I want to know how to support isa buses in qnx,which command should I add in build file?
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject:   PostPosted: Jun 16, 2005 - 02:45 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2667

Nothing is required to support ISA (I don't think QNX support ISA Pnp). It's just there, just like RAM.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
mario
Post subject:   PostPosted: Jun 16, 2005 - 02:49 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2667

kadalthewizard wrote:
I solved it just mapping the region (0xD0000) using mmap_device_memory and so using the mapped register as a vector...

it is the only way I found in which it work...

using in/out it access an unknown memory area because it read the same value with the board installed or not...


in/out instructions provide access to a different space then using normal address. This is not a QNX concept, this is x86 stuff. One could argue that today in/out are not necessary anymore. In the "old" days, the in/out were very usefull, given CPU could only access 1Meg of ram These IO instruction provide another set of address space outside of normal memory space.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
kadalthewizard
Post subject:   PostPosted: Jun 16, 2005 - 03:34 PM
Active Member


Joined: Apr 20, 2005
Posts: 80
Location: Italy
but there is a way, knowing only the base address, to know the port registers? (or maybe, just the offset for tx and rx or something?)...
in the user manual there's no references to something similar...

_________________
42

In Code we Trust

The end is near...
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject:   PostPosted: Jun 16, 2005 - 07:36 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2667

There is no standard way, it's up to each board to map register as they see fit. You need the documentation.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
kadalthewizard
Post subject:   PostPosted: Jun 17, 2005 - 06:59 AM
Active Member


Joined: Apr 20, 2005
Posts: 80
Location: Italy
ok..the documentation I can use don't have othing similar...I contact the technical support and they sayd that is useful to use the API function for load the board.
I sayd that I've already do this but it not work ("Board not found" error);
they replyes:

-------
The CEI-x20 API communicates with the hardware exclusively via direct pointer access relative to the base board address. None of the CEI-x20 boards use i/o ports.

All that the low-level implementation needs to do is pass the mapped address of the board back to the API (via vbtMapBoardAddresses). All board accesses are performed by the API relative to that address, so no API modifications should be necessary.
---------

but I've already try to do this mmapping the real address and passing it to the function but the result is the same ("board not found")

_________________
42

In Code we Trust

The end is near...
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject:   PostPosted: Jun 17, 2005 - 07:54 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2667

"but I've already try to do this mmapping the real address and passing it to the function but the result is the same",

maybe you are doing it wrong.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
jinma
Post subject:   PostPosted: Jun 20, 2005 - 09:34 PM
Senior Member


Joined: Oct 28, 2004
Posts: 265

Here is sample code for doing mmap_io. you need to do ThreadCtl() first for permission purpose.

ok = ThreadCtl(_NTO_TCTL_IO, 0);
if (ok==-1)
{
printf("You do not have permission to start this process\n");
exit(1);
}
io_ptr=mmap_device_io(2,0x1EA);
out8(io_ptr,0x0F);

_________________
Matthew Jin
Software Engineer
 
 View user's profile Send private message  
Reply with quote Back to top
kadalthewizard
Post subject:   PostPosted: Jun 21, 2005 - 01:45 PM
Active Member


Joined: Apr 20, 2005
Posts: 80
Location: Italy
I solved Everything!! chenging every mmap with mmap_device_memory (with right args) and forcing some addresses at my address (0xD0000)..

now I've got only one problem(I don't know the size of the mappe area, so I can't correctly manage the addresses) but the technichal support will help me (I hope)

_________________
42

In Code we Trust

The end is near...
 
 View user's profile Send private message  
Reply with quote Back to top
jinma
Post subject:   PostPosted: Jun 21, 2005 - 05:36 PM
Senior Member


Joined: Oct 28, 2004
Posts: 265

I think that is hardware dependent. You should see your hardware spec.

_________________
Matthew Jin
Software Engineer
 
 View user's profile Send private message  
Reply with quote Back to top
kadalthewizard
Post subject:   PostPosted: Jun 22, 2005 - 10:03 AM
Active Member


Joined: Apr 20, 2005
Posts: 80
Location: Italy
yes it was an hardware problem...I have only +12V and +5V and I need -12V too...now is all right

_________________
42

In Code we Trust

The end is near...
 
 View user's profile Send private message  
Reply with quote Back to top
thuongshoo
Post subject:   PostPosted: Mar 25, 2008 - 08:14 AM
Active Member


Joined: Feb 20, 2008
Posts: 12

jinma wrote:
Here is sample code for doing mmap_io. you need to do ThreadCtl() first for permission purpose.

[color=green]ok = ThreadCtl(_NTO_TCTL_IO, 0);
if (ok==-1)
{
printf("You do not have permission to start this process\n");
exit(1);
}
io_ptr=mmap_device_io(2,0x1EA);
out8(io_ptr,0x0F);

[/color]


Hi! Can I run below line? because I have not yet receive the card but my teamleader ask me to still write the driver.

Code:

 i=  in16(io_ptr+0x10);

0x1EA+0x10 still is a port of the card
Thanks!
I'm sorry! I don't know why color of texr is similar. I try to use many colors to....
 
 View user's profile Send private message  
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.