LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   using the printer port (https://www.linuxquestions.org/questions/linux-hardware-18/using-the-printer-port-795321/)

johnh10000 03-14-2010 08:56 AM

using the printer port
 
hi I am try to use the printer port. But, i get this

Code:

===============================================
 Broadcom EJTAG Debrick Utility v1.6r-hugebird
===============================================

Failed to lock /dev/parport0: No such device or address
johnh@tux:~/Ubuntu One/hh$

run from johnh I permission denied sudo-ing I get above.

pixellany 03-14-2010 09:14 AM

Please tell us more about what you are trying to do, including a description of the program you are trying to run.

On my system, lp0 and parport0 are two different nodes--I have no idea fo the significance of this, but--if I try to install a printer--the only thing that shows up is: "Connection: parallel:/dev/lp0" (from the CUPS printer installer)

Have you looked in /dev to see if parport0 is there? (If not, then create it?)

johnh10000 03-14-2010 09:33 AM

Quote:

Originally Posted by pixellany (Post 3897765)
Please tell us more about what you are trying to do, including a description of the program you are trying to run.

I have a bt home hub2, "A" and the only way to flash it is via the printer port. Fisrt time I have need to use a printer port in years!!
Quote:

On my system, lp0 and parport0 are two different nodes--I have no idea fo the significance of this, but--if I try to install a printer--the only thing that shows up is: "Connection: parallel:/dev/lp0" (from the CUPS printer installer)

Have you looked in /dev to see if parport0 is there? (If not, then create it?)
yep got a parport0 in /dev

http://download.modem-help.co.uk/uti...wFile=brjtag.c

it envolves the jtag wire, which uses the printer port to connect to the router

wakaru 05-10-2010 03:13 PM

johnh1000

I am trying to accomplish the same thing. After some research I managed to avoid the error, by issuing the following commands as root.

You should remove the "lp" (lineprinter) module from the kernel with the command:
Code:

rmmod lp
To check if it is really the problem you could issue it like this:
Code:

Code:

#
# lsmod | grep par
parport_pc            30053  1
parport                38409  3 ppdev,lp,parport_pc
# rmmod lp
# lsmod | grep par
parport_pc            30053  0
parport                38409  2 ppdev,parport_pc

If still with problems after that, check that the /dev/parport0 device exists, or otherwise create it (again, as root):

Code:

mknod /dev/parport0 c 99 0
Set permissions

Code:

chmod a+rw /dev/parport0
Nevertheless after all that all I get is a segmentation fault when executing the brjtag program:

Code:

$ sudo ./brjtag -probeonly /window:1F400000

===============================================
Broadcom EJTAG Debrick Utility v1.6r-hugebird
===============================================

Probing bus ... Done

Instruction Length set to 5

CPU running under BIG endian

CPU Chip ID: 00000110001101001000000101111111 (0634817F)
*** Found a Broadcom BCM6348 Rev 1 CPU chip ***

- EJTAG IMPCODE ....... : 00000000100000000000100100000100 (00800904)
- EJTAG Version ....... : 1 or 2.0
- EJTAG DMA Support ... : Yes
- EJTAG Implementation flags: R4k MIPS32

Issuing Processor / Peripheral Reset ... Done
Enabling Memory Writes ... Done
Halting Processor ... <Processor Entered Debug Mode!> ... Done
Segmentation fault

I cannot seem to get pass that point. I believe it is a problem of the brjtag 1.6r version. Now I am after getting the source code for hopefully v1.7 and try the same to find out if it works. So far I have not manage to find it :(

If anybody could help I would very much appreciate it :)

fruttenboel 05-11-2010 04:41 AM

there is an IOPL on the parallel port. You have to request access to ANY port in Linux with a dedicated sys call.

Code:

IOperm:
                pushl          %ebp
        movl    %esp, %ebp                # save EBP and set up new EBP
        movl          8(%ebp), %ebx                # EBX := first port
        movl          12(%ebp), %ecx        # ECX := last port
        subl          %ebx, %ecx                # ECX := ECX - EBX + 1
        incl          %ecx                            # ECX := nr of ports
        jecxz          IOpermError
        movl          16(%ebp), %edx        # EDX := flag
        movl          $101, %eax                # EAX := code for IOperm call
        int          $0x80                            # perform SYSTEM call
        movl          $0001, %eax                # EAX := 0001
        sbbl          $0000, %eax                # IF Error THEN  EAX := 0000
        jmp          IOpermExit
       
IOpermError:
        movl          $0000, %eax

IOpermExit:
        movl          %ebp, %esp
        popl          %ebp
        ret

as I show in http://fruttenboel.verhoeven272.nl/mocka/ioport.html

wakaru 05-11-2010 11:13 AM

fruttenboel;

Thanks very much for the information, however I am no programmer/coder so what you are telling me escapes my understanding.

I visited your site and it talks about this IOport.md module for accesing the LPT port through mocka (modula-2) executables linux.

Do you mind explaining a little more how I can apply the information you kindly provided to my specific problem so I can make use of it and solve my problem?

Thanks very much in advance.

pixellany 05-11-2010 12:24 PM

Quote:

Originally Posted by fruttenboel (Post 3964412)
there is an IOPL on the parallel port. You have to request access to ANY port in Linux with a dedicated sys call.

Code:

IOperm:
                pushl          %ebp
        movl    %esp, %ebp                # save EBP and set up new EBP
        movl          8(%ebp), %ebx                # EBX := first port
        movl          12(%ebp), %ecx        # ECX := last port
        subl          %ebx, %ecx                # ECX := ECX - EBX + 1
        incl          %ecx                            # ECX := nr of ports
        jecxz          IOpermError
        movl          16(%ebp), %edx        # EDX := flag
        movl          $101, %eax                # EAX := code for IOperm call
        int          $0x80                            # perform SYSTEM call
        movl          $0001, %eax                # EAX := 0001
        sbbl          $0000, %eax                # IF Error THEN  EAX := 0000
        jmp          IOpermExit
       
IOpermError:
        movl          $0000, %eax

IOpermExit:
        movl          %ebp, %esp
        popl          %ebp
        ret

as I show in http://fruttenboel.verhoeven272.nl/mocka/ioport.html

The OP is talking about flashing a device (I assume that the operation is analogous to flashing the BIOS). In this context, I fail to see how this assembly code is relevant or could be used.


All times are GMT -5. The time now is 01:10 AM.