Opened 8 years ago

Closed 6 years ago

#7926 closed bug (fixed)

Device name endianness issue in AHCI mode

Reported by: jonas.kirilla Owned by: marcusoverhagen
Priority: normal Milestone: R1
Component: Drivers/Disk Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


In BootManager, the vendor/model name of the SATA disk appears in the opposite endianness, when having set the BIOS setting "SATA AHCI MODE" : AHCI. (scsi)

When set to IDE, it shows as expected. See screenshots.

Haiku nightly gcc2hybrid hrev42636.

(Additionally the DVD drive appears in BootManager in AHCI/scsi mode, but is filtered out(?) in IDE/atapi mode. I'm guessing the latter is the expected behavior also for AHCI/scsi.)

Attachments (4)

BIOS setting SATA AHCI MODE--AHCI.png (18.0 KB) - added by jonas.kirilla 8 years ago.
BIOS setting SATA AHCI MODE--IDE.png (11.6 KB) - added by jonas.kirilla 8 years ago.
listdev_ide.txt (4.5 KB) - added by jonas.kirilla 8 years ago.
bootmanager.png (24.4 KB) - added by diver 6 years ago.

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by jonas.kirilla

Changed 8 years ago by jonas.kirilla

Changed 8 years ago by jonas.kirilla

Attachment: listdev_ide.txt added

comment:1 Changed 8 years ago by korli

Hi Jonas,

the AHCI bus manager swaps words before returning the inquiry here. You could try to do the same for the scsi bus manager probably here.


comment:2 Changed 7 years ago by dsjonny

I've got the same problem:

Here it is good... (KINGSTON SSM100S264G)

KERN: ahci: ahci_scan_bus, cookie 0x8280aa80
KERN: ahci: AHCIPort::ScsiTestUnitReady port 5
KERN: ahci: AHCIPort::ScsiInquiry port 5
KERN: ahci: lba 1, lba48 1, fUse48BitCommands 1, sectors 125045424, sectors48 125045424, size 64023257088
KERN: ahci: model number: KINGSTON SMS100S264G                    
KERN: ahci: serial number: 50026B721A122935    
KERN: ahci: firmware rev.: S5FAM011
KERN: ahci: trim support: yes
KERN: ahci: sg_memcpy phyAddr 0x6f5314, size 96
KERN: ahci: ahci_get_restrictions, cookie 0x8280aa80
KERN: ahci: AHCIPort::ScsiGetRestrictions port 5: isATAPI 0, noAutoSense 0, maxBlocks 65536


After some lines we got this: (IKGNTSNO S SM01S062G4)

KERN: device 0: /dev/disk/scsi/0/5/0/raw
KERN:   media status:      No error
KERN:   device flags:      2
KERN:   offset:            0
KERN:   size:          KERN:     64023257088 (61057.335 MB)
KERN:   content size:      64023257088
KERN:   block size:        512
KERN:   child count:       3
KERN:   index:             -1
KERN:   status:            0
KERN:   flags:             5
KERN:   volume:            -1
KERN:   disk system:       partitioning_systems/intel/map/v1
KERN:   name:              IKGNTSNO S SM01S062G4
KERN:   content name:      <NULL>
KERN:   type:              <NULL>
KERN:   content type:      Intel Partition Map
KERN:   params:            <NULL>
KERN:   content params:    <NULL>

comment:3 Changed 6 years ago by mmlr

Resolution: fixed
Status: newclosed

Fixed in hrev44924. Note that the SCSI inquiry block is way too small to fit in all of the ATA data. We do the same thing in AHCI as in ATA though, so the resulting string should be the same.

Changed 6 years ago by diver

Attachment: bootmanager.png added

comment:4 Changed 6 years ago by diver

Resolution: fixed
Status: closedreopened

In hrev44930 there is a minor problem with spaces:

comment:5 in reply to:  4 Changed 6 years ago by mmlr

Resolution: fixed
Status: reopenedclosed

Replying to diver:

In hrev44930 there is a minor problem with spaces:

No there really isn't. As mentioned in the commit message, there is just too little space in the SCSI structure to hold the original model name. Hence as much as possible is put in the vendor and product ident fields, these are 8 and 16 bytes respectively. The name that is displayed is a concatenation of these fields with a space. For actual SCSI disks this would be correct, for ATA behind SCSI this is as close as it gets without changing the underlying way the name is retrieved. In any case that'd be an enhancement ticket.

Note: See TracTickets for help on using tickets.