Qualcomm Interview Question for Software Engineer / Developers






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

Well.. first of all, why would kernel need a floating point operation.
Secondly, if it ever requires, I don't see any hurdles in it specially if those operations are trivial and non-blocking.
Why would interrupt handler get blocked? Its just that it has to handle all possible errors/exceptions including unhandled one, and probably take care to save/restore FPU context.
The best alternative would be using 'software fp operations' through compilers - if one is not sure about restoring FPU state.

Any comments/suggestions anyone?

- Omkar May 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 vote

Hi Hope the below post about ISR is useful

The ISR code does not run in the normal task context. It has no task control block and all ISR's share a single stack. Because of these differences there are restrictions to the type of routines that can be used in the ISR.

ISR's should not invoke functions which may cause ``blocking'' of the caller. For example, semTake. malloc and free cannot be used because they call functions which may cause blocking and thus all creation and deletion functions are forbidden since they use malloc and free. An ISR must not perform I/O through the VxWorks I/O system. A call to a device driver may block the system if the caller needs to wait for the device. However, the VxWorks pipe driver has been designed to permit writes by interrupt service code.

The best way to print out messages from an ISR is to use the function logMsg or other functions provided by the library logLib. ISRs should not use floating point instructions since these registers are not saved on entry to the ISR. If floating point instructions are to be used the registers must be saved using the functions in fppALib. However, floating point operations are time intensive and should be avoided in ISRs.

- Sundar February 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

@ Clear and best reply!!

- vhajela June 23, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I love it too !! thanks

- sumit August 12, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

"all ISR's share a single stack"

I am trying to understand in what cases will there be multiple ISRs active. Is it a case when a lower priority ISR gets interrupted by a higher priority one ?

- abhi_284 January 22, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

You may or may not.
Any floating point operation is much expensive than a fixed point operation.( because it is more complicated to store it & manipulate).

The Many Operating Systems, when it switches from some running-process to run in interrupt context, saves all the registers values(of current running process) and restores them back later but does not save the floating point registers.

So if you perform a FP operation in the interrupt context, you may overwrite the FP registers and in the end restoring wrong FP values to the original process that was running.

- Rajesh Perumal January 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I guess you cannot because, when there is a context switch and if it is a hardware context switch, then only the general purpose registers get stored in the hardware.

I guess the answer is on these lines. Do post your ideas!!

- backbone April 01, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Are you talking about the floating point operator or the printf ?

- abhi_284 January 22, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can't tough FPU in ISR routine on x86 systems.
In x64 you can do that...

- Dhiren May 26, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can put print messages in the interrupt handler to print the struct reg arg and int # for debug purposes.
Usually the kernel doesn't do floating point computation and hence it doesn't save/restore the context of floating point regs (this is about the linux kernel on x86). There can be kernels which might do FP computations and they might need to save/restore FP regs and computations.

- Nandan October 05, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Test - Python reply module

- careerCupPythonChecker April 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interrupt operations only allow non blocking operations;
print statement is a nonblocking operation and floating point computation may not be.

- Anonymous February 07, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

right answer.

- kp August 31, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Well.. first of all, why would kernel need a floating point operation.
Secondly, if it ever requires, I don't see any hurdles in it specially if those operations are trivial and non-blocking.
Why would interrupt handler get blocked? Its just that it has to handle all possible errors/exceptions including unhandled one, and probably take care to save/restore FPU context.
The best alternative would be using 'software fp operations' through compilers - if one is not sure about restoring FPU state.

Any comments/suggestions anyone?

- Omkar May 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Well.. first of all, why would kernel need a floating point operation.
Secondly, if it ever requires, I don't see any hurdles in it specially if those operations are trivial and non-blocking.
Why would interrupt handler get blocked? Its just that it has to handle all possible errors/exceptions including unhandled one, and probably take care to save/restore FPU context.
The best alternative would be using 'software fp operations' through compilers - if one is not sure about restoring FPU state.

Any comments/suggestions anyone?

- Omkar May 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can do anykind of non blocking operation and non recurssive operation in the ISR. But make sure before doing any operation in the ISR, ISR Stack is not used. switch to System mode or Supervisor mode. and perform operations in the corresponding stack.

- Girish K S November 19, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can do anykind of non blocking operation and non recurssive operation in the ISR. But make sure before doing any operation in the ISR, ISR Stack is not used. switch to System mode or Supervisor mode. and perform operations in the corresponding stack.

- Girish K S November 19, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

The interrupt handler can not sleep because it is taking some other process's time. So, printing out message is not allowed in interrupt handler: the print operation might block.

- Bug of Cicero April 17, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Just checking the site's well formedness :)

- Anonymous April 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Just checking the site's well formedness :)

- pythonCheck April 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Ah.. Sorry for those repeated posts... My browser just said some error.. on each of the tries..

- Omkar May 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

which fucking browser you use? can u core dump it please? merci!!

- Anonymous May 22, 2009 | 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