From 1e2ed1e89aa66d8134418f913f6a74af3b06013f Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Wed, 27 Nov 2013 19:08:07 -0800 Subject: [PATCH] Add a clock to the VGA warning mostly so it doesn't immediately quit, but also so it's not eating CPU cycles while being useless --- userspace/extra/vga-warning.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/userspace/extra/vga-warning.c b/userspace/extra/vga-warning.c index c8d16daa..246002f4 100644 --- a/userspace/extra/vga-warning.c +++ b/userspace/extra/vga-warning.c @@ -1,4 +1,7 @@ #include +#include +#include +#include #define TERM_WIDTH 80 #define TERM_HEIGHT 25 @@ -30,5 +33,15 @@ int main(int argc, char * argv[]) { print_message(0, "The VGA Terminal is currently deprecated."); print_message(1, "A new VGA terminal will be built in a future update."); - return 0; + struct timeval now; + struct tm * timeinfo; + char buffer[80]; + + while (1) { + gettimeofday(&now, NULL); + timeinfo = localtime((time_t *)&now.tv_sec); + strftime(buffer, 80, "%H:%M:%S", timeinfo); + print_message(4, buffer); + sleep(1); + } }