<div dir="ltr">Final diff attached (without the src/stacks.c change, with %d->%u change for sector counts).<div>Bootlog with debug_level 1 attached.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 8:56 PM, Tobias Diedrich <span dir="ltr"><<a href="mailto:tobiasdiedrich@gmail.com" target="_blank">tobiasdiedrich@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I replaced the printf(...) with dprintf(1, ...)  (since a dprintf earlier in the function was working fine).<div><br></div><div>This appears to have fixed the issue (though PCHS seems to be wrong, maybe because sector count is negative when parsed as a signed int). Full log attached.</div><div><br></div><div><span class=""><div>|dfc02000| USB MSC vendor='WD' product='Elements 10B8' rev='1012' type=0 removable=0</div></span><div>\dfc04000/ End thread</div><div>|dfbfd000| USB MSC vendor='Multiple' product='Card  Reader' rev='1.00' type=0 removable=1</div><div>|dfbfd000| Device reports MEDIUM NOT PRESENT</div><div>|dfbfd000| scsi_is_ready returned -1</div><div>|dfbfd000| Unable to configure USB MSC drive.</div><div>|dfbfd000| Unable to configure USB MSC device.</div><div>\dfbfd000/ End thread</div><div>|dfc02000| Waiting for device to detect medium... \dfc03000/ End thread</div><div>|dfc02000| USB MSC blksize=512 sectors=-388003840</div><div>|dfc02000| Registering bootable: USB MSC Drive WD Elements 10B8 1012 (type:2 prio:103 data:f6110)</div><div>\dfc02000/ End thread</div><div>\dfc08000/ End thread</div><div>All threads complete.</div><div>Scan for option roms</div><div><br></div><div>Press ESC for boot menu.</div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 7:58 PM, Kevin O'Connor <span dir="ltr"><<a href="mailto:kevin@koconnor.net" target="_blank">kevin@koconnor.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Wed, Dec 23, 2015 at 07:39:56PM +0100, Tobias Diedrich wrote:<br>
> On Wed, Dec 23, 2015 at 7:10 PM, Kevin O'Connor <<a href="mailto:kevin@koconnor.net" target="_blank">kevin@koconnor.net</a>> wrote:<br>
><br>
> > On Wed, Dec 23, 2015 at 07:02:37PM +0100, Tobias Diedrich wrote:<br>
> > > Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563<br>
> > esp=dfbf3e50<br>
> > ><br>
> > > .text._farcall16 0x9563 : { *(.text._farcall16) }<br>
> > ><br>
> ><br>
> > Can you include the full log?  It looks like the code tried to call a<br>
> > 16bit function while in a "thread", and I need to figure out which<br>
> > thread did that.<br>
><br>
><br>
> From the esp address it looks like it'sin the USB probe for the MSC device<br>
> (full log attached):<br>
> /dfc02000\ Start thread func=dfc135f1<br>
> |dfc02000| set_address 0xdfc0a200<br>
> |dfc02000| config_usb: 0xdfc0a0d0<br>
> |dfc02000| device rev=0210 cls=00 sub=00 proto=00 size=64<br>
> |dfc02000| Searching bootorder for: /pci@i0cf8/usb@12,2/storage@5/*@0/*@0,0<br>
> |dfc02000| Searching bootorder for: /pci@i0cf8/usb@12,2/usb-*@5<br>
> |dfc02000| USB MSC vendor='WD' product='Elements 10B8' rev='1012' type=0<br>
> removable=0<br>
> Wcall16 with invalid stack: eax=dfc02e66 edx=0 func=0x000f91f0 esp=dfc02e54<br>
> ret=0x000f0604<br>
<br>
</div></div>What happens if you apply the patch below?  (If it looks like it is<br>
hanging, give it at least a minute before stopping it.)<br>
<br>
-Kevin<br>
<br>
<br>
--- a/src/hw/blockcmd.c<br>
+++ b/src/hw/blockcmd.c<br>
@@ -168,7 +168,7 @@ scsi_is_ready(struct disk_op_s *op)<br>
<br>
         if (sense.asc == 0x04 && sense.ascq == 0x01 && !in_progress) {<br>
             /* IN PROGRESS OF BECOMING READY */<br>
-            printf("Waiting for device to detect medium... ");<br>
+            //printf("Waiting for device to detect medium... ");<br>
             /* Allow 30 seconds more */<br>
             end = timer_calc(30000);<br>
             in_progress = 1;<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>