Hardware

F

freesoft_2000

Hi everyone,

I need to ask a rather simple question so please bear with me
as I tried to search on google but could not come up with anything.

You see i wish to control the pc's hardware via
usb, parallel and serial ports and pci cards

Is there any tutorial out there that can help to do hardware programming
on the pc with C/C++.

Thank You

Yours Sincerely

Richard West
 
L

loufoque

freesoft_2000 a écrit :
Is there any tutorial out there that can help to do hardware programming
on the pc with C/C++.

You will need to state your Operating System.
 
V

Victor Bazarov

freesoft_2000 said:
I need to ask a rather simple question so please bear with me
as I tried to search on google but could not come up with anything.

Try 'alt.internet.search-engines', they might be able to help.
You see i wish to control the pc's hardware via
usb, parallel and serial ports and pci cards

Is there any tutorial out there that can help to do hardware programming
on the pc with C/C++.

Hardware control is not part of either language. You need to ask about it
in the newsgroup dedicated to your OS. See FAQ for suggestions where to
post your OS-specific question.

V
 
F

freesoft_2000

Hi everyone,

My os is windows but what i am trying to do to create a
multiplatform C/C++ code that can talk to the hardware on my pc.

Is there a way this can be achieved

Richard West
 
V

Victor Bazarov

freesoft_2000 said:
My os is windows but what i am trying to do to create a
multiplatform C/C++ code that can talk to the hardware on my pc.

Is there a way this can be achieved

The only way I know is to use some multi-platform library. See the
archives for "Available C++ Libraries FAQ" posted here periodically by
Nikki Locke.

V
 
R

roberts.noah

freesoft_2000 said:
Hi everyone,

My os is windows but what i am trying to do to create a
multiplatform C/C++ code that can talk to the hardware on my pc.

Is there a way this can be achieved

You need a hardware abstraction level above the OS level that is then
specialized for the different target operating systems. Either build
it or use someone else's.
 
B

Benry

freesoft_2000 said:
Hi everyone,

My os is windows but what i am trying to do to create a
multiplatform C/C++ code that can talk to the hardware on my pc.

Is there a way this can be achieved

I know people are going to kill me here...but have you thought about
using Java? It's easier to write cross platform.

What about Python?

Basically, with c++, there is a lot more testing that you have to do,
and preprocessor directives that are very fun to mess with. With java,
it's compilied down into smaller code, which is the run on a specific
platform by the Virtual Machine. .NET is similar, but .NET is only
available for Windows right now.

BURN HIM (me) AT THE STAKE!
 
B

Ben Pope

Benry said:
I know people are going to kill me here...but have you thought about
using Java? It's easier to write cross platform.

I didn't realise Java had cross platform APIs for access to PCI cards,
USB, parallel and serial ports.
What about Python?

What about it?
Basically, with c++, there is a lot more testing that you have to do,
and preprocessor directives that are very fun to mess with. With java,
it's compilied down into smaller code, which is the run on a specific
platform by the Virtual Machine. .NET is similar, but .NET is only
available for Windows right now.

See Mono.
BURN HIM (me) AT THE STAKE!

/me gets matches.

Ben Pope
 
P

Pete C

freesoft_2000 said:
My os is windows but what i am trying to do to create a
multiplatform C/C++ code that can talk to the hardware on my pc.

You are asking for a cross-platform device driver for many different
types of device at once - that's just not feasible. And besides,
talking to the hardware is what the OS is for. Some libraries exist to
let you use certain categories of device in a portable way (OpenAL for
audio devices, SDL for video cards, you might even say PostScript for
printers), but you're not going to find one library that lets you drive
a both a USB bar code scanner and a joystick via the same API in a
cross-platform manner. If you want to write one, good luck to you.

Was that really the question you were asking?
 
B

Benry

Ben said:
I didn't realise Java had cross platform APIs for access to PCI cards,
USB, parallel and serial ports.

Yeah, I was more concerned about the cross platform rather than the
drivers aspect. I guess those are pretty specific. I guess it would
be much easier in C since Java doesn't have the libraries yet.
What about it?

Again, just touching up on the 50% of this question that caught my
attention.
See Mono.

done.

ben
 
F

freesoft_2000

Hi everyone,

I had always thought that standard C/C++ were both multi
platform. Correct me if i am wrong.
Was that really the question you were asking?

Its about 90% of the question i was asking. I need to know how to access
USB, parallel and serial ports as well as pci cards in a multiplatform
way.\

I tried checking java and it seems that they have released a java library
to communicate with both serial and parallel ports only but it seems to be
very unstable.

By the way is there any free ebook or articles on accessing hardware using
C/C++. I tried to search on google but came up empty. If someone has any
links i would really appreciate it

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
B

Benry

I had always thought that standard C/C++ were both multi
platform. Correct me if i am wrong.

The language is, but the compiliers must be in place, and are different
for your OS and architecture. Also, different platforms require
different methods of accessing I/O's.
By the way is there any free ebook or articles on accessing hardware using
C/C++. I tried to search on google but came up empty. If someone has any
links i would really appreciate it

Try searching for "Writing .DLLs", look for your platform and
architecture's register maps. You'll probably find the best
information this way.

Actually, I found this with a quick search on Google:
http://www.codeproject.com/system/interrupthook.asp

I know USB works differently, so you might want to research how USB
works with your OS to get a feeling for what your real goals are. The
reason someone asked "is this your real question" is because there are
a lot of levels. You can just do this:
printf(USB_PORT, "Hello External World!");

Unless you first know what USB_PORT is. Good luck, I would be
interested in using or hearing your results!

-ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top