From: acevest Date: Wed, 24 Nov 2021 14:42:11 +0000 (+0800) Subject: printd暂时先用固定内存 X-Git-Url: http://zhaoyanbai.com/repos/nsupdate.html?a=commitdiff_plain;h=a4a61db4ef62471b76872ce4fc12fe25a2936eea;p=kernel.git printd暂时先用固定内存 --- diff --git a/kernel/printk.c b/kernel/printk.c index ee47a20..77a3a46 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -30,12 +30,11 @@ int printk(const char *fmtstr, ...) { } extern tty_t debug_tty; +char pdbuf[1024]; int printd(const char *fmtstr, ...) { - char *pdbuf = (char *)kmalloc(1024, 0); char *args = (char *)(((char *)&fmtstr) + 4); int size = vsprintf(pdbuf, fmtstr, args); tty_write(&debug_tty, pdbuf, (size_t)size); - kfree(pdbuf); return 0; }