ProtonOS / Proton

GNU General Public License v2.0
19 stars 6 forks source link

Programmable Interval Timer #12

Closed Astaelan closed 12 years ago

Astaelan commented 12 years ago

A Programmable Interval Timer device abstraction that supports at least 1MS precision callbacks. Must follow the unified device driver model described by issue #4.

Must support the following:

Must provide support for the following system calls:

retep998 commented 12 years ago

Ideally we should get at least 0.1 ms precision. Windows 7 uses exactly 1 ms precision, so we need to at least be better at timing.

Astaelan commented 12 years ago

At 1ghz, 1 instruction takes about 1 nanosecond. 0.1 millisecond = 100 microseconds 1 microsecond = 1000 nanoseconds For 100 microsecond precision, we have approximately 100,000 instructions between interrupts on a 1ghz. On a better 3ghz, approximately 300,000 instructions between interrupts. On a lesser 200mhz, approximately 20,000 instructions between interrupts. This level of granularity is acceptable, but should be carefully tested for approximate cost of the interruption handler.

Astaelan commented 12 years ago

Most of the functionality is now working, support for sleep potentially requires code that will be dealt with later for hardware threading.

Astaelan commented 12 years ago

Postponing sleep and usleep until a later point when threading model can be determined.