Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Using Multiple CPU Cores in DOS? (Miscellaneous)

posted by bretjohn(R) Homepage E-mail, Rio Rancho, NM, 13.09.2011, 04:25

> This thing is still not clear to me. Some years ago I wrote mp3 player with
> Covox output on LPT (using scitech mp3 lib) in DJGPP. This program change
> timer speed and install timer ISR for sending decoded samples to LPT port.

Let's do a quick calculation, using my Sony Laptop as an example. We'll assume it's running in RM (without an EMM), so it will take around 15 ms to do a pair of mode switches. Let's say you reprogram the timer interrupt to occur 100 times a second instead of the normal 18.2. Because your program is running in PM but your handler is running in RM, there must be a pair of mode switches, which take 15 ms, and they must occur once every 10 ms. Guess what? The system will crash since this is impossible. Your computer is fast enough to work, but not all computers will be.

> Question is what's the order of calling ISRs in RM and PM and how to do it
> best way to have smooth playback.

If the CPU is in PM, the hardware will call the PM handler. It is up to the PM handler to decide if and when it will call the RM handler. In the case of the timer interrupt, it absolutely SHOULD call the RM handler, which requires a pair of mode switches.

> Maybe it would be best if I allow call RM ISR only say on every 100th tick.

You need to call the original RM handler at the same rate it was called before you messed with it (approximately 18.2 times a second). If you don't, at a minimum the system clock will be incorrect, but you will probably also screw up some TSR's or Device Drivers that depend on the interrupt for timing (which could crash the system).


Complete thread:

Back to the forum
Board view  Mix view
15317 Postings in 1383 Threads, 254 registered users, 14 users online (0 registered, 14 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum