Internal Clock
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.