The UNIX clock/timer interrupt


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users The UNIX clock/timer interrupt
# 1  
Old 10-26-2015
The UNIX clock/timer interrupt

The book The Design of the Unix Operating System speaks of a clock or timer that is used in scheduling. The clock generates interrupts that update priority information for processes and preempt processes in a round-robin fashion. It's apparent that this "clock" is not the same thing as the CPU clock, since is only generates 50 to 100 signals every second, as opposed to millions or billions of pulses a second. It's also apparent that it's not the same thing as the mechanism that keeps track of the date - that is to say, the number of seconds since midnight before January 1, 1970. So what exactly is it? Is it a pulse generator? Does it store a value that increments? Is it synced with the CPU clock somehow? How does it work? And how can it be "reset"?
# 2  
Old 10-26-2015
The IBM PC has had a pulse generator/timer from the beginning (which also used to drive the PC speaker.) In the olden days, before LSI, it was its own separate chip attached to the data bus. It was very flexible, but generally configured to generate hardware interrupts at 18ms intervals. This hardware interrupt is an IRQ, pretty much hardwired into the CPU, causing it to stop whatever it's doing and jump to a hardwired location in RAM. The OS can do whatever it pleases with that interrupt by putting code in that location.

The hardware is going to be very different on non-PC architectures but the idea is the same, a pulse generator wired to the CPU.

If you're really curious about historical PC architecture, and have a bent towards electronics, I suggest The 8088 book. The 8088 as much as anything else is responsible for why the PC is the way it is.

Last edited by Corona688; 10-26-2015 at 04:21 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Xt timer call, XtAppAddTimeout, hangs on system clock jump backwards

Hi, I've got an issue which I've been 'google-fu'ing without much luck. We have a legacy program which has been plagued by an issue for a long time and I've been tasked to investigate/fix. The program uses XMotif2.1 (required due to dependency on an old GUI designer) and runs on a RHEL7... (4 Replies)
Discussion started by: altrefrain
4 Replies

2. UNIX for Advanced & Expert Users

Is there any shell command to show which interrupt handler handle which interrupt number?

Hi, all: Is there any shell command to show which interrupt handler handle which interrupt number in the system? li,kunlun (5 Replies)
Discussion started by: liklstar
5 Replies

3. UNIX for Advanced & Expert Users

Interrupt storm detected on "irq 20" throttling interrupt source

I receive the following warning messages on a very new machine which has FreeBSD 8.1 x64 installed on it: Interrupt storm detected on "irq 20" throttling interrupt source It is unclear what this means and what its origins are (motherboard? CPU? RAM?). I can start the desktop and the message is... (4 Replies)
Discussion started by: figaro
4 Replies

4. UNIX for Dummies Questions & Answers

Real time of a clock for every 60 seconds in unix

hi can any one guide me on how to display real time of a clock in unix for every 60 seconds (2 Replies)
Discussion started by: ramnadh_babu
2 Replies

5. Shell Programming and Scripting

Sending an interrupt in a script?

Is it possible to sent a ^C interrupt via the command line? For example if I want to tail a log for 10 minutes at a time, kill the tail and then start it again is there a way to go about that? I would imagine there would be some way to do it by finding and killing the PID, but I'm curious if... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

6. UNIX for Dummies Questions & Answers

Clock in Unix using awk

Hey everyone! Can someone help me, i need to make a program using awk, that displays the current time (hh/mm/ss), i would really apreciate it! Thanks! Alex. (4 Replies)
Discussion started by: alex_omul
4 Replies

7. UNIX for Dummies Questions & Answers

timer interrupt

hello all since a process running in kernel mode cannnot be preempted by any other process what would be the status of Timer interrupt that occurs when the time quantum of a process is elapsed? thanks (2 Replies)
Discussion started by: compbug
2 Replies

8. UNIX for Dummies Questions & Answers

sincronization clock unix with windows server..

hi all... how i can sincronization clock solaris server with windows server....both servers i connected in the same network... thank you.... Best Regards... (4 Replies)
Discussion started by: chanfle
4 Replies

9. UNIX for Dummies Questions & Answers

erase and interrupt keys

This is on our Ultra 5/10 Sparc with Solaris 9. I need to store the following (stty) keys in the .profile and /etc/profile files as shown here. erase "Back Space Key" Interrupt "Ctrl + C" I need the exact syntax/procudure as I have to set these two keys whenever I login to the terminal... (1 Reply)
Discussion started by: chrs0302
1 Replies

10. UNIX for Dummies Questions & Answers

7 segement LCD unix clock

Hi, Anyone ever write a unix clock program that display the clock out in 7 segment LCD style. I tried doing one with case statements: !/usr/bin/ksh clock=`date` case $clock in #This prints out the number 0 0) echo " -" echo "| |" echo echo "| |" echo " -" ;; ... (4 Replies)
Discussion started by: Astudent
4 Replies
Login or Register to Ask a Question