Re: DOS --> Linux Question

Kai Henningsen (kaih@khms.westfalen.de)
03 Jul 1999 13:54:00 +0200


coec@altu.net.au (Colin Coe) wrote on 02.07.99 in <01ca01bec487$bef1cfa0$0004600a@death>:

> unsigned long dpaddr=0xD000; /* address of dual port RAM */
> <snip, snip>
> rom = (ACL_ROM *) MK_FP((dpaddr >> 4), 0); /* make a far pointer to
> the dual port */

That looks wrong (it produces a pointer of 0d00:0000). It looks like the
first line has a 0 missing, which would make the linear address 0x000d0000
and the segmented address d000:0000 where it is quite probable to actually
find a ROM.

> What would the equivialent be to the above statement in the Linux universe.

Well, dpaddr looks like it's supposed to be the physical address, so you'd
say something like

rom = phys_to_virt(dpaddr); /* map into a virtual address */

BUT see Documentation/IO-mapping.txt if perhaps you need to use readb()
and friends instead.

HOWEVER, if the first line above actually *is* the correct address, then
you're in serious trouble, because that's in the first 64kB of RAM, and
what's there is *completely* different between DOS and Linux.

MfG Kai

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/