zoukankan      html  css  js  c++  java
  • Modern Operating System --- Chap 5.5 Clocks

    Clock also called timers are essential to the operation of any multiprogrammed system for

    a variety of reasons. They maintain the time of day and prevent one process from monopolizing

    the CPU, among other things. The clock software can take the form of a device driver, even 

    though a clock is neither a block device, like a disk, nor a character device, like a mouse.

    Two types of clocks are commonly used in computers, and both are different form the clocks

    and watches used by people. The simpler clock  are tied to the 100- or 200-volt power line

    and cause an interrupt on every voltage cycle, at 50 or 60 HZ. These clocks used to donimate,

    but are rare nowadays. The other kind of clock is built out of three components: a crystal

    oscillator, a counter and a holding register. When a piece of quartz crystal is properly cut and

    mounted under tension, it can be made to generate a periodic signal of very great accuracy,

    typically in a range of several hundred of megahertz, depending on the crystal chosen. Using

    electronics, this base signal can be multiplied by a small integer to get frequencies up to 1000MHz

    or even more. At least one such circuit is usually found in any computer, providing a synchronizing

    signal to the computer's various circuits. This signal is fed into the counter to make it count down

    to zero. When the counter gets to zero, it causes a CPU interrupt. Programmable clocks typically

    have several modles of operation. In one-shot model, when the clock is started, it copies the value

    of the holding register into the counter and then decrements the counter at each pulse from crystal.

    When the cpunter gets to zero, it causes an interrupt and steps until it is explicitly started again

    by the software. In square-wave mode, after getting to zero and causing the interrupt, the holding

    register is automatically copied into the counter, and the whole process is repeated again indefinitely.

    These periodic interrupts are called clock ticks.

  • 相关阅读:
    母爱——值得你用一生去回报
    cmd命令介绍
    对即将步入软件行业的师弟师妹们的忠告
    推荐4本c语言宝书
    不用判断语句如if,?:等来实现比较2个数
    javascript 浏览器不同的一个差异
    更新数据的经典代码
    允许 ASP.NET 服务器控件在 Page 中发出客户端脚本块的方法Page.RegisterClientScriptBlock 方法 [C#]
    使用多个表进行查询
    根据按钮的不同的CommandArgument处理每个按钮的单击事件的代码
  • 原文地址:https://www.cnblogs.com/miaoyong/p/4852858.html
Copyright © 2011-2022 走看看