Eldd Mock

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 7

1. Which of the following option gives hexcode of executable file in objdump tool?

1. inb(), inw(), inl()


2. outb(), outw(), outl()
3. outb_p(), inb_p()
4. All of the above
5. None of the above (Answer)

2. Which of the following is not member of struct file_operation{}?


Answers
1. fopen()
2. fread()
3. remove()
4. All of the above (answer)
5. None of the above

3. The modprobe tool can not remove multiple modules together.


Answers
1. False
2. True (answer)

4. Which of the following low level functions are not used to access the device?
Answers
1. inb(), inw(), inl()
2. outb(), outw(), outl()
3. outb_p(), inb_p()
4. All of the above
5. None of the above (answer)

5. While configuring the kernel, which option is set to build as module?


Answers
1. m (answer)
2. M
3. y
4. n

6. The following command is


make -j8 -j4 bzImage
Answers
1. Valid
2. Invalid (answer)

7. Kernel log messages are stored in _________.


Answers
1. /var/messeges
2. /var/log/msg
3. /var/log/messages--A
4. None of the above

8. In dev_t major number is of _____ bits.


Answers
1. 20
2. 12--A
3. 19
4. None of the above

9. The kernel buffer size of pipe is


Answers
1. 4k to 64k--A
2. 10k to 50k
3. 8k to 32k
4. none of the above

10. inb(), inw(), inl() are used to access devices.


Answers
1. True--A
2. False
-----------------------------------------------------------------------------------
-----------------------------
1. which one of the following is not system V IPC?
Answers
1. Shared Memory
2. Message Queues
3. FIFO--A
4. Semaphores

2. Which of the following verifies that user space buffer can be read/write in
kernel space code?
Answers
1. copy_from_user()
2. copy_to_user()
3. access_ok()--A
4. None of these

3. what is not true for private_data?


Answers
1. private_data is void pointer in struct inode.
2. private_data is void pointer in struct file.--A
3. private_data keeps driver specific information.
4. private_data must be initialized in open() operation to make driver functioning.

4. How can you view the used IRQs on a system?


Answers
1. cat /etc/interrupts
2. cat /proc/irq
3. cat /proc/interrupts--A
4. echo 1 > /proc/interrupts

5. The first argument of printk() indicates


Answers
1. message suffixed by priority string
2. message prefixed by priority string--A
3. type of kernel message logger
4. None of the above

6. why we cann't use C standard library function in kernel module?


Answers
1. kernel modules are dynamically linked during insmod.--A
2. kernel modules are statically linked during insmod.
3. kernel modules are dynamically linked during module builds.
4. kernel modules are statically linked during module builds.

7. what is use of container_of() macro?


Answers
1. Used to access struct member from given address of struct variable.
2. Used to access struct variable from given address of structure member.--A
3. Used to access container process in which given thread is running.
4. None of the above
8. An interrupt handler can be registered by using the function
Answers
1. request _irq--A
2. request_region
3. request_mem_region
4. request_irq_region

9. All the details about the module like author, version etc can be viewed by using
utility
Answers
1. lsmod
2. modprobe
3. dmesg
4. modinfo--A

10. which function is used to allocated memory for buffer of the USB.
Answers
1. usb_alloc_buffer()
2. usb_buffer_alloc()--A
3. usb_alloc()
4. usb_alloc_urb()

11. which of the following is externel tool for debugging?


Answers
1. Probe
2. LTI
3. Kgdb--A
4. None of the above

12. which of the following registers cdev with kernel?


1. cdev_init()
2. cdev_add()--A
3. cdev_del()
4. None of the above

13. which macro is used to add kernel module functions to kernel symbol table?
select one:
Answers
1. MODULE_EXPORT()
2. EXPORT_SYMBOL()--A
3. EXPORT_KERNEL()
4. EXPORT_FUNCTION()

14. "kernel is tained" message will be produced when the module is inserted
without____________
Answers
1. MODULE_LICENSE--A
2. MODULE_AUTHOR
3. MODULE_VERSION
4. MODULE_DESCRIPTION

15. In the device driver model the device_driver object contains the
Answers
1. name of the device driver
2. embedded kobjects
3. method for probing a device
4. all of the mentioned--A

16. Choose the incorrect statement


Answers
1. ioctl is a common interface used for device control
2. The implementation of ioctl is mostly done using a switch statement based on
the command number
3. The macro _IOR(type,nr,datatype) can be used to setup a ioctl command number
with no arguments--A
4. The ioctl funtion has the format long ioctl(structure file *flip, unsigned int
cmd, unsigned long arg)

17. All I/O memory allocations are listed in


Answers
1. /proc/iomem--A
2. /proc/ioports
3. /proc/meminfo
4. /proc/mem

18. which of the following function is use to wake up a task from wait queue in
case of spinlock?
Answers
1. wake_up(&wq)
2. wake_up_interruptible--A
3. wake_spinlock(&wq)
4. none of the above

19. ___________ is used to add a character device to a system


Answers
1. cdevAdd()
2. cdevc_add()
3. cdev_add()--A
4. add_cdev()

20. The function which is used to allocate and initialize a character device
Answers
1. int register_chrdev_region();--A
2. void chdev_init();
3. int unregister_chrdev_region();
4. int register_chrdev();

21. Which of the following should be avoided in the interrupt handlers?


Answers
1. calling wait_event/allocating memory
2. calling scheduler
3. locking a semaphore
4. all of the above--A

22. EXPORT_SYMBOL is used for


Answers
1. export symbols to other modules--A
2. export symbols and hide it from other modules
3. get symbols from other modules

23. To send the external command to a device _______ operation is used.


Answers
1. send file
2. ioctl--A
3. send page
4. none of the above

24. In a module if its license is not explicitly specified its default license
would be
Answers
1. GPL--A
2. GPLV2
3. Dual BSD/GPL
4. Proprietary

25. The devices that can host a filesystem


Answers
1. character device
2. block devices--A
3. network interfaces
4. none of the above

26. which of the following bottom half mechanism can sleep or can be scheduled?
Answers
1. softirq
2. tasklet
3. work queue--A
4. None of the above

27. Which of the following functions is used for I/O port allocation?
Answers
1. request_region();--A
2. check_region();
3. register_io_region();
4. alloc_io_region();

28. In which method of a character driver should the functions 'cdev_init' and
'cdev_add' be called? Choose the most appropriate answer?
Answers
1. module init function and module open function respectively
2. both in module init function--A
3. both in open function
4. none of the above

29. The loglevel strings in printk are defined in the header file
Answers
1. <linux/module.h>
2. <linux/init.h>
3. <linux/kernel.h>--A
4. <linux/fs.h>

30. Select correct option


i. cdev_add() create a device node under /dev
ii. cdev_init() associates major and minor numbers with device file
iii. cdev_add() make device entry in sysfs
Answers
1. only i is correct
2. i and ii is correct
3. i and iii is correct--A
4. All are correct

31. kfifo_free() is used to ____________.


Answers
1. Release statically allocated fifo
2. Release dynamically allocated fifo--A
3. Both of the above
4. None of the above
32. If we use a driver for various device files, then
Answers
1. Minor number will be different for every device file--A
2. Minor number will be same for every device file
3. Minor number can't be allocated for any device file
4. None of the above

33. The device number which is of 32 bit and consist of _________ bits for major
and _______ bits for minor.
Answers
1. 21, 11
2. 11, 21
3. 20, 12
4. 12, 20--A

34. ________ structure used by the kernel internally to represent files


Answers
1. mknode
2. inode--A
3. structdev
4. None of the above

35. In Linux device driver which keyword used to allocate memory


Answers
1. malloc
2. dmalloc
3. lmalloc
4. kmalloc--A

36. Inb&outb are used to read and write


Answers
1. 8bytes
2. 1 bit--A
3. a block
4. 8 bits

37. what does mean unsigned long probe_irq_on(void):


Answers
1. This function returns a bit mask of unasigned interrupts--A
2. This function has requested an interrupts
3. This function has used by driver calls
4. This function returns a negative value

38. In dev_t major number is of _____ bits.


Answers
1. 20
2. 12--A
3. 19
4. None of the above

39. inb(), inw(), inl() are used to access devices.


Answers
1. True--A
2. False

40. Which of the following is not member of struct file_operation{}?


Answers
1. fopen()
2. fread()
3. remove()
4. All of the above--A
5. None of the above

You might also like