This commit is contained in:
Adrien Bourmault 2019-05-05 18:47:36 +02:00
parent dc91276334
commit 13a1395fb7
3 changed files with 18 additions and 8 deletions

View File

@ -39,6 +39,6 @@ extern void IoEnableRtc(void);
extern void IoPrintRtcTime(void); extern void IoPrintRtcTime(void);
extern ulong IoGetRtcTicks(void); extern ulong IoGetRtcTicks(void);
extern Time_t* IoGetRtcTime(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"}; //static char* WeekDays[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

View File

@ -93,9 +93,20 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
/* i++; */ /* 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 // End this machine's suffering
BStdOut->flusher(BStdOut); BStdOut->flusher(BStdOut);

View File

@ -150,7 +150,7 @@ void RtcHandler(ISRFrame_t *regs)
void IoPrintRtcTime(void) void IoPrintRtcTime(void)
{ {
Time_t* RtcTime = IoGetRtcTime(); 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->day,
RtcTime->month, RtcTime->month,
RtcTime->year + RtcTime->century*100, RtcTime->year + RtcTime->century*100,
@ -161,10 +161,9 @@ void IoPrintRtcTime(void)
} }
// FIXME XXX FIXME // FIXME XXX FIXME
char* IoGetRtcTimeChar(void) error_t IoGetRtcTimeChar(char *timeChar)
{ {
Time_t* RtcTime = IoGetRtcTime(); Time_t *RtcTime = IoGetRtcTime();
char* timeChar = "";
sprintf(timeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd", sprintf(timeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd",
RtcTime->day, RtcTime->day,
RtcTime->month, RtcTime->month,
@ -173,7 +172,7 @@ char* IoGetRtcTimeChar(void)
RtcTime->min, RtcTime->min,
RtcTime->sec RtcTime->sec
); );
return timeChar; return EOK;
} }
// END OF FIXME XXX FIXME // END OF FIXME XXX FIXME