Isolinux 6.03 hangs #15
Comments
This is actually a known issue, but thanks for the nice summary! Now we can track it on GitHub. We haven't got the bandwidth to investigate it, but I'd appreciate any tips on debugging ISOLINUX, e.g. how to make it more verbose so we can get a better idea where it hangs. |
|
http://repo.or.cz/syslinux.git/blob/HEAD:/core/isolinux.asm Here is two debug messages: %ifdef DEBUG_MESSAGES
mov si,offset_msg
call writemsg
call writehex8
call crlf_early
%endif
; Load the rest of the file. However, just in case there
; are still BIOSes with 64K wraparound problems, we have to
; take some extra precautions. Since the normal load
; address (TEXT_START) is *not* 2K-sector-aligned, we round
; the target address upward to a sector boundary,
; and then move the entire thing down as a unit.
MaxLMA equ 384*1024 ; Reasonable limit (384K)
mov bx,((TEXT_START+2*SECTOR_SIZE-1) & ~(SECTOR_SIZE-1)) >> 4
mov bp,[ImageSectors]
push bx ; Load segment address
.more:
push bx ; Segment address
push bp ; Sector count
mov es,bx
mov cx,0xfff
and bx,cx
inc cx
sub cx,bx
shr cx,SECTOR_SHIFT - 4
jnz .notaligned
mov cx,0x10000 >> SECTOR_SHIFT ; Full 64K segment possible
.notaligned:
cmp bp,cx
jbe .ok
mov bp,cx
.ok:
xor bx,bx
push bp
push eax
call getlinsec
pop eax
pop cx
movzx edx,cx
pop bp
pop bx
shl cx,SECTOR_SHIFT - 4
add bx,cx
add eax,edx
sub bp,dx
jnz .more
; Move the image into place, and also verify the
; checksum
pop ax ; Load segment address
mov bx,(TEXT_START + SECTOR_SIZE) >> 4
mov ecx,[ImageDwords]
mov edi,[FirstSecSum] ; First sector checksum
xor si,si
move_verify_image:
.setseg:
mov ds,ax
mov es,bx
.loop:
mov edx,[si]
add edi,edx
dec ecx
mov [es:si],edx
jz .done
add si,4
jnz .loop
add ax,1000h
add bx,1000h
jmp .setseg
.done:
mov ax,cs
mov ds,ax
mov es,ax
; Verify the checksum on the loaded image.
cmp [bi_csum],edi
je integrity_ok
mov si,checkerr_msg
call writemsg
jmp kaboom
integrity_ok:
%ifdef DEBUG_MESSAGES
mov si,allread_msg
call writemsg
%endif
jmp all_read ; Jump to main code |
Thanks a lot! This is a good starting point for anyone who wants to look into the issue. With some patience, one should be able to insert more debug messages and further narrow down the hang. |
For some variants of the OUTS instruction, handle_string_io() fails to determine the correct guest virtual address (GVA) from which to copy data. For example, the long-standing issue where ISOLINUX boots to a hang under HAXM is in fact due to misemulation of the following real-mode instruction (part of rom16.o of SeaBIOS): 26 67 f3 6f rep outsl %es:(%si),(%dx) (Cf. outsw_fl() in src/farptr.h of SeaBIOS source tree. For the record, it is called by ata_atapi_process_op() and eventually by ISOLINUX via the INT 13h AH=42h BIOS interface.) The disassembler treats it as a 32-bit instruction, thus the wrong operand size. But one thing is clear: the instruction overrides the default segment (DS) with ES, so the GVA should be ES:SI. However, the current handle_string_io() logic does not parse the instruction and assumes that the GVA is always DS:SI for OUTS. As a result, it reads the wrong data into the I/O buffer. Fix this bug by utilizing the Guest-Linear Address field of VMCS, which is convenient and is guaranteed to give the correct GVA. + Remove the old hack for INS emulation. It is unclear why it was needed, but it doesn't seem necessary now. Fixes #15.
Finally I spent some time fixing the bug (with #36). It was a small patch, but the debugging indeed required patience :) Now both Ubuntu mini and desktop ISO images can boot to installer GUI with As I said in the commit log, the instruction that led to the hang was actually in real-mode SeaBIOS code. In the ISOLINUX code quoted by @delfer above, First, with TCG:
Then, with HAXM (before patch):
By comparison, the last |
I'm trying to install linux distro under qemu with Intel HAXM acceleration.
Qemu version:
QEMU emulator version 2.10.95 (v2.11.0-rc5-11692-g50cdacc703-dirty)
Intel HAXM version:
v6.2.1
Environment:
Steps to reproduce:
qemu-system-x86_64 -m 4095 -accel hax -cdrom ubuntu-16.04-mini.iso
VM hangs on this screen:
(dash blinks)
The same with:
Possible workaround:
Install OS without
-accel hax
and enable it after installationqemu-system-x86_64 -m 4095 -accel hax -kernel linux -initrd initrd.gz -append vga=788
The text was updated successfully, but these errors were encountered: