ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Perhaps the behavior of the device (is this is a CANbus board? Technologics Systems?) is such that writing a byte does not leave the board with the same values in those registers. How about trying some other registers such as a standard parallel port at 0x378? You must run your program with root privileges for ioperm() to work, but it seems that you are already doing this.
--- rod.
Perhaps the behavior of the device (is this is a CANbus board? Technologics Systems?) is such that writing a byte does not leave the board with the same values in those registers. How about trying some other registers such as a standard parallel port at 0x378? You must run your program with root privileges for ioperm() to work, but it seems that you are already doing this.
--- rod.
Hello,
Yes, is a Canbus card, is a TSCAN1 (pc/104)
And yes, I have tried to do it with a different port, for example, baseio=0x1f2 or 0x378, and my program works fine, inb return me correct value.
Now I have a doubt, why output >cat /dev/port | hexdump does not show me ports between 0x110 and 0x1e0???
Can I access as root this ports???
You should have access to all IO ports. If the specified port has no logic to decode a read, it will usually return 0xFF, as the bus floats to a logic high state. It may be courting failure to access all IO ports as you have done, as devices may interpret a read as a signal to do something, and that something may require the cooperation of some code to ensure correct behavior.
My interpretation of the output of hexdump is that whenever it finds a series of ports that return all '00's or all 'FF's, it simply uses the '*' notation to denote 'more of the same...'
It is not necessarily the case that all write registers will return the value written to them by reading from them. Some may have no logic to decode a read, and others may read back entirely different values, with different meanings. It is entirely a matter up to the designer of the part.
Have you tried to access the CANbus with a vendor-supplied driver? What happened?
--- rod.
Well, How can I explain you about vendor driver????
I bought this card in web page vendor because board description say "Driver Linux".
When I read manual of board later, I read "TSCAN1 is support by LinCan ( Ocera )", and problem is that this driver is for 2.4 kernel and not for 2.6. I am using 2.6.24.7-rt20.
Then I said that is a good moment to learn how to develop a driver and I begin to understand LinCan driver.
The first step of this driver is detect the board in four I/O port ranges 0x150, 0x158, 0x160 and 0x168.
if(tscan1_check_presence(remap_io_addr, &jmp)){ CANMSG("No TSCAN1 card found at address 0xlx\n"); return -ENODEV; } } else { DEBUGMSG("Scanning bus for TS-CAN1 boards...\n");
for (i=0; 1;i++) { if(i >= 4) { CANMSG("No TS-CAN1 boards found for slot %d\n", candev->candev_idx); return -ENODEV; }
io_addr = TSCAN1_BASE_IO + i*TSXXX_IO_RANGE; [B]--> Here scanning I/O ports to find card.[/B] remap_io_addr = io_addr = tsxxx_base;
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.