update main #1

Merged
Sinipelto merged 240 commits from Bananymous/banan-os:main into main 2023-11-20 13:20:51 +02:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit e01928d186 - Show all commits

View File

@ -73,6 +73,14 @@ namespace Kernel
select_delay();
}
static bool identify_all_ones(BAN::Span<const uint16_t> identify_data)
{
for (size_t i = 0; i < 256; i++)
if (identify_data[i] != 0xFFFF)
return false;
return true;
}
BAN::ErrorOr<ATABus::DeviceType> ATABus::identify(bool secondary, BAN::Span<uint16_t> buffer)
{
select_device(secondary);
@ -117,6 +125,9 @@ namespace Kernel
ASSERT(buffer.size() >= 256);
read_buffer(ATA_PORT_DATA, buffer.data(), 256);
if (identify_all_ones(buffer))
return BAN::Error::from_errno(ENODEV);
return type;
}

View File

@ -71,7 +71,7 @@ namespace Kernel
while (model_len > 0 && m_model[model_len - 1] == ' ')
model_len--;
dprintln("Initialized disk '{}' {} MB", BAN::StringView(m_model, model_len), total_size() / 1024 / 1024);
dprintln("Initialized disk '{}' {} MiB", BAN::StringView(m_model, model_len), total_size() / 1024 / 1024);
add_disk_cache();