System version: Ubuntu18.04-64
Compiler version: gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)
uboot version: 2018.07-linux4sam_6.0
Board model: at91sama5d3x-xplained
MCU model: sama5d36
The kernel cross-toolchain relies on the Makefile file for cascade compilation and the Kconfig file for configuration. For example, the current ESP32 also uses this graphical configuration. Good things will be widely accepted.
1. Call up the configuration interface
View the Makefile file and view version information 4.19
make menuconfig
General setup ---> //General configuration <======
[*] Enable loadable module support ---> // Enable insmod
-*- Enable the block layer ---> // Disk IO scheduling, usually the default is ok
System Type ---> //Select a specific arm core/cpu type and its properties. You should confirm this part after make menuconfig
Bus support ---> // Some bus support, usually the default is ok
Kernel Features ---> //Kernel features, such as memory distribution between application and kernel space
Boot options ---> //Boot options, features that can be modified during kernel boot process
CPU Power Management ---> // CPU power management, usually you need to make a choice in battery-powered devices
Power management options ---> // Power management of peripheral devices suspend() resum()
Networking support ---> // Network support, basically all about protocols, such as TCP/IP, domain sockets, multicast, ppp protocol
Device Drivers ---> // Device driver, including two parts: Controller === device driver, frequently visited options
File systems ---> // File system support, such as ntfs, ext4, nfs, cramfs, jiffs, minix................... yaffs, ubifs
Use * to select the compilation item
[*]
< > You can use spaces to select
() ==> Fill in a value and press Enter, for example (arm-none-linux-gnueabi-) Cross-compiler tool prefix
General setup --->
[*] Configure standard kernel features (for small systems) --->
[*] Sysctl syscall support (NEW)
[*] Load all symbols for debugging/ksymoops (NEW)
[*] Include all symbols in kallsyms
//kernel panic, will prompt the code execution stack
System Type --->
ARM system type (Samsung S5PC100) --->
[*] SMDKC100
Kernel Features --->
[*] Use the ARM EABI to compile the kernel //If eabi appears in the cross toolchain, be sure to select it
[*] Allow old ABI binaries to run with this kernel (EXPERIMENTAL)
Relationship between cmdline and bootags: Same
[ * ] Networking support --->
Networking options --->
<*> Unix domain sockets
[*] TCP/IP networking <===========If you have a network card, you must select one
[*] IP: multicasting
File systems --->
<*> Ext3 journalling file system support
<*> The Extended 4 (ext4) filesystem
Pseudo filesystems ---> // Virtual file system: manage files in memory. After power failure, the files will not exist. They will be temporarily created when the computer is turned on.
// The files in dev/, proc/, and sys/ directories are all temporary
[*] /proc file system support (NEW)
[*] sysfs file system support (NEW)
[*] Virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
[*] Miscellaneous filesystems ---> //Miscellaneous file systems, support for the management of files stored in nand
<*> Compressed ROM file system support (cramfs)
<*> SquashFS 4.0 - Squashed file system support
[*] Network File Systems (NEW) ---> // Network file system: nfs
<*> NFS client support
[*] NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
<*> Native language support ---> //Character encoding method supported by the kernel
<*> Codepage 437 (United States, Canada)
<*> Simplified Chinese charset (CP936, GB2312)
<*> ASCII (United States)
<*> NLS ISO 8859-1 (Latin 1; Western European Languages)
<*> NLS UTF-8
Device Drivers --->
<*> Connector - unified userspace <-> kernelspace linker --->
<*> Memory Technology Device (MTD) support ---> // There are nand, onenand and other devices, you need to select mtd
[*] MTD partitioning support
[*] Command line partition table parsing //uboot can pass the partition table
<*> NAND Device Support ---> //nand device support, specific nand controller options for a certain platform
[*] Network device support ---> //A network card is required
[*] Ethernet (10 or 100Mbit) (NEW) --->
<*> DM9000 support
[*] USB support --->
<*> Support for Host-side USB
[*] USB device filesystem (DEPRECATED)
[*] USB device class-devices (DEPRECATED) (NEW)
<*> USB Modem (CDC ACM) support // 3G configuration
<*> USB Serial Converter support ---> USB to serial port
[*] Networking support —>
Network card driver selection
Device Drivers --->
[*] Network device support --->
[*] Ethernet driver support --->
-*- MDIO bus device drivers ---- //MDIO controller reads PHY registers
-*- PHY Device support and infrastructure --->
<*> Micrel PHYs // Micrel's ksz9031 and ksz8081
I2C Bus
I2C support --->
<*> I2C device interface //i2c driver interface
-*- I2C bus multiplexing support
I2C Hardware Bus support ---> //Hardware bus
<*> GPIO-based bitbanging I2C //Corresponding GPIO pin multiplexing
SPI Bus
[*] SPI support --->
<*> GPIO-based bitbanging SPI Master
GPIO Bus [*] GPIO Support ---> [*] /sys/class/gpio/... (sysfs interface) //Support sysfs interface to facilitate debugging of character drivers USB support, mount mouse, keyboard, and USB device [*] USB support ---> <*> Support for Host-side USB [*] USB announces new devices <*> USB Serial Converter support ---> //USB to serial port <*> MMC/SD/SDIO card support ---> //EMMC <*> MMC block device driver //Driver (8) Number of minors per block device //Data bus bit number [*] MMC host drivers debugging //Print debugging information <*> Secure Digital Host Controller Interface support <*> SDHCI platform and OF driver helper <*> SDHCI OF support for the Atmel SDMMC controller <*> SDHCI support for the Cadence SD/SDIO/eMMC controller [*] LED Support ---> [*] LED Trigger support ---> <*> LED Heartbeat Trigger //When the kernel is running normally, the heartbeat LED indicator light is on. The hardware needs to design an indicator light Control of kernel compilation: all:vmlinux # Build vmlinux # --------------------------------------------------------------------------- # vmlinux is built from the objects selected by $(vmlinux-init) and # $(vmlinux-main). Most are built-in.o files from top-level directories # in the kernel tree, others are specified in arch/$(ARCH)/Makefile. # Ordering when linking is important, and $(vmlinux-init) must be first. # # vmlinux # ^ # | # +-< $(vmlinux-init) # | +--< init/version.o + more # | # +--< $(vmlinux-main) # | +--< driver/built-in.o mm/built-in.o + more # | # +-< kallsyms.o (see description in CONFIG_KALLSYMS section) =============> init-y := init/ drivers-y := drivers/ sound/ firmware/ net-y := net/ libs-y := lib/ core-y := usr/ ================================== vmlinux-init := $(head-y) $(init-y) vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) vmlinux-all := $(vmlinux-init) $(vmlinux-main) vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds //Link script arch/arm/kernel/vmlinux.lds head-y cannot be found in the top-level Makefile: actually in arch/arm/Makefile include $(srctree)/arch/$(SRCARCH)/Makefile ifeq ($(CONFIG_MMU),) // CONFIG_MMU must not be empty, CONFIG_MMU=y MMUEXT := -nommu endif head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o arch/arm/kernel/head.S //Entry file arch/arm/kernel/vmlinux.lds //Link script OUTPUT_ARCH(arm) ENTRY(stext) //Entry function SECTIONS { . = 0xC0000000 + 0x00008000; // Space above 3G .init : { /* Init code and data Contains code and data. free 144K mem */ _stext = .; // Starting segment _sinittext = .; *(.head.text) // There is a text section *(.init.text) *(.cpuinit.text) *(.meminit.text) _einittext = .; __proc_info_begin = .; //Starting position *(.proc.info.init) // Special segment, very similar to the .u_boot_cmd segment __proc_info_end = .; //End position __arch_info_begin = .; *(.arch.info.init) __arch_info_end = .; __tagtable_begin = .; *(.taglist.init) __tagtable_end = .; ======================================================== Relationship between Kconfig---> Makefile make menuconfig --> Kcongfig in each directory ==> save .config CONFIG_CPU_S5PC100=y ==> Kbuild processing: 1, to Makefile obj-$(CONFIG_CPU_S5PC100) += cpu.o init.o clock.o gpiolib.o irq-gpio.o 2. Generate a header file for use in C language code ./include/generated/autoconf.h:98:#define CONFIG_CPU_S5PC100 1 #define CONFIG_CPU_S5PC100 1 If CONFIG_INET6_XFRM_MODE_TUNNEL value is y #define CONFIG_INET6_XFRM_MODE_TUNNEL 1 If CONFIG_INET6_XFRM_MODE_TUNNEL value is m #define CONFIG_INET6_XFRM_MODE_TUNNEL_MODULE 1 ================================================ If you compile the code mytest.c in the kernel 1. Write Kcongfig config MY_TEST tristate "this is a config test" help this is a help info to choose my_test Writing a Makefile obj-$(CONFIG_MY_TEST) += mytest.o 2. Modify the Makfile directly obj-y += mytest.o File systems ---> <*> The Extended 4 (ext4) filesystem
Previous article:[linux kernel] The pitfalls of ksz9031 driver debugging under the kernel
Next article:[linux kernel] Kernel transplant process record
Recommended ReadingLatest update time:2024-11-16 11:52
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- iTOP-3399 development board Linux system compilation and burning - obtain/install/compile Linux source code
- Questions about writing data from DSP to DATARAM in PRU1
- Please recommend a buck-boost chip
- The weekly evaluation information will be here soon~ Have a happy holiday and happy work~~
- Crazy Shell AI open source drone PID basics
- What are the main differences between DSP's C language and host's C language?
- renesas Renesas R-CAR Series Guide
- Prize-winning survey | Learn about [Semiconductor materials and device testing knowledge] (Materials Science) with Tektronix
- The problem of NTC temperature detection circuit is shown in the figure
- "Operational Amplifier Parameter Analysis and LTspice Application Simulation" Reading Notes 1 - Details Determine Success or Failure