Skip to content

Internal Clock

April 28, 2012

A clock is a very useful feature of any operating system, allowing files to be stamped with their creation and modification dates. (Without this utilities such as make wouldn’t work.) I thought this would be difficult to implement, but it turned out to be really easy.

So there is now a clock which reads the time from the CMOS real-time clock on startup and then keeps time via the timer interrupt. Once a day, when midnight rolls over, it will read the RTC again to make sure it is still synchronized. File functions now implement the last modified date and the ls function displays this information. The RTC routine isn;t absolutely bullet-proof, so I’ll improve it in due course.

As part of this I expanded the printf() (and kprintf()) function so that it recognizes the basic formatting flags and minimum width specification.

From → IanOS

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: