Using Dos for Real Time applications -> CLI (Developers)
> But then I have one more question : is it possible not to restore the
> original vector of an interrupt, without crashing the computer ?
I'm also not an interrupt expert to advice you, here are much experienced users about that. But I think that termination process of your program should be done following:
If there was interrupt enabled before your program with existing ISR, then simply do CLI, restore original vector, STI. I don't see problem why it should crash.
And if interrupt was not enabled and no existed ISR before, then simply reconfigure hardware to disable interrupt and you may leave your vector as is because interrupt will be disabled so nobody want to call this vector.
> So, when the interrupt happens, the computer tries to execute this
> random code, and crash. That's exactly what I observed.
This is probably your case.
This depends on what interrupt are you hooking. AFAIK e.g. serial ports or LPT/ECP has disabled INT generation and there's not installed any ISR by DOS. So it's up to you. But also there may be loaded some TSR which enabled interrupt, so you need to check and save state at the beginning of your program. In case of timer the interrupt is enabled after boot and BIOS and DOS ISRs are chained so you may chain yours ISR or disable/break chain and then restore it. Depends on what do you want.
---
DOS gives me freedom to unlimited HW access.
Complete thread:
- Using Dos for Real Time applications - Damien, 23.12.2012, 18:41 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Using Dos for Real Time applications -> CLI - DOS386, 24.12.2012, 09:39
- Using Dos for Real Time applications -> CLI - RayeR, 24.12.2012, 15:13
- Using Dos for Real Time applications -> CLI - Damien, 26.12.2012, 12:50
- Using Dos for Real Time applications -> CLI - Damien, 27.12.2012, 23:23
- Using Dos for Real Time applications -> CLI - RayeR, 28.12.2012, 01:32
- Using Dos for Real Time applications -> CLI - Damien, 02.01.2013, 13:20
- Using Dos for Real Time applications -> CLI - Laaca, 02.01.2013, 21:02
- Using Dos for Real Time applications -> CLI - RayeR, 02.01.2013, 23:22
- Using Dos for Real Time applications -> CLI - Damien, 05.01.2013, 14:10
- Using Dos for Real Time applications -> CLI - RayeR, 06.01.2013, 21:43
- Using Dos for Real Time applications -> CLI - Damien, 09.01.2013, 13:12
- Using Dos for Real Time applications -> CLI - RayeR, 09.01.2013, 13:52
- Using Dos for Real Time applications -> CLI - Arjay, 09.01.2013, 23:40
- Using Dos for Real Time applications -> CLI - RayeR, 09.01.2013, 13:52
- Using Dos for Real Time applications -> CLI - Damien, 09.01.2013, 13:12
- Using Dos for Real Time applications -> CLI - RayeR, 06.01.2013, 21:43
- Using Dos for Real Time applications -> CLI - Laaca, 02.01.2013, 21:02
- Using Dos for Real Time applications -> CLI - Damien, 02.01.2013, 13:20
- Using Dos for Real Time applications -> CLI - RayeR, 28.12.2012, 01:32
- Using Dos for Real Time applications -> CLI - RayeR, 24.12.2012, 15:13
- Using Dos for Real Time applications -> CLI - DOS386, 24.12.2012, 09:39
Mix view