[ISOBTRT]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 15 Oct 2011 13:42:43 +0000 (13:42 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 15 Oct 2011 13:42:43 +0000 (13:42 +0000)
call it 13h with es set to 0, instead of the transfer buffer segment, that we loaded it with. Fixes KVM boot.

svn path=/trunk/; revision=54145

reactos/boot/freeldr/bootsect/isoboot.S

index 979c35a..5b362ca 100644 (file)
@@ -144,7 +144,11 @@ relocate:
     jc .boot_cdrom          // could not read hdd
 
     push ax
+#ifdef ROS_REGTEST // this change is taken from the original isobtrt.asm
+    mov ax, word ptr ds:[trackbuf+510]
+#else
     mov ax, word ptr ds:[trackbuf]
+#endif
     cmp ax, 0
     je .boot_cdrom // no boot sector found (hopefully there are no weird bootsectors which begin with 0)
     pop ax
@@ -810,10 +814,14 @@ getonesec:
 //    BP    - Sector count
 //
 getlinsec:
+    push es // save es, we reset it later to 0
+
     mov si, offset dapa            // Load up the DAPA
     mov word ptr ds:[si+4], bx
     mov bx, es
     mov word ptr ds:[si+6], bx
+    xor bx, bx // reset es to 0, some bioses (KVM) require that
+    mov es, bx
     mov dword ptr ds:[si+8], eax
 .loop2:
     push bp                // Sectors left
@@ -836,6 +844,8 @@ getlinsec:
     and bp, bp
     jnz .loop2
     mov eax, dword ptr ds:[si+8]            // Next sector
+
+    pop es
     ret
 
     // INT 13h with retry