On Tue, May 14, 2013 at 11:50:37AM -0700, CODENAME FREAK wrote:
> Greetings
>
> It is a very basic question but I would like to know how the CLOCK task is
> started and where is the code located to which the ticks are forwarded ?
> The code that listens to hardware generated ticks is located in
> /kernel/clock.c "int timer_int_handler(void)"
This is exactly where the ticks are handled. Ticks are not forwarded
anywhere. One if a timer expires, the timer code sends a notification
to the process which registered the timer.
> ,and also what is "int
> app_cpu_init_timer(unsigned freq)" and "int boot_cpu_init_timer(unsigned
> freq)" used for ??It might be for initialisation but what is the difference?
One is initialization for the boot CPU and the other is for the
application cpus - the cpus that are started later after boot.
The difference is that if booted on a single CPU, we may or may not
use LAPIC timer. If not, we need to register the handler for the
legacy timer. LAPIC handler is hardwired in the interupt table and used
by all CPUs.