You can manually configure the kernel according to "Linux device driver development details" today, mainly by adding your own options to the kernel, such as adding a self-added driver. The specific process is as follows:
1. First, add your own driver directory under the DRIVERS directory, and temporarily name it mydriver. Run the mkdir mydriver command.
2. Create a kconfig file in the mydriver directory to display the configuration. Run the sudo gedit kconfig command.
Add the following content to kconfig:
#
# Mydriver Configuration
#
Menu "mydriver"
Comment "My driver"
Config config_mydriver
Bool "mydriver support"
Config config_mydriver
Tristate "mydriver USR-space interface"
Depends on config_mydriver
Endmenu
3. To make the kconfig configuration take effect, you need to modify the ARCH/ARM/kconfig file and add
Source "Drivers/mydriver/kconfig"
4. Create a makefile in the mydriver directory.
# Drivers/mydriver/makefile
#
#
OBJ-$ (config_mydriver) + = mydriver. O mydriver_queue.o mydriver_client.o
OBJ-$ (config_mydriver_user) + = mydriver_ioctl.o
OBJ-$ (config_proc_fs) + = mydriver_proc.o
OBJ-$ (config_mydriver_cpu) + = CPU/
4. Create a CPU subdirectory in the mydriver directory and run the mkdir CPU command.
5. Create a makefile in the CPU directory and run the sudo gedit makefile command.
Add content
# Drivers/mydriver/CPU/makefile
#
# Makefile for the mydriver CPU
#
OBJ-$ (config_mydriver_cpu) + = CPU. o
6. To enable the mydriver directory to be compiled, add a script to the MAKEFILE file in the DRIVERS directory.
OBJ-$ (config_mydriver) + = mydriver/
After completing the preceding steps, you can see the newly added mydriver directory and its options when using make menuconfig.