Cavium Networks Interview Question for Software Engineer / Developers


Country: India
Interview Type: Written Test




Comment hidden because of low score. Click to expand.
1
of 1 vote

first segmentation fault :-
if a CPU trying to access memory for which it doesnot have permission or invalid it traps with an exception of page fault and signal SIGSEGV is sent to the process which tries this and default action for SIGSEGV is to kill the process.

for pagefault:

when cpu looking for a page which is not in TLB (temporary look aside buffer)
then a pagefault occurs which means page need to be loaded back in memory.

this is done as follows :
pagefault handler takes care of it ,

it checks if current page is dirty (if date need to be written back to memory using D bit in flags of TLB entry.

1. first find the location of requested page in page table (PTE which is maintained in software )
2. to load that page in TLB (tlb refill occurs depending on archiecture of cpu in MIPS it replaces a random entry and brings requested page.
3. if cahing is needed do that for current page (check if C flsag was set )

return from the handler and execute current instruction.

- rahul August 13, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

correction in first line
if a CPU trying to access memory for which it doesnot have permission or invalid it traps with an exception of segmentation fault not pagefault

- rahul August 13, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

In computing, a segmentation fault (often shortened to segfault) or access violation is a fault raised by hardware with memory protection, notifying an operating system (OS) about a memory access violation; on x86 computers this is a form of general protection fault. The OS kernel will in response usually perform some corrective action, generally passing the fault on to the offending process by sending the process a signal. Processes can in some cases install a custom signal handler, allowing them to recover on their own,[1] but otherwise the OS default signal handler is used, generally causing abnormal termination of the process (a program crash), and sometimes a core dump.

- Priyan October 08, 2014 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More