1. How to acces busbased cards ( PCI/ ISA)

Hello Forum,

Another lurker from the shadows with a question.

I wish to be able to acces either ISA or PCI digital I/O card in order to interface external bitsa.

Please a dvise.

new topic     » topic index » view message » categorize

2. Re: How to acces busbased cards ( PCI/ ISA)

Is there a C library that does this already? Possibily available as a .DLL/.SO? I believe this would be the easiest way. Euphoria makes the job of accessing C libraries pretty easy.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

3. Re: How to acces busbased cards ( PCI/ ISA)

jeremy said...

Euphoria makes the job of accessing C libraries pretty easy.

Well "pretty easy" is relative. I find it "pretty hard". Evaluating the offsets of C's structs by hand and peek'ing and poke'ing into memory is not exactly my definition of fun...

new topic     » goto parent     » topic index » view message » categorize

4. Re: How to acces busbased cards ( PCI/ ISA)

arrr... sooo... whats the "hard" way to do it?

new topic     » goto parent     » topic index » view message » categorize

5. Re: How to acces busbased cards ( PCI/ ISA)

Critic said...

Well "pretty easy" is relative. I find it "pretty hard". Evaluating the offsets of C's structs by hand and peek'ing and poke'ing into memory is not exactly my definition of fun...

Well, assuming that you don't need to access C structs in eu code directly while wrapping the dll, eu makes wrapping C code prettty easy.

new topic     » goto parent     » topic index » view message » categorize

6. Re: How to acces busbased cards ( PCI/ ISA)

neophyte said...

Hello Forum,

Another lurker from the shadows with a question.

I wish to be able to acces either ISA or PCI digital I/O card in order to interface external bitsa.

Please a dvise.

What operating system are you using? This is very important (i.e. this is next to impossible on Linux (short of a kernel patch at least) but probably fairly easy in DOS)

new topic     » goto parent     » topic index » view message » categorize

7. Re: How to acces busbased cards ( PCI/ ISA)

Critic said...
jeremy said...

Euphoria makes the job of accessing C libraries pretty easy.

Well "pretty easy" is relative. I find it "pretty hard". Evaluating the offsets of C's structs by hand and peek'ing and poke'ing into memory is not exactly my definition of fun...

Critic, most libraries do not require you to do things like that, that's why they are libraries, to make things easy. But, please, let's not hijack someone else's legitimate thread to bash, OK? Start a new thread if you would like bashing the methods Euphoria uses to wrap a Library.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

8. Re: How to acces busbased cards ( PCI/ ISA)

Everything I read this thread, it fails to get marked as "read" in the message list. Why is that?

-Greg

new topic     » goto parent     » topic index » view message » categorize

9. Re: How to acces busbased cards ( PCI/ ISA)

JimCBrown,

The intention is to stick with DOS intially and eventually move to Linux as I gather more knowledge and skills.

Your comment however seems to suggest that Euphoria is not quite cross platform. Is that so?

new topic     » goto parent     » topic index » view message » categorize

10. Re: How to acces busbased cards ( PCI/ ISA)

neophyte said...

Your comment however seems to suggest that Euphoria is not quite cross platform. Is that so?

Euphoria is cross-platform, however, hardward access is very platform specific. For instance, in Linux, you may very well have to patch the kernel. In Windows XP and above, you cannot access hardware unless your software is a registered driver.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

11. Re: How to acces busbased cards ( PCI/ ISA)

neophyte said...

JimCBrown,

The intention is to stick with DOS intially and eventually move to Linux as I gather more knowledge and skills.

Your comment however seems to suggest that Euphoria is not quite cross platform. Is that so?

Correct, in this particular instance Euphoria is not very cross platform.

In this particular instance, you are not going to find any language that is cross platform. Linux makes it impossible to access PCI/ISA cards from user space (meaning that unless you have or write a special linux kernel module/linux driver, you can't do it at all). And Linux kernel modules must be written in C, it is not possible to use anything else.

(Note: for a working implementation on Linux, google for qemu pci proxy patch. It's not impossible, but not very easy.)

new topic     » goto parent     » topic index » view message » categorize

12. Re: How to acces busbased cards ( PCI/ ISA)

jimcbrown said...
neophyte said...

JimCBrown,

The intention is to stick with DOS intially and eventually move to Linux as I gather more knowledge and skills.

Your comment however seems to suggest that Euphoria is not quite cross platform. Is that so?

Correct, in this particular instance Euphoria is not very cross platform.

In this particular instance, you are not going to find any language that is cross platform. Linux makes it impossible to access PCI/ISA cards from user space (meaning that unless you have or write a special linux kernel module/linux driver, you can't do it at all). And Linux kernel modules must be written in C, it is not possible to use anything else.

(Note: for a working implementation on Linux, google for qemu pci proxy patch. It's not impossible, but not very easy.)

You must understand that modern versions of Windows and Linux do not permit direct access to hardware devices. This is enforced by the operating system. On these systems you must use the system supplied functions. There is no other way, with any language.

new topic     » goto parent     » topic index » view message » categorize

13. Re: How to acces busbased cards ( PCI/ ISA)

LarryMiller said...

You must understand that modern versions of Windows and Linux do not permit direct access to hardware devices. This is enforced by the operating system. On these systems you must use the system supplied functions. There is no other way, with any language.

It may, however, be possible to do this from Windows 95.

The pci proxy I referenced earlier has a custom kernel module that adds the functionality (and even then, only through the special module supplied functions).

new topic     » goto parent     » topic index » view message » categorize

14. Re: How to acces busbased cards ( PCI/ ISA)

Well reading through all of this it seems I need to C my way through to Euphoria ( sigh.. sorry).

How do I.. or more to the point what is this "wrapping" process all about and where/ how/ who/ do I find the information on how to do the wrapping.. but more to the point what do I wrap?

I mean do I have to be an expert in C in order to be productive in Euphoria?

new topic     » goto parent     » topic index » view message » categorize

15. Re: How to acces busbased cards ( PCI/ ISA)

neophyte said...

How do I.. or more to the point what is this "wrapping" process all about and where/ how/ who/ do I find the information on how to do the wrapping.. but more to the point what do I wrap?

Assuming we are still focusing on accessing the hardware directly, and assuming you want to do this in a Linux or Windows environment, then you need to seriously upgrade your skills. You will need to write a device driver for the particular card in mind. This is an advanced skill set and not for the faint-hearted. Maybe you can get lucky if someone else has already written the driver for it. In which case, all you need is to contact them and get hold of the documentation for the driver.

In Windows, you will need to use the Windows API calls to access the device driver so will need to wrap the appropriate .DLL file functions for that API. You will need to do some research at the Microsoft Developer Network site http://msdn.microsoft.com/en-us/library/aa972908.aspx to find out more about which API is required.

In an MS-DOS environment, Euphoria already has the built-in routines to peek/poke into memory-mapped port locations.

neophyte said...

I mean do I have to be an expert in C in order to be productive in Euphoria?

No.

But let's back up a moment. Why do you want to access PCI and/or ISA cards? Is it a particular card you have in mind? If so, the manufacturer has probably already got a driver for it. Just ask them for the specs and API for the driver.

new topic     » goto parent     » topic index » view message » categorize

16. Re: How to acces busbased cards ( PCI/ ISA)

I think that the various cards may have thier own different API for the kernel and then the kernel provides the user with an API which is more or less the same across cards of the same type. This is more of a C question to me. How do I say open a sound device for reading and writing and then read and manipulate the audio data on its way in? What kind of device does the original poster want to write for?

Shawn Pringle

new topic     » goto parent     » topic index » view message » categorize

17. Re: How to acces busbased cards ( PCI/ ISA)

SDPringle said...

I think that the various cards may have thier own different API for the kernel and then the kernel provides the user with an API which is more or less the same across cards of the same type.

This is exactly right.

SDPringle said...

This is more of a C question to me. How do I say open a sound device for reading and writing and then read and manipulate the audio data on its way in?

On Unix, you usually can just do a open("/dev/dsp", "u") and then read and write to the file. Most other devices can be accessed the same way.

On DOS, you just use the driver's api directly.. No C code required.

SDPringle said...

What kind of device does the original poster want to write for?

The OP did not say.

new topic     » goto parent     » topic index » view message » categorize

18. Re: How to acces busbased cards ( PCI/ ISA)

I did initially indicate it to be a digital I/O card witn programmable ( input ot utput ) dtial lines.

new topic     » goto parent     » topic index » view message » categorize

19. Re: How to acces busbased cards ( PCI/ ISA)

jimcbrown said...
SDPringle said...

This is more of a C question to me. How do I say open a sound device for reading and writing and then read and manipulate the audio data on its way in?

On Unix, you usually can just do a open("/dev/dsp", "u") and then read and write to the file. Most other devices can be accessed the same way.

How does one enumerate the audio devices in Linux? Suppose you want to use a USB audio out only device to for output to the speakers but a USB headset for input only. Then there is a BUS audio which has a lot of noise on it. I don't even use it anymore.

Can you get a descriptive names for the devices from /dev/dsp0, /dev/dsp1?

new topic     » goto parent     » topic index » view message » categorize

20. Re: How to acces busbased cards ( PCI/ ISA)

SDPringle said...

How does one enumerate the audio devices in Linux? Suppose you want to use a USB audio out only device to for output to the speakers but a USB headset for input only. Then there is a BUS audio which has a lot of noise on it. I don't even use it anymore.

Can you get a descriptive names for the devices from /dev/dsp0, /dev/dsp1?

I think this is more OS-dependent. On Linux, using true OSS you open /dev/sndstat (it returns human readable text) and parse it, while with ALSA's OSS emulation you open /proc/asound/cards (more human readable text) and parse that.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu