diff options
Diffstat (limited to '')
-rw-r--r-- | kernel/src/arch/i686/drivers/rtc.c | 13 | ||||
-rw-r--r-- | kernel/src/arch/i686/drivers/vga.c | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/kernel/src/arch/i686/drivers/rtc.c b/kernel/src/arch/i686/drivers/rtc.c index ba69d15..5f21f0a 100644 --- a/kernel/src/arch/i686/drivers/rtc.c +++ b/kernel/src/arch/i686/drivers/rtc.c @@ -1,6 +1,6 @@ #include "time.h" #include <stdint.h> -#include <sys.h> +#include <arch.h> #include <arch/i686/drivers/rtc.h> #include <arch/i686/asm.h> @@ -55,10 +55,9 @@ static void update_localtime(void) { localtime = time; // if tz is UTC, we dont need to do anythin - if (last_timezone == UTC) { - cur_localtime = localtime; - return; - } + if (last_timezone == UTC) return; + + localtime.hour += last_timezone; // check if day rolled over change = localtime.hour < 0 ? -1 : localtime.hour >= 24 ? 1 : 0; @@ -109,8 +108,6 @@ year: localtime.year -= 1900; - cur_localtime = localtime; - } void rtc_update(void) { @@ -137,6 +134,7 @@ void rtc_update(void) { update_localtime(); cur_time = time; + cur_localtime = localtime; } struct Time rtc_utctime(void) { @@ -147,6 +145,7 @@ struct Time rtc_localtime(enum Timezone tz) { if (tz != last_timezone) { last_timezone = tz; update_localtime(); + cur_localtime = localtime; } return cur_localtime; } diff --git a/kernel/src/arch/i686/drivers/vga.c b/kernel/src/arch/i686/drivers/vga.c index a41ce54..dcf6ceb 100644 --- a/kernel/src/arch/i686/drivers/vga.c +++ b/kernel/src/arch/i686/drivers/vga.c @@ -21,7 +21,7 @@ void vgatext_write_buf(const uint16_t *src) { } void vgatext_cur_mov(uint8_t x, uint8_t y) { -; const uint16_t pos = y * VGA_TEXT_W + x; + const uint16_t pos = y * VGA_TEXT_W + x; outb(0x3D4, 0x0F); outb(0x3D5, (uint8_t) (pos & 0xFF)); |