Call to int 1587 shouldn't alter regs->cx.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 10 Mar 2008 03:37:04 +0000 (23:37 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 10 Mar 2008 03:37:04 +0000 (23:37 -0400)
The asm was setting regs->cx to zero - use a temp variable to avoid that.

src/system.c

index 8c595fc1d502f6657867a125fa91476ecb9c1ca3..7c871008576562f0ea6d4a6f497178e9188d47d6 100644 (file)
@@ -152,6 +152,7 @@ handle_1587(struct bregs *regs)
     SET_VAR(ES, *(u8 *)(si+0x28+5), 0x93);     // access
     SET_VAR(ES, *(u16*)(si+0x28+6), 0x0000);   // base 31:24/reserved/limit 19:16
 
+    u16 count = regs->cx;
     asm volatile(
         // Load new descriptor tables
         "lgdtw %%es:0x8(%%si)\n"
@@ -192,7 +193,7 @@ handle_1587(struct bregs *regs)
         // Restore %ds (from %ss)
         "movw %%ss, %%ax\n"
         "movw %%ax, %%ds\n"
-        : "+c"(regs->cx), "+S"(si)
+        : "+c"(count), "+S"(si)
         : : "eax", "di"); // XXX - also clobbers %es
 
     set_a20(prev_a20_enable);