Hi,
Combuster wrote:
tjmonk15 wrote:
How would you log a specific driver accessing a specific port only using an IO Bitmap? (Hint: you can't)
An IOPB comes with system calls to enable individual ports, and it's by any means the fastest implementation.
"IOPL=3" is fastest for each IO port access. IO Permission Bitmap is probably a close second (due to the extra memory fetch).
For the overhead of task switching (which is typically a frequent operation for micro-kernels), IO Permission Bitmap can be the worst/slowest option (e.g. if you copy up to 8 KiB of extra data) or can complex (e.g. if you use tricks to avoid the copy).
Mostly you can give each of the options ratings in several categories:
- Granularity: GPF and syscall tie as winners, "IOPL=3" is worst
- Per IO port access overhead: "IOPL=3" is winner, GPF is worst
- Per task switch overhead: GPF and syscall tie as winners, IOPB is worst
- Flexibility (e.g. IO port remapping): GPF and syscall tie as winners, "IOPL=3" is worst
- Complexity: "IOPL=3" is winner, not sure which is worst (GPF or IOPB)
Combuster wrote:
If all you want to log is which driver uses which ports, then you already have the system call for the diagnostic.
The idea is to log which value is read/written to which IO port (in which order). Did you write the correct value to the device's command port? What did the driver read from the "status" port?
Combuster wrote:
But that's all overdiscussed regardless. Everyone even
capable of having this discussion should just add a print statement to the driver itself and recompile.
Can you give me instructions on how to do this? I have a closed source/proprietary NVidia video card driver (on Windows) that I'd like to reverse engineer, and I'm not even sure where millions of lines of text per second would end up (it's not like device drivers have "stdout" or anything).
Cheers,
Brendan