feat: D4 DKM colored log prefixes - every driver has its own temper
- log.c: color context (log_set_color / log_color_enable); ANSI only goes to serial, BOOTLOG.TXT buffer stays clean plain text - kernel_api.c: dkm_log_set_driver() — driver-name FNV-1a hash into an 8-color bright ANSI palette, deterministic per driver - load sites (dkm_core builtin + boot_modules external) set color around driver_init and clear after - FUCK [debug] color_log gate (dev=1, release=0) - QEMU verified: 1150 colored lines, per-driver stable colors (.build_tmp/qemu_serial_d4color.log)
This commit is contained in:
@@ -158,6 +158,8 @@ typedef struct dkm_builtin_driver {
|
||||
} dkm_builtin_driver;
|
||||
|
||||
void dkm_init(void);
|
||||
/* D4: 设置当前驱动日志颜色上下文(driver_init 前设置,返回后清 0) */
|
||||
void dkm_log_set_driver(const char *name);
|
||||
int dkm_load_builtin(const dkm_builtin_driver *driver);
|
||||
void dkm_scan_boot_modules(void);
|
||||
void dsm_load_by_manifest(void);
|
||||
|
||||
@@ -13,6 +13,13 @@ void log_error(const char *msg);
|
||||
void log_hex64(const char *prefix, u64 value);
|
||||
void panic(const char *msg);
|
||||
|
||||
/* D4: DKM 彩色日志——驱动 init 期间的颜色上下文。
|
||||
* log_set_color 传 ANSI CSI(如 "\x1b[36m"),0/"" 恢复默认;
|
||||
* 颜色只走串口,BOOTLOG 缓冲保持纯文本。log_color_enable 总开关
|
||||
* (FUCK [debug] color_log)。 */
|
||||
void log_set_color(const char *ansi);
|
||||
void log_color_enable(int enable);
|
||||
|
||||
/* ---- 内存日志缓冲区(实机启动日志持久化) ----
|
||||
* 由 disk_log_flush() 写入 FAT32 文件 SYSTEM/DESHAB64/DEV/BOOTLOG.TXT。 */
|
||||
void log_capture_enable(int enable);
|
||||
|
||||
Reference in New Issue
Block a user