damn RTC(8253), initialize timer0 goes wrong, always

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
jcicheng

damn RTC(8253), initialize timer0 goes wrong, always

Post by jcicheng »

damn RTC(8253), initialize timer0 goes wrong, always.
after setup idt, timer0's ISR seem's work, but the simply ISR:
;------------------------------------------------
void vDoTimeIRQ(void)
{
   gulTickers ++;

   if ( !(gulTickers % 100) ){
      kprintf("From start up, This is %d seconds\n", gulTickers/100);
   }
}
;-----------------------------------------------
I'd better show my initial code for timer0:
//////////////////////////////////////////////////////
   movl   $52, %eax
   movl   $67, %edx
   outb %al, %dx
   jmp 1f
1:   jmp 1f
1:
   movl   $64, %edx
   movl   $155, %eax
   outb %al, %dx
   jmp 1f
1:   jmp 1f
1:
   movl   $46, %eax
   outb %al, %dx
   jmp 1f
1:   jmp 1f
/////////////////////////////////////////////////
it's part of code after compile by djgcc, oringnal C code is just some outport function call.
jizz, shall i give a snapshot? shame on me
BTW, all under bochs
mystran

Re:d*mn RTC(8253), initialize timer0 goes wrong, always

Post by mystran »

care to enable debug logs in bochs and see what it tells you :)
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:d*mn RTC(8253), initialize timer0 goes wrong, always

Post by Pype.Clicker »

hem.
- first the RTC is *not* 8253. 8253 is the PIT.
- second, emulators (and Bochs specifically) are well-known not to have realtime behaviours. That means if you try to make BOCHS wait for 1 seconds it could perfectly well wait for 0.01 or 10 seconds depending on the host's speed.

with bochs 2.1.1 you have an option for sync clock. I'm not sure that'll do what you want but you might try it.
jcicheng

Re:d*mn RTC(8253), initialize timer0 goes wrong, always

Post by jcicheng »

oh, yes, i made a mistake! :-)~, that's --|PIT|--.haaaa

pype is right!

found the problem, it's really the problem of bochs, i write file to floppy disk, and boot pc, it works.

thank you all!

best regard. ;D
Post Reply