RE: Address spaces on a i386 - Getting Confused

Richard Gooch (rgooch@atnf.csiro.au)
Tue, 30 Mar 1999 22:23:34 +1000


Paul Sargent writes:
> Ahhhh, so the kernel is always stored at physical address 0x00000000
> onwards, which is constantly mapped in at 0xC0000000 onwards. Therefore you
> can get the physical address by lopping of the 0xC, but only on kernel
> addresses.

Only on stuff returned from kmalloc() and get_free_page(), not for
stuff returned from vmalloc() or ioremap(). The first two return
addresses from the contiguous mapping of main RAM. The latter two
return random virtual addresses.

> So presumably the other option is to allocate kernel memory and then
> pass a pointer to it back to user space. Is that possible?

That's called mmap().

Regards,

Richard....

-
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/