🆕 完成了简单的内存管理单元,能分配内存页面

This commit is contained in:
fslongjin
2022-01-28 16:31:40 +08:00
parent 8131264e3f
commit 98e62e1e19
4 changed files with 195 additions and 23 deletions

59
kernel/common/kprint.h Normal file
View File

@ -0,0 +1,59 @@
/**
* @file kprint.h
* @author longjin
* @brief 内核日志打印程序
* @date 2022-01-28
*
* @copyright Copyright (c) 2022 longjin
*
*/
#pragma once
#include "printk.h"
#define kinfo(...) \
do \
{ \
printk("[ INFO ] "); \
printk(__VA_ARGS__); \
printk("\n"); \
} while (0);
#define kdebug(...) \
do \
{ \
printk("[ DEBUG ] "); \
printk(__VA_ARGS__); \
printk("\n"); \
} while (0);
#define kwarn(...) \
do \
{ \
printk("[ "); \
printk_color(YELLOW, BLACK, "WARN"); \
printk(" ] "); \
printk(__VA_ARGS__); \
printk("\n"); \
} while (0);
#define kerror(...) \
do \
{ \
printk("[ "); \
printk_color(RED, BLACK, "ERROR"); \
printk(" ] "); \
printk(__VA_ARGS__); \
printk("\n"); \
} while (0);
#define kterminated(...) \
do \
{ \
printk("[ "); \
printk_color(RED, BLACK, "TERMINATED"); \
printk(" ] "); \
printk(__VA_ARGS__); \
printk("\n"); \
} while (0);