Subject: Re: Kernel configuration/Makefile options to support Standard
To: Anand Lalgondar <>
From: Perry E. Metzger <>
List: tech-kern
Date: 12/30/2003 09:41:51
"Anand Lalgondar" <> writes:
> How can a standard library (math, time ...) be included while
> cross-compliling the kernel for evbmips evaluation board.

You don't. Userland libraries are not designed for use in the kernel.

> For example, I would like to use the ctime, mktime, and gmtime in one of
> my RTC driver to calculate the "date and time". The RTC is just a 44-bit
> counter and for every 0x8000 it is 1 sec. To get the number of seconds
> elapsed I would right-shift the 44-bit value by 15 - that would give the
> number of seconds passed. Now from this I should arrive at the "date and
> time" factors. The standard time library supports this functionality. 

If you look at the inittodr/resettodr functions for a few ports,
you'll see that we already have common code to do this sort of thing
that is available. Try "man todr" to learn about some of those routines.

Perry E. Metzger