Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. What is 'struct file_operations'. Give an example. 2. What are the 4 components in ioctl command ID? 3. Explain 'dev_t' type nd its format.

1. What is 'struct file_operations'. Give an example.

2. What are the 4 components in ioctl command ID?

3. Explain 'dev_t' type nd its format.

4. Where is 'printk' used? What is the use of 'loglevels'?

5. Explain blocking and non blocking operation.

6. What are the different classes of devices? Explain.

7. Write 'Hello World' module.

8. What are up, down functions? Give examples.

9. What are the differences between Kernel modules and Applications?

10. What is LINUX_VERSION_CODE and KERNEL_VERSION?

11. Explain 'mutex' with an example.

12. What is module_param? What is its use?

13. What are the methods for device number allocation?

14. Explain 2 characteristics of policy free drivers.

15. Explain 'oops messages'. Give an example code which generates oops message.

16. Explain User space, Kernel space.

17. Draw a diagram to explain ioctl control flow from user application to HW. How major/minor numbers help in identifying the driver and HW.

18. What is EXPORT_SYMBOL? Where is it used?

19. What is spin lock? what are the 2 values of spin lock?

20. Explain atomic bit operation. Give 2 functions used in atomic bit operations.

What is the output of the following two programs. Are they equivalent. Justify.

for(int i=1; ; i<<1)

{

printf("%d", i^15);

if(i ^ 15 == 0)

break;

printf("%d ", i);

for(int i=1; ; i<<1)

{

printf("%d", i^15);

if((i ^ 15) == 0)

break;

printf("%d ", i);

}

You are given an integer array of very large size, say k. The array is such that the elements are in increasing order until some location and after that all other locations are filled with the integer 32767. For example, if k = 106 , say until 104 , the elements are in increasing order and between 104 + 1 and 106 the array contains 32767 in each location. Assume that 32767 does not appear in 1 to 104 . Your task is to find the very first appearance of 32767 without using k as part of the computation. No statement can make use of the value of k. Let your logic be efficient

You are given 10 boxes, each filled with coins, and an electronic balance. Note that the electronic balance has exactly one weighing plate and if you keep x coins on the plate, the display will tell you the weight of those x coins. The coins are of two types; one weighing 1 gram and the other weighing 1.1 grams. It so happens that out of 10 boxes, exactly one box is such that all coins in it are 1.1 grams and for all other boxes, all coins are 1 gram. What is your logic to find out the 'odd box' (box with 1.1 g coins).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inflation, Unemployment And Capital Malformations

Authors: Bernard Schmitt, Xavier Bradley, Alvaro Cencini

1st Edition

0429767064, 9780429767067

More Books

Students also viewed these Economics questions

Question

1. Build trust and share information with others.

Answered: 1 week ago