This repository was archived by the owner on Jan 14, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #ifndef _DEBUG_H
2+ #define _DEBUG_H
3+
4+ #define INFO 0
5+ #define WARN 1
6+ #define ERR 2
7+ #define ALL 3
8+
9+ void set_log_level (int level );
10+ void debug (const char * msg , int level );
11+
12+ #endif /* _DEBUG_H */
Original file line number Diff line number Diff line change 99#include <shell/shell_integration.h>
1010#include <util/io.h>
1111#include <util/init_msg.h>
12+ #include <util/debug.h>
1213#include <mem/map.h>
1314#include <mem/manager.h>
1415#include <mem/segment.h>
@@ -38,10 +39,11 @@ void kmain(BOOT_INFO *boot_info) {
3839
3940 console_init ();
4041 console_set_framebuffer (boot_info );
42+ set_log_level (ALL );
4143
4244 gdt_build ();
4345 gdt_install_lgdt ();
44- gdt_install_jump (); // セグメントレジスタの更新も実行
46+ gdt_install_jump ();
4547
4648 printk ("Welcome to Litecore kernel!\n" );
4749 printk (" Version : %s\n" , VERSION );
Original file line number Diff line number Diff line change 1+ #include <util/config.h>
2+ #include <util/console.h>
3+ #include <util/debug.h>
4+
5+ static int current_log_level = INFO ;
6+
7+ /**
8+ * @brief ログレベルを設定
9+ * @param level ログレベル(INFO, WARN, ERR, ALL)
10+ */
11+ void set_log_level (int level ) {
12+ current_log_level = level ;
13+ }
14+
15+ /**
16+ * @brief デバッグメッセージを出力
17+ * @param msg メッセージ
18+ * @param level ログレベル(INFO, WARN, ERR, ALL)
19+ */
20+ void debug (const char * msg , int level ) {
21+ if (current_log_level >= level ) {
22+ printk ("[DEBUG] %s\n" , msg );
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments