stdio: add vsnprintf and change printf to kprintf
This commit is contained in:
parent
05c528f64c
commit
0395b65ad8
21 changed files with 102 additions and 186 deletions
|
|
@ -29,7 +29,7 @@ struct block_device *block_register(char *name, struct block_device_ops *ops, vo
|
|||
block_devices_count++;
|
||||
|
||||
#ifdef KDEBUG
|
||||
printf(LOG_DEBUG "Registered block device %s\n", name);
|
||||
kprintf(LOG_DEBUG "Registered block device %s\n", name);
|
||||
#endif
|
||||
|
||||
return bdev;
|
||||
|
|
|
|||
3
fs/fat32.c
Normal file
3
fs/fat32.c
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#include <kernel/block.h>
|
||||
#include <fs/fat32.h>
|
||||
10
fs/gpt.c
10
fs/gpt.c
|
|
@ -18,22 +18,22 @@ void block_gpt_init(struct block_device *dev)
|
|||
goto free_header;
|
||||
|
||||
if (block_read(dev, header, 1, 1)) {
|
||||
printf(LOG_ERROR "Failed to read GPT header for device %s\n", dev->name);
|
||||
kprintf(LOG_ERROR "Failed to read GPT header for device %s\n", dev->name);
|
||||
goto free_entries;
|
||||
}
|
||||
|
||||
if (header->signature != GPT_HEADER_SIGNATURE) {
|
||||
printf(LOG_ERROR "Invalid GPT header signature for device %s\n", dev->name);
|
||||
kprintf(LOG_ERROR "Invalid GPT header signature for device %s\n", dev->name);
|
||||
goto free_entries;
|
||||
}
|
||||
|
||||
if (header->entry_size != sizeof(struct gpt_entry)) {
|
||||
printf(LOG_ERROR "Invalid GPT entry size for device %s\n", dev->name);
|
||||
kprintf(LOG_ERROR "Invalid GPT entry size for device %s\n", dev->name);
|
||||
goto free_entries;
|
||||
}
|
||||
|
||||
if (block_read(dev, entries, header->lba_first, 1)) {
|
||||
printf(LOG_ERROR "Failed to read GPT entries for device %s\n", dev->name);
|
||||
kprintf(LOG_ERROR "Failed to read GPT entries for device %s\n", dev->name);
|
||||
goto free_entries;
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ void block_gpt_init(struct block_device *dev)
|
|||
dev->gpt_entries_count = header->entry_count;
|
||||
|
||||
#ifdef KDEBUG
|
||||
printf(LOG_DEBUG "GPT header for device %s loaded\n", dev->name);
|
||||
kprintf(LOG_DEBUG "GPT header for device %s loaded\n", dev->name);
|
||||
#endif
|
||||
return; /* Success */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue