kernel/ATA: Fix sector number calculation for ATA drives
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6065b63801
commit
66e3d71dbc
@ -503,11 +503,17 @@ namespace ATA
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_identify_data.big_lba) m_is_lba48 = true;
|
||||
u8 buf[8];
|
||||
memcpy(buf, &m_identify_words[100], 8);
|
||||
|
||||
if (m_is_lba48) m_block_count = m_identify_data.sectors_48;
|
||||
else
|
||||
m_block_count = m_identify_data.sectors_28;
|
||||
m_block_count = *reinterpret_cast<u64*>(buf);
|
||||
|
||||
if (!m_block_count)
|
||||
{
|
||||
memcpy(buf, &m_identify_words[60], 4);
|
||||
m_block_count = *reinterpret_cast<u32*>(buf);
|
||||
}
|
||||
else { m_is_lba48 = true; }
|
||||
|
||||
// FIXME: Should we check for CHS?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user