Understanding Fault Handlers
Posted: Sun Dec 15, 2024 3:27 am
Hi everyone,
I've entered the magic of interrupts and to test if my IDT works I implemented a division_error handler. Everything works fine but now I have a doubt. Now I have only a kernel, so everything works at RING 0. But in the future, when an userspace program will cause a division_error, how can I know if the division error was generated by the kernel or the userspace program? Because if the kernel generates it, i will panic, but if the fault is produced by the user program its enough to kill the program. I need to take this into account or for now its good like that? Thanks for your help
I've entered the magic of interrupts and to test if my IDT works I implemented a division_error handler. Everything works fine but now I have a doubt. Now I have only a kernel, so everything works at RING 0. But in the future, when an userspace program will cause a division_error, how can I know if the division error was generated by the kernel or the userspace program? Because if the kernel generates it, i will panic, but if the fault is produced by the user program its enough to kill the program. I need to take this into account or for now its good like that? Thanks for your help