In: Computer Science
If possible, please answer all 4 questions. Thanks! :)
35. What file in the /proc directory can be used to list the features supported by your system’s CPU?
36. Which of the following commands can be used to insert a kernel module into the Linux kernel? (Choose all that apply.)
a. insmod
b. modprobe
c. lsmod
d. depmod
Q.35) What file in the /proc directory can be used to list the features supported by your system’s CPU?
Ans: -
The /proc/cpuinfo file in the /proc is used to list all the features that are supported by the CPU of your system. The /proc is the file directory in the Linux operating system which has information of different processes that are currently running on the system.
In Linux operating system the /proc/cpuinfo is file in text readable format which includes the information related to the CPU of the system. The system can have more one CPU attached to it. When there are more than one CPU connected to the system then this file includes the data of all the CPU’s followed by a blank line.It can be used with the cat command to get all the information about the CPU. It gives the following information like processor, CPU family, model, model name, CPU MHz and cache size etc.
Q.36) Which of the following commands can be used to insert a kernel module into the Linux kernel?
Ans: -
a) insmod
b) modprobe
The above two commands can be used to insert a kernel module into the Linux Kernal.
Explanation: - To inserting a module in Linux there are two commands insmod command and modprobe. The modprobe command in Linux is similar to the insmod command. There is a small difference in insmod and modprobe. The modprobe command can read the module from the desired set location but the insmode command can’t. modprobe can also automatically insert the modules. modprobe can also handle the dependencies. The insmode does not provide these features but can insert the kernel modules.
ismod: -To check the status of the modules inserted into the kernel the ismode command is used. This command usually displays the information in three columns which are module, size and used by. Module shows the name of the modules with their extension. Size includes the information of memory being used by the modules and used by shows the instances that are currently being used by the modules.
depmod: - It generates the dependencies of the module that were inserted using the modprobe or insmod command. It also creates an associated map about the modules which are handled by the identifiers.
Hence the insmod and modprobe commands are used to insert a kernel module into the Linux Operating System.