24.12.2012 Views

Chapter 4 - DSpace at Waseda University

Chapter 4 - DSpace at Waseda University

Chapter 4 - DSpace at Waseda University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Chapter</strong> 5<br />

Figure 5.4 shows the interrupt process in the non-preemptive kernel. Unlike the preemptive<br />

kernel, a low priority task keeps running even though high priority task occurs during the<br />

working of low priority task. After the low priority task ends, the kernel runs the high priority<br />

task.<br />

5.3 High Resolution Timer<br />

We already have a timer subsystem (kernel/timers.c), why do we need two timer<br />

subsystems? Normally, the most fine-grained time supported by the timer in Linux kernel is<br />

1ms. However, embedded Linux needs much more fine grained time. Therefore, any system<br />

engineers are trying to integr<strong>at</strong>e high-resolution and high-precision fe<strong>at</strong>ures into the existing<br />

timer framework. However, general Linux timer cannot support accuracy of microseconds.<br />

HRTimer provides microsecond resolution with lower overhead and controls time more el<br />

abor<strong>at</strong>ely than other timer. It is not possible to use HRTimer in every system. To use<br />

HRTimer supported from hardware. The HRTimer system allows a user space program to be<br />

wake up from a timer event with better accuracy, when using the POSIX timer APIs. Without<br />

this system, the best accuracy th<strong>at</strong> can be obtained for timer events is 1 jiffy. This depends on<br />

the setting of HZ in the kernel. In the 2.4 kernel, HZ was set to 100, which means th<strong>at</strong> the<br />

best accuracy you could get on a timer wakeup in user space was 10 milliseconds.<br />

In other to use HRTimer needs as follows:<br />

� Need to verify th<strong>at</strong> the kernel has support for this fe<strong>at</strong>ure for your target<br />

processor (and board).<br />

60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!