Hello
This is a repost of a note I sent last friday. I didn’t get any
responses, but I think its because I sent it late on a Friday. Sorry if
you have seen it twice.
I still don’t have the parallel port sample working. I made a few changes
though. I used the previous help to setup the symbol search path to the
public servers. I think that partially works. After I did the setup,
windbg created a ntoskrnl.dbg and ntoskrnl.pdb directories in my newly
created win2ksymbols directory. It downloaded a .dbg file and a .pdb
file. Overall, the dir is 2.58MB in size. However, when I hit pause (err
break) on the toolbar, I get this output:
nt!RtlpBreakWithStatusInstruction:
8052a488 cc int 3
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for halaacpi.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for BOOTVID.DLL -
*** ERROR: Module load completed but symbols could not be loaded for
ACPI.sys
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for WMILIB.SYS -
<72 similar lines deleted>
Then when I click the step over key, I get these type of messages: (ive
clicked step over three times)
nt!KeUpdateSystemTime+0x13e:
8053d50e ebb4 jmp nt!KeUpdateSystemTime+0xf4 (8053d4c4)
kd> p
nt!KeUpdateSystemTime+0xf4:
8053d4c4 833d182e548000 cmp dword ptr [nt!KiTickOffset
(80542e18)],0x0
kd> p
nt!KeUpdateSystemTime+0xfb:
8053d4cb 7f1f jg nt!KeUpdateSystemTime+0x11c (8053d4ec)
I was expecting to see C-level source code. This looks like assembly
steps. Is this what I’m going to get with symbols enabled? Does the
symbol dir grow dynamically? ie. pick up new symbols from microsoft’s
site as it needs them?
FWIW, I have this entry in my File->symbol file path:
SRV*h:\win2ksymbols*http://msdl.microsoft.com/download/symbols:;D:\progs\drivers\chap8\driver\i386
So the next problem is that I still can’t set break points on my code
using the source window. Here is how I attempt to do it:
0. Ensure that bios is set for std parallel port, 0x378 and IRQ 7. Ensure
that windows parallel port driver is disabled.
- Stop my pport driver using mmc.
- Rebuild driver on my host computer.
- Copy over resultant .sys file to winnt/system32/drivers directory.
- Start my pport driver using mmc.
- Run user mode test program and watch it hang after doing this code:
printf(“Attempting write to device…\n”);
char outBuffer[20];
for (DWORD i=0; i outBuffer[i] = (char)i;
DWORD outCount = sizeof(outBuffer);
DWORD bW;
status =WriteFile(hDevice, outBuffer, outCount, &bW, NULL);
if (!status) {
printf(“Failed on call to WriteFile - error:
%d\n”,GetLastError() );
return 2;
}
if (outCount == bW) {
printf(“Succeeded in writing %d bytes\n”, outCount);
printf(“OutBuffer was: \n”);
for (i=0; i printf(“%02X “, (UCHAR)outBuffer[i]);
printf(”\n”);
} else {
printf(“Failed to write the correct number of bytes.\n”
“Attempted to write %d bytes, but WriteFile
reported %d bytes.\n”,
outCount, bW);
return 3;
}
The last thing I see from the user mode program before it hangs is:
Attempting write to device…
Here is what I see in my WinDbg output window:
PPORT: DriverEntry Begin Jan 23 2004 17:43:47
PPORT: CreateDevice Begin Jan 23 2004 17:43:47
PPORT: Interrupt 7 converted to kIrql = 8, kAffinity = 1, kVector = 91
PPORT: Interrupt successfully connected
— The stuff above is done prior to starting the
— user mode program.
------------------------------------------------
— The stuff below is what happens as soon as
— I start the user mode program.
PPORT: DispatchCreate Begin Jan 23 2004 17:43:47
PPORT: DispatchWrite Begin Jan 23 2004 17:43:47
PPORT: Write Operation requested (DispatchWrite)
PPORT: StartIo Begin Jan 23 2004 17:43:47
PPORT: Start I/O Operation
PPORT: StartIO: Transmitting first byte of 20
PPORT: TransmitByte Begin Jan 23 2004 17:43:47
PPORT: TransmitByte: Sending 0x00 () to port 378
PPORT: Wrote to Control: 0x03
PPORT: Read From Status: 0x0FF
PPORT: TransmitByte read character: 0x0F0 (?)
PPORT: TransmitByte: generating interrupt.
I can open the driver source file in WinDbg, but I can not place the
cursor on a line in the output and then click on the “insert or remove
breakpoint button.” If I do, I get a large pop-up which says, “Symbol
information for the current line can not be found…” Which doesn’t make
sense since I have the directory containing the .pdb file in the symbol
search directory. Or, do I?
I can do “bp pport!TransmitByte” and then in my source window the
TransmitByte funciton line is highlighted with red background. It will
even stop the debugger when the user code is called. And when I step from
that location, each step lines up a line in my source code. So, I think I
am halfway there to configuring the debugger correctly.
Any help you can give me regarding my debugging symbols problem or why I
am not getting an interrupt is much appreciated. FWIW, there is one
outstanding suggestion which I have not attempted yet. That is, I have
not switched the “ACPI Uniprocessor PC” to standard pc yet.
Thanks in advance,
JD