Make an answer key with concise explanations for the following.: 1. Which command is…
- User
Make an answer key with concise explanations for the following.:
-
Which command is used to load a module in Linux? a) insmod b) rmmod c) modprobe d) lsmod
-
What is the purpose of the make command in kernel module development? a) To compile the module source code b) To link the module object files c) To load the module into the kernel d) To unload the module from the kernel
-
What is the module initialization function called in a Linux kernel module? a) init_module b) cleanup_module c) main d) exit
-
How can we pass parameters to a kernel module during its loading? a) Using command-line arguments b) Using a configuration file c) Through environment variables d) Module parameters are not supported in Linux kernel modules
-
Which data structure in the Linux kernel is used to represent linked lists? a) list_head b) struct_node c) struct_list d) linked_list
-
Which kernel module code section should be used for functions that handle file operations? a) .bss b) .text c) .data d) .rodata
-
How can we obtain the current process ID in a kernel module? a) Using the getpid() function b) Using the current->pid variable c) Accessing the process ID from the task_struct structure d) Kernel modules cannot access process IDs
-
Which system call is used to allocate memory in the Linux kernel? a) malloc() b) kmalloc() c) get_free_pages() d) alloc_pages()
-
What is the purpose of the register_chrdev() function in Linux kernel modules? a) To allocate memory for character devices b) To unregister a character device c) To register a character device with the kernel d) To perform character device I/O operations
-
Which utility is used to debug kernel modules? a) gdb b) strace c) valgrind d) printk
-
Which file should be modified to define the module license and author information? a) module_info.h b) license_info.h c) author_info.h d) Makefile
-
Which header file should be included in a Linux kernel module to use the GPIO functionality? a) linux/gpio.h b) linux/irq.h c) linux/kernel.h d) linux/module.h
-
How can we pass data between the kernel and user space in a Linux kernel module? a) Using global variables b) Through shared memory c) By writing to files in the /proc directory d) Kernel modules cannot communicate with user space
-
Which function is used to allocate a device number dynamically in a Linux kernel module? a) alloc_chrdev_region() b) register_chrdev_region() c) request_irq() d) get_inode_number()
-
How can we unregister a character device in a Linux kernel module? a) Using the unregister_chrdev() function b) By removing it from the /dev directory c) By freeing the allocated device number d) Unregistering a character device is not required in kernel modules
-
- Assistant