following on from my previous post about testing ndiswrapper with the 64 bit
BCM43xx broadcom wireless driver.
the error doesnt come from read_exports() in load_pe_images that I first
thought. if read_exports() cant find the export data section (entitled .edata
which the broadcom driver doesnt have) it returns a success return value
anyway. I should debug code by testing on the machine rather than just read
the code :-)
load_pe_images() fails from fixup_reloc(). after testing it Ive found two
first fixup_reloc() attempts to find the .reloc section. get_section() is
pointed at the start of the section headers at an address 0x01d0 bytes after
the start of the image file. in fact from a hexdump of the driver file, the
section headers start at 0x1e0. inserting a filler member char fill in the
nt_header structure in pe_linker.h solves this.
second fixup_reloc() attempts to iterate though the sections to locate the
.reloc section header, but the iteration doesnt work. sect_hdr++ doesnt
point to the start of the next section header and the iteration simply points
to the same address (the first section header address which is the .text
section header). Ive had to change it to sect_hdr = (char *)sect_hdr +
sizeof(struct section_header). this seems to work and it finds the .reloc
section header (which is the last section header).
I then come across a kernel general protection error. I am trying to debug this
at the moment the kernel oops indicates it comes from the RVA2VA function.
earlier, I was testing this driver against version 0.12. for convenience, I
commented out the calls to fixup_reloc and fixup_import in load_pe_images().
it would happily load the driver and attempt to initialise the ndis device but
failed at the function pointer miniport->init. however if I do the same with
1.0rc2, it fails at a much earlier stage.
I will update the list as I go along.