Linux-kernel mailing list archive 2000-32,: Module mapping to mem/kmem?

# Module mapping to mem/kmem?

Dave Cecil (cecil@ozy.dec.com)
Fri, 11 Aug 2000 16:11:59 +1000

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Sean Harding: "2.4.0-test6 locks up with pcmcia modem in"
- Previous message: Robert Norris: "An oops for your enjoyment"
- Next in thread: Amit S. Kale: "Re: Module mapping to mem/kmem?"
- Reply: Amit S. Kale: "Re: Module mapping to mem/kmem?"

Firstly, please forgive me if the questions I ask are ignorant. I'm on a
steep learning curve at present.

I want to display the value of a variable in my loadable module, but of
course gdb vmlinux /proc/kcore can't do that.

I believe that I should be able to get at that value via /dev/mem or
/dev/kmem, given that I know the address of the variable.

The question is, how do I do that? To reach that goal, using /dev/mem, I
assume I need to determine where my module was loaded into physical
memory. My understanding is that kernel memory is contiguous and is a
simple direct mapping from kernel virtual addresses to the physical
addresses. (I guess there may be a discontinuity between where the kernel
proper is loaded and where modules are loaded though.)

Once I know where it's loaded, I should then be able to use od to dump the
appropriate bytes. eg. If it's loaded at 0x200000 (say) then if I dump the
memory at 0x200000 + <my variable's offset from start of module> then I
should get its value, right?

Is there another, better technique, maybe using kmem?

Any help or pointers are much appreciated.

Thanks,
Dave

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

- Next message: Sean Harding: "2.4.0-test6 locks up with pcmcia modem in"
- Previous message: Robert Norris: "An oops for your enjoyment"
- Next in thread: Amit S. Kale: "Re: Module mapping to mem/kmem?"
- Reply: Amit S. Kale: "Re: Module mapping to mem/kmem?"