I have a PC/104 card that maps 512 bytes into low memory on the ISA bus. In the computers bios the ISA bus is set to the range of 0xd0000-0xdffff. I have tried a number of locations within this range. I am calling the following functions in my code to gain access to the board however when I do a read on the board everything appears as FFh.
Does the board need some kind of initialisation. I hope the board isn`t Plug & Play
I dont know if you cut and paste the code or its really the code you used, but as Rick pointed out, mmap returns a virtual pointer to the address and you need to go through that pointer to access the memory area you mmap to.
I wasn’t using the virtual address to access the board. So that is probably my problem. In the code that Rick posted what is the diference between using ptr[i] as opposed to *(ptr+i). does ptr[i] increment an array of pointers, if so is that what the mmap_device_memory is really returning?
*(ptr+i) and ptr[i] do the same operation. However ptr[i] is better and easier on the eye *(ptr+i) is often miss understood by newbies because if ptr is a pointer to an int and i = 1, you access ptr + 1 byte offset but rather ptr + 4 bytes.
I don’t understand wha you mean by “increment an array of pointers”. There is no array of pointers in Rick’s code. As a matter of fact there is no array , just one pointer pointing to char.