What is a Kernel Space?
This is where the kernel executes the services that it provides with full system privileges. Typical only includes critical software (modules, drivers, services, SELinux).
note. user space, will include everything else
What are the two classifications of the Linux Kernel?
How do you view which kernel you are running?
uname -a (give all details)
What are the several layers that operate in kernel space?
System CallInterface (SCI) (handles system calls sent from user applications to the kernel)
Process management (handles different processes by allocating separate execution space on the processor and ensuring that the running of one process does not interfere with other processes)
Memory management (manages the computer’s memory)
File system management (manages the filesystem, which involves storing, organizing, and tracking files and data on a computer, also supports a virtual file system (VFS))
Device management (manages devices by controlling device access and interfacing between user applications and hardware devices of the computer)
Where can you view the Kernel files?
Can be view in /boot
What is Vm Linuz ?
Vm Linuz is your kernel file that gets booted up
Where can you view the kernel modules?
Can be viewed in /use/lib/modules or /lib/modules (in some distributions).
Kenel Modul subdirectories - Inside /usr/lib/modules//kernel/ are severalsubdirectories
archArchitecture-specific support.
crypto Encryption and other cryptographic functions.
drivers Various types of hardware.
fs Various types of file systems.
net Networking components such as firewalls and protocols.
What command shows modules?
lsmod
allow you vies all modules and their status
What are the advantages of kernel modules are?
They reduce the burden on the kernel because otherwise all of the modules’functionality would have to be added directly to the kernel.
Dynamic loading of kernel modules facilitates lower memory consumption.
They avoid having to rebuild and reboot the system when new functionality isrequired.
note. kernel module file consists of a .ko extension. Modules built for a specific kernelversion may not be compatible with another version of the kernel.
How you view information about a module?
modinfo {module_name or file_name}
How do you install a module?
insmod {file_name}
How do you delete a module?
rmmod {mod_name}
How do you enable a module?
Tell the system to probe for new hardware using modprobe.
How do you specify hardware you don’t loaded?
create a .conf file in /etc/modprobe.d and specify that hardware and the rules that apply
alias {alternative name} {module name}Specify an alternative name for a module with along name.
blacklist {module name}Ignore internal aliases, which occur whenmodules define their own aliases.
install {module name} {command}Run the specified command without inserting themodule into the kernel.
How can you add or remove modules from a kernel?
Use modprobe, syntax of the modprobe command is modprobe [options] [module names]
Options:
How would you update the database of dependencies so that modprobe can function properly?
Use the depmod command which searches the contents of /lib/modules// for each module
The syntax of the depmod command is depmod [options]
How would you view and edit Kernal options?
Kernel options can be views using the sysctl (system control). The syntax of the sysctl command is sysctl [options]
options:
What is the /proc/ directory ?
directory is a virtual file system (VFS) that provides significantinformation about the kernel’s running process
Here are some common files in this directory:
/proc/cmdlineOptions passed to the kernel by the boot loader at boottime, such as mounting the kernel as read-only.
/proc/cpuinfoCPU information, such as its architecture, name, clockspeed, cache size, and more.
/proc/devicesA list of character and block device drivers loaded intothe currently running kernel.
/proc/filesystemsA list of file systems types that are supported by thekernel, as well as if any are currently mounted.
/proc/meminfoInformation about RAM usage, including total memory,free memory, and much more.
/proc/modulesInformation about modules currently installed on thesystem. An alternative to the lsmod command.
/proc/statVarious statistics about the system since it was lastrebooted.
/proc/version file specifies several points of information about the Linuxkernel:•The version of the Linux kernel currently running.•The version of the GNU Compiler Collection (GCC) used to compile the kernel.• The user name of the kernel compiler.• The time the kernel was compiled.
How would you print messages that have been sent to the kernel’s message buffer?
Use the dmesg (“display message” or “driver message”) command. The syntax of the dmesg command is dmesg [options]
Options: