[SeaBIOS] WD elements problem

Kevin O'Connor kevin at koconnor.net
Mon Nov 9 17:50:16 CET 2015


On Mon, Nov 09, 2015 at 02:38:39PM +0000, Wim Vervoorn wrote:
> Hello Kevin,
>  
> I hooked up an external USB 3.0 WD hard drive and found that this wasn't supported by SeaBIOS as this used 4K blocks.
>  

If you don't care about the data on that drive, you could try the
patches below.  (If there is any important data on the drive,
definitely don't try these patches as they could definitely cause
corruption.)

The first patch ignores the block size and continues on assuming a
block size of 512.  The second patch should only be applied after
reverting the first patch - it removes the requirement for 512 byte
blocks.

Neither of these patches is correct, but they could provide additional
information.

Thanks,
-Kevin


Patch 1:

--- a/src/hw/blockcmd.c
+++ b/src/hw/blockcmd.c
@@ -226,7 +226,7 @@ scsi_drive_setup(struct drive_s *drive, const char *s, int prio)
     // READ CAPACITY returns the address of the last block.
     // We do not bother with READ CAPACITY(16) because BIOS does not support
     // 64-bit LBA anyway.
-    drive->blksize = be32_to_cpu(capdata.blksize);
+    drive->blksize = DISK_SECTOR_SIZE;
     if (drive->blksize != DISK_SECTOR_SIZE) {
         dprintf(1, "%s: unsupported block size %d\n", s, drive->blksize);
         return -1;

Patch 2:

--- a/src/hw/blockcmd.c
+++ b/src/hw/blockcmd.c
@@ -227,7 +227,7 @@ scsi_drive_setup(struct drive_s *drive, const char *s, int prio)
     // We do not bother with READ CAPACITY(16) because BIOS does not support
     // 64-bit LBA anyway.
     drive->blksize = be32_to_cpu(capdata.blksize);
-    if (drive->blksize != DISK_SECTOR_SIZE) {
+    if (0) {
         dprintf(1, "%s: unsupported block size %d\n", s, drive->blksize);
         return -1;
     }



More information about the SeaBIOS mailing list