Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

User exception handler in C (Developers)

posted by tkchia Homepage, 24.07.2020, 20:47

Hello RayeR,

> Hi, is it possible/how to install user exception handler in user program in
> DJGPP (DOS) and MinGW (Windows) to catch CPU exception before OS/program
> will crash? Does DJGPP have it's own hander or is it catched by DPMI server
> or other memory manager in v86 mode like JEMM? Is it possible to resume
> from exception and continue normally? Eg. in case of RDMSR of nonexisting

Apparently DJGPP supports the POSIX-ish signal(...) and sigaction(...) interface for catching exceptions such as these --- see http://www.delorie.com/djgpp/doc/libc/libc_724.html . (Myself though, I have only tried using it on Linux, not on DJGPP.)

If it works, a way to use it would be to do a sigsetjmp(...) before doing the RDMSR. Meanwhile you also arrange for your signal handler to do a siglongjmp(...) if it is invoked. The place where the program siglongjmp(...)'s to can then handle the failed RDMSR.

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

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