From 18549e81206bb8e3d6c588ba2569bebc7e055c3d Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Tue, 14 May 2019 11:56:42 +0200 Subject: [PATCH] New commands --- kaleid/kernel/ke/rtc.c | 2 +- kaleid/kernel/sh/shcmds.c | 17 ++++++++++++++++- kaleid/libbuf/bprint.c | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/kaleid/kernel/ke/rtc.c b/kaleid/kernel/ke/rtc.c index 4805200..e580563 100644 --- a/kaleid/kernel/ke/rtc.c +++ b/kaleid/kernel/ke/rtc.c @@ -180,7 +180,7 @@ char *KeFormatCurTime(void) { Time_t *RtcTime = KeGetCurTime(); snprintf(TimeFmtBuf, sizeof(TimeFmtBuf), - "%02d/%02d/%02d ; %02d:%02d:%02d", + "%02d/%02d/%04d - %02d:%02d:%02d", RtcTime->day, RtcTime->month, RtcTime->year + RtcTime->century*100, diff --git a/kaleid/kernel/sh/shcmds.c b/kaleid/kernel/sh/shcmds.c index 2d9da7c..3098467 100644 --- a/kaleid/kernel/sh/shcmds.c +++ b/kaleid/kernel/sh/shcmds.c @@ -68,9 +68,24 @@ error_t CmdHelp(int argc, char **argv, char *cmdline) return EOK; } +error_t CmdClear(int argc, char **argv, char *cmdline) +{ + size_t i; + for (i = 0; i < BtVideoInfo.framebufferHeight; i++) + KernLog("\n"); + + return EOK; +} + error_t CmdDate(int argc, char **argv, char *cmdline) { - KernLog("%s\n", KeFormatCurTime()); + KernLog("%.10s\n", KeFormatCurTime()); + return EOK; +} + +error_t CmdTime(int argc, char **argv, char *cmdline) +{ + KernLog("%s\n", &KeFormatCurTime()[13]); return EOK; } diff --git a/kaleid/libbuf/bprint.c b/kaleid/libbuf/bprint.c index bd8c9ac..9283fa1 100644 --- a/kaleid/libbuf/bprint.c +++ b/kaleid/libbuf/bprint.c @@ -268,7 +268,7 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) // For strings, the precision field gives the maximum // amount of characters to be read from the stream // Zero/nonspecified precision means unlimited amount - if (prec == 0) prec = INT_MAX; + if (prec == 0) prec = INT_MAX; for (; *s && prec-- ; s++) { rc = bputc(buf, (uchar)*s);