Int 70h...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Peter_Vigren

Int 70h...

Post by Peter_Vigren »

Warning! This is a pretty dirty message... You may be lost in it...

I wonder about the behavior of Int 70h... Int 70h is called 1024 times per second... but if you use CLI the calling is stopped until STI is issued...

1 second divided into 1024 is about 1 000 000 (or more correcty, about 976 562,5) nanoseconds...

When you use STI, will Int 70h be called 1 000 000 nanoseconds from the moment you issue STI or will it be called directly?
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re: Int 70h...

Post by df »

1024 times a second? are you sure about that? it does not sound right to me. int 70=irq 8? isnt it standard at 18.2hz roughlty 18 clicks a second... ? i usually reprog mine to 50 or 75hz
-- Stu --
Peter_Vigren

Re: Int 70h...

Post by Peter_Vigren »

1024 times a second? are you sure about that? it does not sound right to me. int 70=irq 8? isnt it standard at 18.2hz roughlty 18 clicks a second... ? i usually reprog mine to 50 or 75hz

Here are what Helppc says:

(about Int 8) - generated 18.2 times per second by the 8253 Programmable Interval Timer (PIT)

(about Int 70, Real Time Clock Interrupt) - called 1024 times per second for periodic and alarm functions
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re: Int 70h...

Post by df »

aaah ok. the RTC makes more sense for that kind of freq.

i have never used the RTC as my ticker. only the PIT...
-- Stu --
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Int 70h...

Post by Neo »

Does anyone here any more info on handling the RTC. I want to know when this is generated and how can it be used to get the time? any realted info would be great.
btw as the RTC is on PIC2 how do i enable and disable it without affecting the other PIC1 or PIC2 IRQ's :-\
Only Human
Therx

Re:Int 70h...

Post by Therx »

I made a tutorial/datasheet on the RTC and CMOS a while ago its at

http://therx.sf.net/osdev/files/cmos.pdf

It has details of enabling different intervals for the timer etc. The most useful I found was the alarm (for alarms ;D) and the update interrupt (1Hz) for updating the clock

Pete
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Int 70h...

Post by Neo »

what about the second question?
Only Human
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Int 70h...

Post by Pype.Clicker »

Neo wrote: what about the second question?
Remember the CLI/STI operates at the CPU. The RTC will go on firing its interrupt request once every 1 millisecond even when the CPU disregards it. So when you 'STI' the cpu when an RTC IRQ was pending, you'll just get the IRQ unblocked and serviced immediately (after any more prioritary interrupt like IRQ0). Then things will get back to normal.

If i try to draw what happens, it should look like

Code: Select all

    RTC x----x----x----x----x----x----x----x----x----x-- ...
    CPU v--(- ---- ---- -)v-v----v----v----v----v----v-- ...

x: emits an IRQ
v: services an IRQ
(: CLI
): STI
-: nothing special
Post Reply