>My plan is this. When there is a change in CR3, dump
>our understanding of the virtualized page tables. Use
>the guest tables to build a new one. We have to cover
>the pages used by the guest for page tables, with some
>kind of page protection, so we can monitor guest access to
>them. So there are 2 sets of tables. One is the actual
>guest memory containing what it thinks are the real
>page tables. And one set we create, which the processor
>actually uses.
>
>For the moment I decided to review the monitor code,
>WRT how all the address spaces work, and then I'll
>generate some diagrams depicting this. This
>will make it easier for people to understand how
>things work. And I like having some graphic representations
>myself. We can toss this into the docs.
Did you look on http://os.inf.tu-dresden.de/~jn4/diplom/memory.html?
I thought about page tables, virtualizing should not be too hard ;)
But while playing with this ideas I got problems with
enhancing the nexus data structure (in nexus.S and monitor.h).
I've added entries for virtual cr3, but plex86 crashes and linux
with it :( The core question: how do I enhance the nexus data
structure with something? Now in monitor.h:
// These fields contain info set by the guest
gdt_info_t guest_gdt_info;
gdt_info_t guest_idt_info;
Bit16u guest_ldt_sel;
Bit16u guest_tss_sel;
descriptor_t guest_ldt_descr;
descriptor_t guest_tss_descr;
int guest_cpl;
Bit32u guest_cr3;
and nexus.S:
__guest_gdt_info: ;.skip 6, 0
__guest_idt_info: ;.skip 6, 0
__guest_ldt_sel: ;.skip 2, 0
__guest_tss_sel: ;.skip 2, 0
__guest_ldt_descr: ;.skip 8, 0
__guest_tss_descr: ;.skip 8, 0
__guest_cpl: ;.skip 4, 0
__guest_cr3: ;.skip 4, 0
What did I forget?
jens