1.

Solve : Clocks/timers in modern computer?

Answer»

Hi, what are the different clocks and timers in modern standard computer ?Clocks and Timers can be a number of things in computers.

Clocks can be.... Clock Speed such as 700Mhz GPU and 4.2Ghz CPU, FSB 220Mhz of an overclocked system with 10% memory overclock, The clock you see in the corner system tray, internal system clock with date/time, and more

Timers can be... scheduled tasks, scheduled updates, system behavioral parameters to abide by within a specific window of user usage such as a system that when idle crunches scientific data, but doesnt do this during a 8 hour window of user usage. Timing is also critical in video game design and software that requires delay timers to control the rate of execution in a powerful CPU and GPU system so that the games run at a constant speed which works hand in hand with a Real Time Clock function so that say a game that is running on a 800Mhz Pentium III will run at the same speed as a 4.2Ghz system vs 5 times faster game execution to where you are playing a game that runs FINE on a 800Mhz system but it runs 5 time faster on a 4.2Ghz system and the game is then unplayable. (* Early games in the 8088 CPU era had issues like this running on the newer 286 and some 386 systems, and some had a Turbo button that could be used to change the FSB of the system so that for example a 12Mhz 286 could run at 16Mhz with the Turbo button enabled, but when running older games that run too fast, you can shut the Turbo button off and have it run at 12Mhz which is closer to the 4.77Mhz CPU that the game was designed to execute around.)Is this Homework?
The standard PC has timers in  hardware that make it easy to rime things exactly. These  are normally  used only by system PROGRAMS.
It would help if you could clarify your question.He's been in Chat 5 times...and yes...it's homework.Thank you very much for these explanations, they help me to see more specifycally the thing. I talk about clocks and timers as pieces of hardware. I am creating an operating system from scratch in protected mode (X86), then i would like to know what are the different clocks and timers to correctly imagine the plan of this os and all its possibilities.Good Luck with that... Quote from: patio on August 27, 2016, 05:14:55 PM

Good Luck with that...
It will be an uphill struggle.
The modern PC gets an interrupt about 18 times a second. This put a severe limit on the accuracy of timing. Any OS has to  account of this detail.
Quote from: Geek-9pm on August 27, 2016, 07:19:09 PM
It will be an uphill struggle.
The modern PC gets an interrupt about 18 times a second. This put a severe limit on the accuracy of timing. Any OS has to  account of this detail.

What is component doing this interrups about 18 times a second ?Please do some research on your own. This is old information as s part of the fundamental substructure the original PC hardware design.
Quote
INT 08H: Timer Interrupt

 This hardware-generated interrupt (IRQ 0) is executed upon each tick of
 the PC's real-time clock.  The clock ticks every 55ms, or about 18.2 ticks
 per second.

 The ROM-BIOS (default) code for this interrupt updates the clock values at
 0:046c.  It also turns off the diskette drive motors after about 2 seconds
 without read/write activity.  See BIOS Data Area for other variables.

 If you WANT to use this interrupt for custom timer-keyed activities (as
 with a TSR program) you must be sure to include the code that tells the
 system when the interrupt is finished.  The magic sequence is:

          mov     al,20H     ;send End-Of-Interrupt signal
          out     20H,al     ; to the 8259 Interrupt Controller

 Most TSRs let the default code do this.  For instance, when the TSR is
 installed, the original vector is saved in a variable named cs:[old_int8].
 Then the following code is executed on each INT 08H:

         pushf                            ;simulate an INT
         call  dword ptr cs:[old_int8]    ;perform normal timer actions
         cmp   cs:my_var,test_value       ;now do customized stuff
     ... etc. ...
         iret    ;return to interrupted foreground application program

��CPU Exception Interrupt��
  286+ computer execute INT 08H when encountering a Double Exception Error
  (an exception while processing an exception).

See Also: IRQs: Hardware Interrupts
          Timer Ports
          TSR Functions
          ROM-BIOS Functions
          DOS Functions
                                    -*-
http://webpages.charter.net/danrollins/techhelp/0105.HTM
You need to read a book. Or study source code.
https://www.amazon.com/PC-Interrupts-Programmers-Reference-Third/dp/0201577976/ref=pd_sim_14_2?ie=UTF8&psc=1&refRID=J8FZBPTDGK4MMV1G9BGJ


Discussion

No Comment Found