internal timing

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
Ferrarius
Member
Member
Posts: 69
Joined: Sun Oct 28, 2007 4:10 pm

internal timing

Post by Ferrarius »

hello,

not so long ago I finished the most basic implementation of my floppy driver, it has not been tested IRL, only in bochs because it misses features like a timer that I have seen present in other drivers. Before testing it on a real system I wanted to add timing (and of course sensing whether or not the read went ok) in the hopes it would work fine on a real system almost on the first try. Now, personally I've decided to use the PIT as a timer system, my floppy driver sets a bit in a byte tested by my memory manager. If the test says the bit is set it will update the timer for the floppy disc driver. If the floppy driver then detects the value of it's timer is equal or above a preset value it will call of the timing and return to the function that called the timer in the first place. Now I was wondering how others have decided to implement timing?
Modular Interface Kernel With a lot of bugs ;)
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: internal timing

Post by Love4Boobies »

A timer? *cough* What FDC drivers did you see?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: internal timing

Post by AJ »

Personally, I would suggest using your scheduler to do this. You could put the floppy driver to sleep for a certain amount of time. If you don't have a driver that works like a process, you may need to investigate callbacks. This is more flexible than the bit-checking method you describe because you are not limited to a certain number of known callbacks before you run out of bits to used as flags.

Cheers,
Adam
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: internal timing

Post by jal »

Love4Boobies wrote:A timer? *cough* What FDC drivers did you see?
How do you handle timing related stuff in your FDC driver then? Or is your system coming to a grinding halt when you access the FDC?


JAL
Ferrarius
Member
Member
Posts: 69
Joined: Sun Oct 28, 2007 4:10 pm

Re: internal timing

Post by Ferrarius »

atm my fdd driver is still basic, and my OS is even more basic. But this particular timer has been designed to allow task switches without interfering with the floppy timer.
Modular Interface Kernel With a lot of bugs ;)
Post Reply