aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-10-27 23:36:59 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-10-27 23:36:59 +0000
commitdd6ee15c37c9cbb387db17f26f4daaf4798556fd (patch)
tree2ab141592e56a5d79aa5f5995c19cfec98f15d92 /vl.c
parent0db634747efe579cc2ac44b05b01f33bcfaeb1df (diff)
fixed idt/gdt relocation bug - added support for Redhat kernels
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@413 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 19343cf6c0..944e759a00 100644
--- a/vl.c
+++ b/vl.c
@@ -3737,10 +3737,13 @@ int main(int argc, char **argv)
params->gdt_table[2] = 0x00cf9a000000ffffLL; /* KERNEL_CS */
params->gdt_table[3] = 0x00cf92000000ffffLL; /* KERNEL_DS */
+ /* for newer kernels (2.6.0) CS/DS are at different addresses */
+ params->gdt_table[12] = 0x00cf9a000000ffffLL; /* KERNEL_CS */
+ params->gdt_table[13] = 0x00cf92000000ffffLL; /* KERNEL_DS */
- env->idt.base = (void *)params->idt_table;
+ env->idt.base = (void *)((uint8_t *)params->idt_table - phys_ram_base);
env->idt.limit = sizeof(params->idt_table) - 1;
- env->gdt.base = (void *)params->gdt_table;
+ env->gdt.base = (void *)((uint8_t *)params->gdt_table - phys_ram_base);
env->gdt.limit = sizeof(params->gdt_table) - 1;
cpu_x86_load_seg_cache(env, R_CS, KERNEL_CS, NULL, 0xffffffff, 0x00cf9a00);