Qualcomm Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Phone Interview




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

Obviously, when we are running a program in userspace, we don't have access to the kernel virtual memory addresses. In that situation, the question is moot.

When we are running code in kernel mode, say, as a kernel module or driver, we normally access kernel virtual memory. But if the situation comes where our kernel mode code has to interact with some userspace component, we must be extremely careful that we translate "kernel virtual addresses" to "user virtual addresses" before passing them off, and vice-versa.

- Prite April 30, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Also, kernel memory has a hard stack size limit. So if some computation can be done in an isolated memory space that needs a lot of memory, it can be done in userspace memory.

Oh, and a crash in userspace memory can't take down the entire system so easily.

- Prite April 30, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Nice explaination. Can you please explain how to convert kernel virtual address to user virtual address with a simple example..

Thanks in advance.

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

copy_to_user() copy_from_user() requires user virtual address

- Anonymous November 29, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

explain how to convert kernel virtual address to user virtual address with a simple example..

- DEES May 06, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

explain how to convert kernel virtual address to user virtual address with a simple example..

- DEES May 06, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

All answers above doesn't address why ? : Kernel doesn't map entire physical ram into its address space , so when it wants to use virtual address which is not mapped inside kernel address space it will temparory map those address into special region call pkmap, this time it needs to use user virtual address.

- NCP July 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think they might try to talk about swap. User virtual can swap out while kernel virtual can't. So you can not use user virtual in kernel. But you can use kernel virtual in user as long as the same pages are mapped to user address space.

- Anonymous August 27, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In kernel space, memory allocated from high memory are virtual memories. These memory has to be released at earliest since, it may be needed by other process or drivers. Other than that, any memory allocated at kernel space will be logical memory.

- gmdn November 15, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

kmalloc -> contiguous memory
vmalloc -> non contiguous memory

- Anonymous February 15, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Read this in detail to understand the memory stuff..
kmalloc -> contiguous + logical address
vmalloc -> NON contiguous + virtual address

- Anonymous February 15, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

kmalloc VS. vmalloc?

- Anonymous April 08, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

There are two types of virtual addresses: user mode and kernel mode. All user applications/drivers runs in user virtual address space while the kernel mode drivers and OS runs in kernel mode virtual address space. Kernel mode drivers can access user virtual address but vice versa is not true. However kernel mode drivers accessing user virtual addresses can lead to problem. Whenever user mode app/driver wants to run, a process will be created which will provide user virtual address space. So even if app crashes, it will not affect the while system address space but of kernel mode driver crashes , it can lead to system crash.

- Amit April 20, 2013 | 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