Page 1 of 1

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

Posted: Mon Jan 31, 2005 12:26 pm
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

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

Posted: Mon Jan 31, 2005 6:36 pm
by mystran
care to enable debug logs in bochs and see what it tells you :)

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

Posted: Tue Feb 01, 2005 3:37 am
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.

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

Posted: Tue Feb 01, 2005 6:01 am
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