473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Hardware

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

Jan 31 '06 #1
11 2626
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.
Jan 31 '06 #2
freesoft_2000 wrote:
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
Jan 31 '06 #3
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

Jan 31 '06 #4
freesoft_2000 wrote:
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
Jan 31 '06 #5

freesoft_2000 wrote:
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.

Jan 31 '06 #6

freesoft_2000 wrote:
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!

Jan 31 '06 #7
Benry wrote:
freesoft_2000 wrote:
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.


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
--
I'm not just a number. To many, I'm known as a string...
Jan 31 '06 #8
freesoft_2000 wrote:
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?

Feb 1 '06 #9

Ben Pope wrote:
Benry wrote:
freesoft_2000 wrote:
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.


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 Python?


What about it?


Again, just touching up on the 50% of this question that caught my
attention.
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.


done.

ben

Feb 1 '06 #10
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

Feb 1 '06 #11
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

Feb 2 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Miki Tebeka | last post by:
Hello All, I'll be writing a hardware simulator for one of our CPU's shortly. Any advices/links/... on the subject? Thanks. Miki
5
by: Lorax | last post by:
I'm on the IS team of a medium-sized non-profit with international reach. We're trying to make some decisions regarding our Web server and database server as we expand our web site to have more...
3
by: envimargo | last post by:
As I can obtain the hardware installed in a computer with linux?
2
by: Mark | last post by:
We have a particular software project where a minority of the function calls are taking up a majority of the cpu time. (they do a lot of geometric, trig and other functions related to vectors...
6
by: John | last post by:
Hi, I'm ussually just told what I will be working with, but today I was asked to choose the hardware myself. First off, it's a small company, so a $10,000 server is not an option. But also,...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
0
by: edu1982edu | last post by:
MSDN on GetCurrentHwProfile: Remarks The GetCurrentHwProfile function retrieves the display name and globally unique identifier (GUID) string for the hardware profile. The function also retrieves...
41
by: x01001x | last post by:
When programming in C (not C++) how does one send information to a hardware device such as a video card or modem? How is this done in Linux C programming versus Microsoft C programming?
1
by: Max2006 | last post by:
Hi, Is there any guide explains how to calculate the hardware requirement for an application? I am looking for a way to have a rough estimate how much CPU power and RAM do I need for the...
4
by: themadjester | last post by:
Can one disable hardware to increase the amount of addressable memory in windows? by hardware I mean onboard sound cards, pci this and that. The name of the thread explains the question. My...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.