Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C and C++

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.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-2008, 03:57 PM
Syx Syx is offline
Newbie
 
Join Date: May 2008
Location: Midlands, UK
Posts: 2
Rep Power: 0
Syx is on a distinguished road
Default Kernel + Segfaults

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-13-2008, 04:23 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Mod
 
Join Date: Jul 2006
Age: 35
Posts: 1,751
Last Blog:
Game software (GURPS)
Rep Power: 24
WingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to all
Default Re: Kernel + Segfaults

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-13-2008, 04:27 PM
Syx Syx is offline
Newbie
 
Join Date: May 2008
Location: Midlands, UK
Posts: 2
Rep Power: 0
Syx is on a distinguished road
Default Re: Kernel + Segfaults

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-14-2008, 11:00 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Mod
 
Join Date: Jul 2006
Age: 35
Posts: 1,751
Last Blog:
Game software (GURPS)
Rep Power: 24
WingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to all
Default Re: Kernel + Segfaults

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 11:31 PM.

Contest Stats

dargueta ........ 93.00000
John ........ 87.50000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads