Search code examples
linuxassemblyparallel-port

how to write/read to parallel port in assembly language(linux)?


how to write/read to parallel port in assembly language(linux)?

my plan is this

connect LEDs to parallel port

from the linux machine(ubuntu 10.10), write to parallel port. so I see lightened LEDs.

the reason why I want to use assembly is, I can understand how things going on.

thanks


Solution

  • Well, assembly is not necessarily the way to understand what is going on. I would say it is the contarary. A user process does not see the real memory or ioports, it only sees what the kernel show him. For example your parallel port is handled by the kernel, so using it involve using system calls. Using assembly won't get you across the kernel barrier.

    I you want to understand what is going on, may be you should ask yourself what you really want to know ? If you don't know what you are looking for, then I suggest starting with a high level approach, and go down :

    • write a C program doing what you want.
    • examine it, strace it, discover how it does syscall !
    • from here you can either do the syscall yourself, or go on the other side of the syscall barrier, in kernel space. But then it is a new story

    If you want to go the other way, ie from bottom to top, understand how a CPU works etc..., I suggest starting with something much simpler, like a PIC board.