7i43 not running

  • Mike_Eitel
  • Mike_Eitel's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
16 Jul 2020 18:24 #174874 by Mike_Eitel
Replied by Mike_Eitel on topic 7i43 not running
It is not so simple as I thought.
If found no tool that gave me details so I wrote as small program that shows the content of the IO registers.
You have to compile it first and run it as root!
It gives you a block readout of 8x16 registers:


root@SeeedCNC:/home/cnc/Desktop# ./lptlist 0xE000

Remember: this program must run as root.
Register 0 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . A . B . C . D . E . F
Value of port e000 -> . 01 . 00 . 00 . 88 . 00 . 00 . 00 . 10 . 20 . 20 . 21 . 21 . F0 . 02 . 20 . 01
Value of port e010 -> . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 41 . 10 . 04 . F8 . 00 . 00 . FF . FF
Value of port e020 -> . 01 . 00 . 00 . 88 . 00 . 00 . 00 . 10 . 20 . 20 . 21 . 21 . F0 . 02 . 20 . 01
Value of port e030 -> . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 41 . 10 . 04 . F8 . 00 . 00 . FF . FF
Value of port e040 -> . EF . 10 . 01 . 00 . 00 . 60 . 00 . 00 . F9 . 10 . 01 . 00 . 00 . 60 . 00 . 00
Value of port e050 -> . 5E . 10 . 01 . 00 . 00 . 60 . 00 . 00 . D3 . 10 . 01 . 00 . 00 . 60 . 00 . 00
Value of port e060 -> . 90 . 40 . 15 . 04 . 04 . 04 . 04 . 04 . FF . FF . FF . FF . FF . FF . FF . FF
Value of port e070 -> . 04 . 57 . 1C . FF . FF . FF . FF . FF . FF . FF . FF . FF . FF . FF . FF . FF

Maybe it helps somebody in similar situation:

/*
* Based on simple parallel port output control program for Linux written and copyright by Tomi Engdahl 1998
* (e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.)
*
* Modified by Mike Eitel 2020
* (e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.)
*
* The program reads the register values of guessed PC parallel port (default lpt1 I/O address 0x378).
* The port base address values is given as the command line parameter to the program.
* The number must be in hexadecimal format (0x0000..0xFFF0).
*
* compile with gcc lptlist.c -o lptlist
* copy to usr cp lptlist /usr/sbin/lptlist
* change permission chmod +555 /usr/sbin/lptlist
* run as root !
*/

#include <stdio.h>
#include <stdlib.h>
#include <sys/io.h>

main(int argc, char **argv)
{
int argument; /* value read from commandline */
int base; /* register that is read */
int contend; /* contend of the register */
int f; /* outer loop for 0x10 in line */
int i; /* inner loop for single register */

fprintf(stderr, "\nRemember: this program must run as root.\n\n");
fprintf(stderr, "\n");
fprintf(stderr, "Register 0 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . A . B . C . D . E . F \n");
fprintf(stderr, " | | | | | | | | | | | | | | | |\n\n");

if (argc!=2) /* read how many arguments are given in the commandline */
{
fprintf(stderr, "Error: Wrong number of arguments. This program needs one argument which is number between 0x0000 and 0xFFFF.\n"), exit(1);
fprintf(stderr, "Find the register address via lspci -vv \n"), exit(1);
}
if (sscanf(argv[1],"%i",&argument)!=1) /* check validity of given argument in the commandline */
fprintf(stderr, "Error: Parameter is not a number.\n"), exit(1);
if ((argument<0) || (argument>65535)) /* not in the linux io range */
fprintf(stderr, "Error: Invalid numeric value. The parameter number must be between 0x0000 and 0xFFFF\n"), exit(1);

base = argument ; /* start with the first register */
for ( f=0 ; f < 128; f = f + 16 ) /* read a block of 8x16 registers */
{
fprintf(stderr, "Value of port %x ->", base); /* that is the begin of a 16x register line */

for ( i=0; i<16; ++i) /* start the register block readout */
{
if (ioperm(base,1,1)) /* a crude test if the register is writable */
fprintf(stderr, "Error: Couldn't get the port at %X\n", base), exit(1); /* in case that the port is not accepting */

contend = inb(base); /* reading in the value of the register */
fprintf(stderr, " . %.2X", contend); /* and append one of the 16 values */
++base; /* get the next of the 16 */
}
fprintf(stderr, "\n\n"); /* end of the 8 loop */
};
fprintf(stderr, "\n"); /* make it easier to read */
} /* END */
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds
Powered by Kunena Forum