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
// 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
and bp, bp
jnz .loop2
mov eax, dword ptr ds:[si+8] // Next sector
+
+ pop es
ret
// INT 13h with retry