|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I apologise to be demanding help for my first post, however I really am in need of some advice with this one! I'm doing some revision for my finals, and I've come across a question I can't seem to figure out the answer for.
What is the effect of a segmentation fault in a kernel program? I thought the answer was that no restrictions were imposed on memory access, and so the program could overwrite the code section of memory, affecting currently executing programs. However a friend of mine suggests that the program will crash when trying to access invalid memory. Can anyone tell me the correct answer? I can't find anything useful via Google, and the lecture notes do not provide the answer either. Whilst it's unlikely that this specific question will be on the exam, it's always best to know! Thank you. ![]() |
| Sponsored Links |
|
|
|
|||||
|
My experience with segmentation faults, in general, is a program crash. I don't know if the kernal would behave differently.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
This is my experience with non-kernel applications also. I guess I could write one and see if my machine crashes, but I'd rather not!
I think perhaps if a program running in the kernel segfaults and crashes, then that will crash the entire system. Am I right in thinking that the kernel has unrestricted memory access? As usually a segfault occurs by trying to access a restricted memory locations such as modifying a constant or similar, so if the kernel has the same memory restrictions on code and data areas of the program memory then a system crash would be the most likely result. Just thinking aloud here, tbh. |
|
|||||
|
You might get a segfault if you attempt to address memory that doesn't exist on the hardware.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|