champo / ArqvengerOS

ArqvengerOS is a small operating system that runs a monolothic kernel. It started as a course assignment for ITBA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cache the current time

champo opened this issue · comments

Every time the current time is needed (and this happens several times per disk related system call), the system talks to the RTC and transforms the data it gets into something usable.
A simpler and more efficient approach would be to store the current time in seconds in a variable that is used by the kernel instead of using the RTC directly. Once every few ticks this variable would be updated with the correct time given by the RTC, say 2 o 3 times per second to make sure we're never more than one second of the real system time.