Skip to contentSkip to conversation

Log I/O from host Parallel Port?

Qemu-devel Steve Ellenoff 2 participants 4 messages Aug 8, 2006 – Aug 9, 2006

lore
Share & tools
lore
#0 lore raw

Is there any easy way to log all I/O data reads & writes to/from the host parallel port, when using the -parallel /dev/parport0 option?

My host is connected via parallel port to some custom hardware and I'd like to be able to diagnose why the hardware's not working, by seeing the data stream of the port.

Thanks-
Steve

#1 lore raw
Quoted 6 lines · Steve Ellenoff

Is there any easy way to log all I/O data reads & writes to/from the host parallel port, when using the -parallel /dev/parport0 option?

My host is connected via parallel port to some custom hardware and I'd like to be able to diagnose why the hardware's not working, by seeing the data stream of the port.

Near the top of the file "hw/parallel.c", you can find the following line :
//#define DEBUG_PARALLEL

just uncomment it and rebuilt qemu, all parallel I/O will be written to stdout. (or feel free to modify the printf traces)

Signature · 1 line
Vincent
#2 lore raw

Thanks Vincent!

I guess I should have just looked in the parallel.c file.. Not being too familiar with linux, I just assumed the port was forwarded to linux, I didn't realize qemu had to code the transfer of data, and thus could easily log it. Now that I think about it, that's pretty stupid of me to think.. :)

Thanks for setting me in the right direction.
-Steve

Quoted 25 lines

From: Vincent Palatin <[email protected]>
To: "Steve Ellenoff" <[email protected]>
CC: [email protected]
Subject: Re: [Qemu-devel] Log I/O from host Parallel Port?
Date: Tue, 8 Aug 2006 11:54:16 +0200

Quoted 1 line · Steve Ellenoff

Is there any easy way to log all I/O data reads & writes to/from the

host

Quoted 3 lines

parallel port, when using the -parallel /dev/parport0 option?

My host is connected via parallel port to some custom hardware and I'd

like

Quoted 1 line

to be able to diagnose why the hardware's not working, by seeing the

data

Quoted 1 line

stream of the port.

Near the top of the file "hw/parallel.c", you can find the following line :
//#define DEBUG_PARALLEL

just uncomment it and rebuilt qemu, all parallel I/O will be written to stdout. (or feel free to modify the printf traces)

--
Vincent

#3 lore raw

[Qemu-devel] Best way to give qemu time to read from parallel port?

In reply to Vincent Palatin

As a follow up to my previous post - I'm debugging data via the host parallel port to some custom hardware. The OS (which I don't have code for), sets up the RTC for a very fast 0.25ms (4096Hz) time, and runs exclusively off the interrupt geneted, ie all subsequent timing and functions are based off it.

Prior to working with the real host parallel port, I hooked the port calls my self and emulated the custom hardware in qemu. The guest OS works near perfectly.

When the real port is hooked, the guest OS crashes with a stack overflow. When I added printf calls and ran via the emulated port, it also crashed in the same place.

So I realized that it must be that the interrupt is occuring far too often during the port access, which is why it only appeared during the real port access, and when the added printf calls via the software happened to slow down the process a bit.

Does this sound like a reasonable explanaton? I'm assuming the rtc callback that qemu sets up can even interrupt port access calls to linux? Is this true, especially with such a high rate?

If true, the question is, what's the best way to slow down or possible stop the interrupt from occurring while the ports are being read & written to?

My thought was to create a global variable to indicate while the port call is busy, and reference it in the signalalarm handler to eat the interrpupts while it's busy.

Does this sound like the best approach, or am I way off track?

Thanks for all your help!!

-Steve