From 13a1395fb7997710f7e46293f753772c8b410efd Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sun, 5 May 2019 18:47:36 +0200 Subject: [PATCH] bug ! --- include/kernel/time.h | 2 +- kaleid/kernel/init/init.c | 15 +++++++++++++-- kaleid/kernel/io/rtc.c | 9 ++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/kernel/time.h b/include/kernel/time.h index fc8fc67..894c5ab 100644 --- a/include/kernel/time.h +++ b/include/kernel/time.h @@ -39,6 +39,6 @@ extern void IoEnableRtc(void); extern void IoPrintRtcTime(void); extern ulong IoGetRtcTicks(void); extern Time_t* IoGetRtcTime(void); -extern char* IoGetRtcTimeChar(void); +extern error_t IoGetRtcTimeChar(char* timeChar); //static char* WeekDays[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index ac8948c..0ac5b29 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -93,9 +93,20 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg) /* i++; */ /* } */ - char * cc = IoGetRtcTimeChar(); + char *cc = ""; + IoGetRtcTimeChar(cc); - KernLog("End at %s\n", cc); + BStdOut->flusher(BStdOut); + KernLog("\nTEST 1:\n"); + KernLog("%s\n", cc); + + BStdOut->flusher(BStdOut); + KernLog("\nTEST 2:\n"); + KernLog("[test] %s\n", cc); + + BStdOut->flusher(BStdOut); + KernLog("\nTEST 3:\n"); + KernLog("[test] %s [fin du test]\n", cc); // End this machine's suffering BStdOut->flusher(BStdOut); diff --git a/kaleid/kernel/io/rtc.c b/kaleid/kernel/io/rtc.c index 04136e5..0b03b39 100644 --- a/kaleid/kernel/io/rtc.c +++ b/kaleid/kernel/io/rtc.c @@ -150,7 +150,7 @@ void RtcHandler(ISRFrame_t *regs) void IoPrintRtcTime(void) { Time_t* RtcTime = IoGetRtcTime(); - KernLog("[RTC Time] %02d/%02d/%04d ; %02d:%02d:%02d\n", + KernLog("[RTC Time] %02d/%02d/%04d ; %02d:%02d:%02d \n\n", RtcTime->day, RtcTime->month, RtcTime->year + RtcTime->century*100, @@ -161,10 +161,9 @@ void IoPrintRtcTime(void) } // FIXME XXX FIXME -char* IoGetRtcTimeChar(void) +error_t IoGetRtcTimeChar(char *timeChar) { - Time_t* RtcTime = IoGetRtcTime(); - char* timeChar = ""; + Time_t *RtcTime = IoGetRtcTime(); sprintf(timeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd", RtcTime->day, RtcTime->month, @@ -173,7 +172,7 @@ char* IoGetRtcTimeChar(void) RtcTime->min, RtcTime->sec ); - return timeChar; + return EOK; } // END OF FIXME XXX FIXME