Is it possible to allocate a page that is “identity mapped?” That is, a
page whose virtual address is the same as its physical address. (Other than
perhaps getting it by random chance) I’m not finding a way in the
documented kernel API, is there an undocumented one? I can see that this
will be a critical point in achieving the blue screen of pong, and I’m
hoping I don’t have to hack the processor’s paging structures myself.
Thanks,
-brian
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> Is it possible to allocate a page that is “identity mapped?” That is, a
page whose virtual address is the same as its physical address.
I can’t offhand think of ANY good reasons you would need to do this. Can
you explain why you think you need this?
ANY system space address is probably NOT going to match the physical
address, as system space addresses are above 0x80000000. If you had > 2GB
of physical memory, then SOME of that memory MIGHT fit into virtual
addresses that didn’t have mappings to other pages. So it seems like it
would have to be a user space address. You potentially could allocate a
chunk of contiguous physical pages, and create a user process that had
everything squished up high in the address space (by setting the EXE load
address). A driver then sometimes would be able to take the allocated
physical memory and map it into the process. There would be no guarantee
the physical address of the allocated pages would be unused in the user
virtual space.
If you need to have a user mode app directly pass physical addresses to a
mapped driver view, you could just have a virtual to physical translation
table on a bunch of locked pages.
Jan
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> Is it possible to allocate a page that is “identity mapped?” That is, a
page whose virtual address is the same as its physical address. (Other than
Doubts that it is possible. And - for what? For exiting to real mode?
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Yeah, I’m interested in making the real mode switch, and since paging
will be turned off, I need a page identity mapped so that the program
counter will still point to my code after the switch. I forgot that kernel
addresses are all high like that. Guess I’m on my own. Thanks anyway.
-brian
----- Original Message -----
From: “Maxim S. Shatskih” To: “NT Developers Interest List” Sent: Sunday, December 23, 2001 6:43 AM Subject: [ntdev] Re: Identity mapped pages
> > Is it possible to allocate a page that is “identity mapped?” That is, a > > page whose virtual address is the same as its physical address. (Other than > > Doubts that it is possible. And - for what? For exiting to real mode? > > Max > > > > — > You are currently subscribed to ntdev as: argus@vt.edu > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
— You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’) To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Actually, I believe you don’t need to turn paging off to go from protected
to real mode. But it’s been a while since I played with it. If you scour the
web for “real mode paging” or something like that, I bet you will find
references and even source code.
Alberto.
-----Original Message-----
From: Argus [mailto:argus@vt.edu]
Sent: Sunday, December 23, 2001 7:58 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Identity mapped pages
Yeah, I’m interested in making the real mode switch, and since paging
will be turned off, I need a page identity mapped so that the program
counter will still point to my code after the switch. I forgot that kernel
addresses are all high like that. Guess I’m on my own. Thanks anyway.
-brian
----- Original Message -----
From: “Maxim S. Shatskih” To: “NT Developers Interest List” Sent: Sunday, December 23, 2001 6:43 AM Subject: [ntdev] Re: Identity mapped pages
> > Is it possible to allocate a page that is “identity mapped?” That is, a > > page whose virtual address is the same as its physical address. (Other than > > Doubts that it is possible. And - for what? For exiting to real mode? > > Max > > > > — > You are currently subscribed to ntdev as: argus@vt.edu > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
— You are currently subscribed to ntdev as: xxxxx@compuware.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
— You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’) To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
I would have thought the CPU would provide some way to atomically set the PC and disable the MMU,
perhaps via some interrupt or exception.
If you are in a process context (ie. PASSIVE_LEVEL), you can map physical memory into user space addresses, pretending that it
is I/O space on some card (look for some DDK function called something around {Io,Mm}Map{IoSpace,???}). If NT prohibits you
from mapping part of its own address space, then boot with MAX_MEM low.
So you’d get some non-paged (contiguous) kernel memory, find the physical address, map it into user space (this is not pagable),
copy a
relocatable program in there, and jump to the user space address. Now you have V == P.
-DH
----- Original Message -----
From: “Argus” To: “NT Developers Interest List” Sent: Sunday, December 23, 2001 7:57 AM Subject: [ntdev] Re: Identity mapped pages
> Yeah, I’m interested in making the real mode switch, and since paging > will be turned off, I need a page identity mapped so that the program > counter will still point to my code after the switch. I forgot that kernel > addresses are all high like that. Guess I’m on my own. Thanks anyway. > > -brian > ----- Original Message ----- > From: “Maxim S. Shatskih” > To: “NT Developers Interest List” > Sent: Sunday, December 23, 2001 6:43 AM > Subject: [ntdev] Re: Identity mapped pages > > > > > Is it possible to allocate a page that is “identity mapped?” That > is, a > > > page whose virtual address is the same as its physical address. (Other > than > > > > Doubts that it is possible. And - for what? For exiting to real mode? > > > > Max > > > > > > > > — > > You are currently subscribed to ntdev as: argus@vt.edu > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com > > > — > You are currently subscribed to ntdev as: xxxxx@syssoftsol.com > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
— You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’) To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com