Bona Fide OS Developer
View unanswered posts | View active topics It is currently Sun Feb 25, 2018 4:26 am



Post new topic Reply to topic  [ 3 posts ] 
 problem with the pic 
Author Message

Joined: Wed Feb 10, 2010 6:32 am
Posts: 26
Post problem with the pic
Hi!

I somehow have a strange problem that I' dont understand...

I'm trying to enable the timer.. the code is from brans tutorial
but somehow it raises no interrupt..

in my case freq = 100;

Code:
void init_timer(int32u freq){
    int32u divisor = 1193180 / freq;
    int8u l = (int8u)(divisor & 0xFF);
    int8u h = (int8u)( (divisor>>8));
    outportb(0x43, 0x36);
    outportb(0x40,l);
    outportb(0x40,h);
    kprintf("Timer initialized! Low: %h High: %h Total: %h", l, h, divisor);
}


this is my code....

I also tried:
Code:
    int8u h = (int8u)( (divisor>>8) & 0xFF);


and this is the output:

Timer initialized! Low: 00000037 High: 0000005D Total: 00005D37

so this seems correct...
any ideas?


Thu Mar 11, 2010 11:52 am
Profile

Joined: Tue Jul 06, 2010 11:43 am
Posts: 5
Location: New York, New York USA
Post Re: problem with the pic
Two things,
1. Do you have a working printf function?
2. Did you register a function in the IDT to handle the interrupt? In my case I have a function called timerHandler() that increments a variable called tick.

_________________
There are 10 types of people in the world,
Those who get binary,
And those who don't.
Image


Tue Jul 06, 2010 12:33 pm
Profile YIM WWW

Joined: Wed Feb 10, 2010 6:32 am
Posts: 26
Post Re: problem with the pic
thanks for your answer.
I already got it working, I just forgot to enable interupts after the setup of my own table...

;)

bye
Sharpner


Fri Jul 09, 2010 12:58 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.