trap exceptions in user
Quoted 7 lines · Gilles Chanteperdrix
Quoted 5 lines · Gabriele Moabiti
(...)
I consider now ManageCustomExceptions a function that do nothing. (...)
INT 0 (divide error) or 16 (fpu exception)
The system hangs.
Quoted 5 lines
It will not work. It is because you have to handle the exception. Otherwise, when returning to user-space, your programs tries the faulty exception again, triggers the handler, which does nothing, and loops indefinitely...
so the int 1 and 3 are instead signed as traps with the old CS:EIP points past instruction causing exception...
Sorry for the question (I have always done it directly in asm reprogramming customizing the IDT), do I have to change the eip of the pt_regs structure passed to the function?
Thank you,
Gabriele
Scopri il blog di Yahoo! Mail:
Trucchi, novità e scrivi la tua opinione.
http://www.ymailblogit.com/blog
Quoted 11 lines · Gabriele Moabiti
Quoted 9 lines · Gilles Chanteperdrix
Quoted 3 lines · Gabriele Moabiti
(...) I consider now ManageCustomExceptions a function that do nothing. (...) INT 0 (divide error) or 16 (fpu exception) The system hangs.
It will not work. It is because you have to handle the exception. Otherwise, when returning to user-space, your programs tries the faulty exception again, triggers the handler, which does nothing, and loops indefinitely...
Quoted 6 lines
so the int 1 and 3 are instead signed as traps with the old CS:EIP points past instruction causing exception...
Sorry for the question (I have always done it directly in asm reprogramming customizing the IDT), do I have to change the eip of the
pt_regsstructure passed to the function?
Errr no. You probably know better than me the details of exception handling (I trust Linux and/or Xenomai exception handling for my everyday usage), however, if your code contains an instruction which uses FPU, you should enable FPU and let the program retry that instruction, otherwise, if you skip this instruction, you will never know its result.
Signature · 1 line
Gilles.