[haiku-bugs] Re: [Haiku] #10880: haiku_loader can hang for minutes when one or more BIOS reported drives are unreadable

  • From: "pdziepak" <trac@xxxxxxxxxxxx>
  • Date: Thu, 29 May 2014 11:16:31 -0000

#10880: haiku_loader can hang for minutes when one or more BIOS reported drives 
are
unreadable
----------------------------------+----------------------------
   Reporter:  MasterM             |      Owner:  jessicah
       Type:  bug                 |     Status:  assigned
   Priority:  high                |  Milestone:  R1/alpha5
  Component:  System/Boot Loader  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:
Has a Patch:  1                   |   Platform:  x86
----------------------------------+----------------------------

Comment (by pdziepak):

 Replying to [comment:7 MasterM]:
 > Replying to [comment:5 pdziepak]:
 > > 1. Why try to read 512 bytes? Wouldn't 1 byte be enough?
 > BIOSDrive::ReadAt uses BIOS interrupt 13h for disk access. You can only
 read a multiple of sector size that way and since there are virtually no
 devices with sector size less than 512 bytes, there is really no
 performance difference when reading anything <=512 bytes.

 `is_drive_readable` doesn't have to care about the implementation of
 `BIOSDrive::ReadAt`. All we need to do is to check whether read from the
 device are successful - 1 byte is enough for that purpose.

 > > 2. Format string, `driveID` is `uint8` not `unsigned`.
 > On most compilers driveID should be promoted to unsigned int
 automatically. Should I add explicit cast there?

 Actually, it is promoted to `int` (assuming `sizeof(int) > 1`), but that
 doesn't really matter. It is a good practice to use `PRI*` macros whenever
 trying to print `[u]int*_t` (well, in this case it would be `B_PRI*` and
 `[u]int*`.

--
Ticket URL: <https://dev.haiku-os.org/ticket/10880#comment:8>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: