Files
banan-os/kernel/kernel/Errors.cpp
Bananymous c07fd265f0 Kernel: Add support for ATA CHS addressing and cleanup code
I thought that I had an PC without LBA support so I implement support
for CHS. Turns out that my ATA device detection was broken and was no
device on that port and initialize data was just garbage.

Now that I added CHS, I guess I should just keep it in :)

Both ATA read and write are now combined into a single function to avoid
code duplication.
2024-11-19 20:39:32 +02:00

41 lines
966 B
C++

#include <BAN/Assert.h>
#include <kernel/Errors.h>
#include <stdint.h>
#include <stddef.h>
namespace Kernel
{
static const char* s_error_strings[] {
"No Error",
"ACPI could not find root SDT header",
"ACPI no such header",
"ACPI root invalid",
"Invalid ext2 filesystem",
"Ext2 filesystem corrupted",
"Ext2 filesystem out of inodes",
"Attempted to access outside of device boundaries",
"Device has invalid GPT header",
"Address mark not found",
"Track zero not found",
"Aborted command",
"Media change request",
"ID not found",
"Media changed",
"Uncorrectable data error",
"Bad Block detected",
"Unsupported ata device",
"Font file too small",
"Unsupported font format",
};
static_assert(sizeof(s_error_strings) / sizeof(*s_error_strings) == (size_t)ErrorCode::Count);
const char* error_string(ErrorCode error)
{
ASSERT((uint32_t)error < (uint32_t)ErrorCode::Count);
return s_error_strings[(uint32_t)error];
}
}