1 / 5

The RealTek timer-count

The RealTek timer-count. A look at how we could utilize the timekeeping capabilities of our RealTek 8139 network controller. The Timer Count Register. 32-bits. TCTR. 0x48-0x4B. How it works: This register may be read at any time.

joefoster
Download Presentation

The RealTek timer-count

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The RealTek timer-count A look at how we could utilize the timekeeping capabilities of our RealTek 8139 network controller

  2. The Timer Count Register 32-bits TCTR 0x48-0x4B How it works: This register may be read at any time. Its value steadily increments, at a fixed frequency. If any value is written, the register is reset to zero.

  3. The Timer Interrupt Register 32-bits TimerInt 0x54-0x57 How it works: This register may be read or written at any time. Its value is initialized to zero by a reset command. So long as it’s zero, no timer-interrupt is generated. If any nonzero value is written, the ‘timeout’ flag in the Interrupt Status register will be set as soon as the TCTR becomes equal to this TimerInt amount.

  4. Registers IMR and ISR 16-bits Interrupt Mask Register (read/write) (Bit: 1=enabled, 0=masked) T i m e O u t 0x3C-0x3D 14 16-bits Interrupt Status Register (read/only)* (bit: 1=active, 0=inactive) T i m e O u t 0x3E-0x3F 14 Writing ‘1’ to an active bit in IntStatus clears the active condition

  5. In-Class Exercise • Use our ‘nictimer.c’ device-driver, and also our ‘2seconds.cpp’ program (plus your knowledge of arithmetic), to determine how rapidly the nic’s Timer Count Register will be incrementing • Compute the expiration-value you should write to the TimerInt register in order that a task will be awakened by a timer-interrupt after enough time has elapsed for a maximum-size packet to be transmitted

More Related