feat: introduce bootloader-agnostic Boot Contract, add btlist command to list connected Bluetooth devices
This commit is contained in:
@@ -7,21 +7,21 @@
|
||||
using namespace Kt;
|
||||
|
||||
namespace Memory {
|
||||
LargestSection Scan(limine_memmap_response* mmap) {
|
||||
LargestSection Scan(const montauk::boot::MemoryMap& mmap) {
|
||||
LargestSection currentLargestSection{};
|
||||
|
||||
for (size_t i = 0; i < mmap->entry_count; i++) {
|
||||
auto entry = mmap->entries[i];
|
||||
for (size_t i = 0; i < mmap.count; i++) {
|
||||
const auto& entry = mmap.regions[i];
|
||||
|
||||
if (entry->base == 0) {
|
||||
if (entry.base == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry->type == LIMINE_MEMMAP_USABLE) {
|
||||
if (entry->length > currentLargestSection.size) {
|
||||
|
||||
if (entry.kind == montauk::boot::MemoryKind::Usable) {
|
||||
if (entry.length > currentLargestSection.size) {
|
||||
currentLargestSection = {
|
||||
.address = (uint64_t)entry->base,
|
||||
.size = entry->length
|
||||
.address = entry.base,
|
||||
.size = entry.length
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,4 @@ namespace Memory {
|
||||
|
||||
return currentLargestSection;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user