1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

Kernel: Use klog() instead of kprintf()

Also, duplicate data in dbg() and klog() calls were removed.
In addition, leakage of virtual address to kernel log is prevented.
This is done by replacing kprintf() calls to dbg() calls with the
leaked data instead.
Also, other kprintf() calls were replaced with klog().
This commit is contained in:
Liav A 2020-03-01 21:45:39 +02:00 committed by Andreas Kling
parent 19aa53e1f9
commit 0fc60e41dd
53 changed files with 397 additions and 573 deletions

View file

@ -54,11 +54,11 @@ bool GPTPartitionTable::initialize()
auto& header = this->header();
#ifdef GPT_DEBUG
kprintf("GPTPartitionTable::initialize: gpt_signature=%#x%x\n", header.sig[1], header.sig[0]);
klog() << "GPTPartitionTable::initialize: gpt_signature=0x" << String::format("%x", header.sig[1]) << String::format("%x", header.sig[0]);
#endif
if (header.sig[0] != GPT_SIGNATURE && header.sig[1] != GPT_SIGNATURE2) {
kprintf("GPTPartitionTable::initialize: bad GPT signature %#x%x\n", header.sig[1], header.sig[0]);
klog() << "GPTPartitionTable::initialize: bad GPT signature 0x" << String::format("%x", header.sig[1]) << String::format("%x", header.sig[0]);
return false;
}
@ -73,7 +73,7 @@ RefPtr<DiskPartition> GPTPartitionTable::partition(unsigned index)
unsigned lba = header.partition_array_start_lba + (((index - 1) * header.partition_entry_size) / BytesPerSector);
if (header.sig[0] != GPT_SIGNATURE) {
kprintf("GPTPartitionTable::initialize: bad gpt signature - not initalized? %#x\n", header.sig);
klog() << "GPTPartitionTable::initialize: bad gpt signature - not initalized? 0x" << String::format("%x", header.sig);
return nullptr;
}
@ -84,20 +84,20 @@ RefPtr<DiskPartition> GPTPartitionTable::partition(unsigned index)
GPTPartitionEntry& entry = entries[((index - 1) % entries_per_sector)];
#ifdef GPT_DEBUG
kprintf("GPTPartitionTable::partition %d\n", index);
kprintf("GPTPartitionTable - offset = %d%d\n", entry.first_lba[1], entry.first_lba[0]);
klog() << "GPTPartitionTable::partition " << index;
klog() << "GPTPartitionTable - offset = " << entry.first_lba[1] << entry.first_lba[0];
#endif
if (entry.first_lba[0] == 0x00) {
#ifdef GPT_DEBUG
kprintf("GPTPartitionTable::partition: missing partition requested index=%d\n", index);
klog() << "GPTPartitionTable::partition: missing partition requested index=" << index;
#endif
return nullptr;
}
#ifdef GPT_DEBUG
kprintf("GPTPartitionTable::partition: found partition index=%d type=%x-%x-%x-%x\n", index, entry.partition_guid[3], entry.partition_guid[2], entry.partition_guid[1], entry.partition_guid[0]);
klog() << "GPTPartitionTable::partition: found partition index=" << index << " type=" << String::format("%x", entry.partition_guid[3]) << "-" << String::format("%x", entry.partition_guid[2]) << "-" << String::format("%x", entry.partition_guid[1]) << "-" << String::format("%x", entry.partition_guid[0]);
#endif
return DiskPartition::create(m_device, entry.first_lba[0], entry.last_lba[0]);
}