From e87e3def47834d28668bc79bf85a8e85d936f555 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Thu, 6 Feb 2020 15:14:21 +0100 Subject: [PATCH] dmesg --- kaleid/kernel/sh/shcmds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kaleid/kernel/sh/shcmds.c b/kaleid/kernel/sh/shcmds.c index ad68bda..af245e2 100644 --- a/kaleid/kernel/sh/shcmds.c +++ b/kaleid/kernel/sh/shcmds.c @@ -108,12 +108,16 @@ error_t CmdDmesg(int argc, char **argv, char *cmdline) size_t N = 0; if (argc == 1) N = 999; - else if (argc == 2) N = atoi(argv[1]); + else if (argc == 2) N = 1 + atoi(argv[1]); else { KernLog("dmesg: no more than one argument\n"); return EINVAL; } + DebugLog("dmesg requested from kernel shell (N=%d)\n", N); + + if (N == 0) return EOK; + BLockBuf(BStdDbg); ptr = (char *)lmax((ulong)BStdDbg->buf,