Make sure to restore %ds on return from call16.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 8 Mar 2008 18:04:10 +0000 (13:04 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 8 Mar 2008 18:04:10 +0000 (13:04 -0500)
src/romlayout.S

index 8c83f88949e665f2ff7f03e2f2880cc0248d9a45..1bfb66bf1b368b239c3241a72c650e79246bd485 100644 (file)
@@ -173,11 +173,13 @@ __call16:
         pushfw
         pushl %eax
         movl 0x06(%esp), %eax
-        movl %ecx, 0x1c(%eax)   // Save %ecx
+        movl %ecx, %ss:0x1c(%eax)       // Save %ecx
+        movw %ss, %cx
+        movw %cx, %ds                   // Restore %ds == %ss
         popl %ecx
-        movl %ecx, 0x20(%eax)   // Save %eax
+        movl %ecx, 0x20(%eax)           // Save %eax
         popw %cx
-        movw %cx, 0x28(%eax)    // Save flags
+        movw %cx, 0x28(%eax)            // Save flags
 
         // Store remaining registers
         movw %es, 0x02(%eax)