473,787 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using the parallel port

I am looking to read a byte or write a byte on the parallel port in linux.
I am using red hat 7.3. I tired using this but i couldnt get anywere.
{
unsigned char value;
__asm__ volatile ("inb %1,%0"
: "=a" (value)
: "d" ((unsigned short)port));
return value;
} */

static inline void port_out( unsigned short int port, unsigned char val )
{
__asm__ volatile (
"outb %0,%1\n"
:
: "a" (val), "d" (port)
);
}

what am i missing, what else can i do?

thanks

joe


Jul 22 '05 #1
4 7063
"Joseph Suprenant" <la******@yahoo .com> wrote...
I am looking to read a byte or write a byte on the parallel port in linux.
I am using red hat 7.3. I tired using this but i couldnt get anywere.
{ [non-standard code removed] }

what am i missing, what else can i do?


You're missing the fact that standard C++ (the subject of this
newsgroup) has no means to "read a byte or write a byte on the
parallel port". You need to use system-specific solutions,
which are discussed in comp.os.linux.d evelopment.* family of
newsgroups.
Jul 22 '05 #2
I am missing the fact? Please point the fact out to me, so i won't miss it
next time.

"Victor Bazarov" <v.********@com Acast.net> wrote in message
news:zncvb.2568 62$HS4.2314084@ attbi_s01...
"Joseph Suprenant" <la******@yahoo .com> wrote...
I am looking to read a byte or write a byte on the parallel port in linux. I am using red hat 7.3. I tired using this but i couldnt get anywere.
{

[non-standard code removed]
}

what am i missing, what else can i do?


You're missing the fact that standard C++ (the subject of this
newsgroup) has no means to "read a byte or write a byte on the
parallel port". You need to use system-specific solutions,
which are discussed in comp.os.linux.d evelopment.* family of
newsgroups.

Jul 22 '05 #3
"Joseph Suprenant" <la******@yahoo .com> wrote...
I am missing the fact? Please point the fact out to me, so i won't miss it
next time.
Is English a second language to you? Am I really so unclear in
the first sentence of my reply?

You are missing the fact _that_ standard C++ has no means to do
what you want. The fact is: standard C++ has no means to access
hardware. You are apparently missing that. How else would you
like me to "point the fact out" to you?

Well, let's try. Fact: standard C++ has no means to access
hardware (parallel port included). "No means" designates the
situation that there are _no_ mechanisms in the _language_ which
would result in a program that performs the actions required.

You have used non-standard elements, provided to you by some
[unrelated] platform (MS-DOS, maybe?). You're now on a different
platform, apparently (Linux). You _got_ to use different, yet
still platform-specific means. All that because the standard
C++ _language_ does not have such means, they are provided by
the platform. And that's what you've been missing.

Platform-specific solutions are discussed in their respective
newsgroups, not here. That you may not have been missing, or,
perhaps you have, that's unclear to me.

And, please don't top-post.

If you need more detailed explanation about the common rules of
this newsgroup, please turn to the Welcome message posted here
periodically by Shiva (also at www.slack.net/~shiva/welcome.txt)
and the FAQ Lite (www.parashift.com/c++-faq-lite/)

"Victor Bazarov" <v.********@com Acast.net> wrote in message
news:zncvb.2568 62$HS4.2314084@ attbi_s01...
"Joseph Suprenant" <la******@yahoo .com> wrote...
I am looking to read a byte or write a byte on the parallel port in linux. I am using red hat 7.3. I tired using this but i couldnt get anywere. {

[non-standard code removed]
}

what am i missing, what else can i do?


You're missing the fact that standard C++ (the subject of this
newsgroup) has no means to "read a byte or write a byte on the
parallel port". You need to use system-specific solutions,
which are discussed in comp.os.linux.d evelopment.* family of
newsgroups.


Jul 22 '05 #4
"Joseph Suprenant" <la******@yahoo .com> wrote in message
news:e2******** ************@tw ister.nyroc.rr. com...
I am missing the fact? Please point the fact out to me, so i won't miss it
next time.


He did point it out. Standard C++ (the topic of this group)
has no notion of 'parallel ports' or any other particular
hardware devices. All i/o is abstracted as 'streams of characters'.

What you're asking is outside the purview of standard C++,
but can indeed be accomplished with platform-specific tools.
But platform-specific issues are not topical in comp.lang.c++
Please see the FAQ:
http://www.parashift.com/c++-faq-lite/

The above facts can be easily deduced by reading the international
standardization document which defines the C++ language
(ISO/IEC 14882). What is not defined in that document is,
by definition, not part of the language. Nothing about
'parallel ports' is mentioned in that document, a copy of
which I have. You can take my word for it, or confirm it
for yourself by getting your own copy, it's only 18 U.S.
dollars for a .PDF format copy, available from www.ansi.org
BTW, please don't top post. Thank you.

-Mike
Jul 22 '05 #5

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

Similar topics

6
7247
by: Novice Experl | last post by:
I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows 2000. How can I do this? What do I need to know? It doesn't look like the standard library (the one under my pillow) has that feature. In addition, I've heard that with newer versions of windows don't let you communicate with the port directly,...
21
2995
by: The Man With The Harmonica | last post by:
Hi All, What kind of commands can I use to control the serial and parallel port of my pc. I want to use my laptop instead of microcontrollers and write my software in ANSI C to be used for control purposes of sensors and other electronic devices. I haven't done any C for a while now so I would assume my knowledge is that of a beginner now.
11
3329
by: karan | last post by:
I would like to know how one can use the parallel port through c/c++.Also, how does one determine what port is installed(EPP/ECP/SSP/PS2)? What is the differnece between these? What are the current sinking/drawing capacities of these ports? If possible, please give examples in C/C++. Thanks I would be grateful if any ebooks/tutorials could be provided at karanmalhotra85@yahoo.com
3
1899
by: AK | last post by:
I'm using a .NET Windows Forms Applications project. I'm using LoadLibrary & GetProcAddress to use a DLL function. This is all done in the main cpp file. I would like to use this DLL function in a .h file. So I code : (Proc2) (0x378, 12)....... (where Proc2 is the function) I get a compiler error : C2065 : 'Proc2' : undeclared identifier. I'm guessing I'm not calling this function properly - how can I fix this problem ? When I write a...
3
9389
by: Danijel Babic | last post by:
Hi! Is there any way to control parallel port from VB.NET. I want to be able to send or read data from parallel port on Windows XP. Some ActiveX or dll, API or anything. Thx!
12
8631
by: david.brown.0 | last post by:
I'm trying to make a Java program access a parallel port. Java's comm API does not provide me with the control I need. I need to be able to write to the data and control pins and read the status pins. Any Java people know a good solution? I'm trying to use JNI and create my own library, but building the library gives me these errors: ld: warning: cannot find entry symbol _start; defaulting to 0000000008048094 ParallelPort.o: In...
3
7277
by: nik | last post by:
hello frinds, last night i am using C prog to get output at my parallel port the following source code is #include<dos.h> #include<conio.h> #include<process.h> void main() { outportb( 0x378,00ff); delay(1000);
6
9320
by: abhi | last post by:
Hello, I want to create a small project which will display scrolling text on LED that will be attached to Parallel port. I want to create this project in C language(possibly in Mingw) on Windows XP. I want to know how can i access(read and write data) on parallel port in XP. I have a program that do the same thing but in its documentation it says that it will not work on Windows XP.
1
2893
by: ssndk123 | last post by:
Hi, Using the UserPort program that changes permissions in XP so that I am able to write directly to the parallel port using assembler.. I'm trying to send out square wave pulses for x number of seconds. I'm able to write and read from the parallel port, but after a few reads and writes it crashes... how many reads and writes before it crashes is not always the same.. sometimes it crashes at the first write or read.. other times it...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.