建立嵌入式Linux系统

简介: 版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/3741923 建立嵌入式Linux系统一、Makefile 目标在Linux顶层目录键入make help,会看到所有目标列表。
版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/3741923

建立嵌入式Linux系统



一、Makefile 目标
在Linux顶层目录键入make help,会看到所有目标列表。如下:
$ make ARCH=arm help
Cleaning targets:
  clean - remove most generated files but keep the config
  mrproper - remove all generated files + config + various backup files

Configuration targets:
  config - Update current config utilising a line-oriented program
  menuconfig - Update current config utilising a menu based program
  xconfig - Update current config utilising a QT based front-end
  gconfig - Update current config utilising a GTK based front-end
  oldconfig - Update current config utilising a provided .config as base
  randconfig - New config with random answer to all options
  defconfig - New config with default answer to all options
  allmodconfig - New config selecting modules when possible
  allyesconfig - New config where all options are accepted with yes
  allnoconfig - New minimal config

Other generic targets:
  all - Build all targets marked with [*]
* vmlinux - Build the bare kernel
* modules - Build all modules
  modules_install - Install all modules
  dir/ - Build all files in dir and below
  dir/file.[ois] - Build specified target only
  dir/file.ko - Build module including final link
  rpm - Build a kernel as an RPM package
  tags/TAGS - Generate tags file for editors
  cscope - Generate cscope index
  kernelrelease - Output the release version string

Static analysers
  buildcheck - List dangling references to vmlinux discarded sections and
  init sections from non-init sections
  checkstack - Generate a list of stack hogs
  namespacecheck - Name space analysis on compiled kernel

Kernel packaging:
  rpm-pkg - Build the kernel as an RPM package
  binrpm-pkg - Build an rpm package containing the compiled kernel and
  modules
deb-pkg - Build the kernel as an deb package
  tar-pkg - Build the kernel as an uncompressed tarball
  targz-pkg - Build the kernel as a gzip compressed tarball
  tarbz2-pkg - Build the kernel as a bzip2 compressed tarball

Documentation targets:
  Linux kernel internal documentation in different formats:
  xmldocs (XML DocBook), psdocs (Postscript), pdfdocs (PDF)
  htmldocs (HTML), mandocs (man pages, use installmandocs to install)


Architecture specific targets (arm):
* zImage - Compressed kernel image (arch/arm/boot/zImage)
  Image - Uncompressed kernel image (arch/arm/boot/Image)
* xipImage - XIP kernel image, if configured (arch/arm/boot/xipImage)
  bootpImage - Combined zImage and initial RAM disk
  (supply initrd image via make variable INITRD=<path>)
  install - Install uncompressed kernel
  zinstall - Install compressed kernel
  Install using (your) ~/bin/installkernel or
  (distribution) /sbin/installkernel or
  install to $(INSTALL_PATH) and run lilo
  assabet_defconfig - Build for assabet
  badge4_defconfig - Build for badge4
  bast_defconfig - Build for bast
  cerfcube_defconfig - Build for cerfcube
  clps7500_defconfig - Build for clps7500
  collie_defconfig - Build for collie
  corgi_defconfig - Build for corgi
  ebsa110_defconfig - Build for ebsa110
  edb7211_defconfig - Build for edb7211
  enp2611_defconfig - Build for enp2611
  ep80219_defconfig - Build for ep80219
  epxa10db_defconfig - Build for epxa10db
  footbridge_defconfig - Build for footbridge
  fortunet_defconfig - Build for fortunet
  h3600_defconfig - Build for h3600
  h7201_defconfig - Build for h7201
  h7202_defconfig - Build for h7202
  hackkit_defconfig - Build for hackkit
  integrator_defconfig - Build for integrator
  iq31244_defconfig - Build for iq31244
  iq80321_defconfig - Build for iq80321
  iq80331_defconfig - Build for iq80331
  iq80332_defconfig - Build for iq80332
  ixdp2400_defconfig - Build for ixdp2400
  ixdp2401_defconfig - Build for ixdp2401
  ixdp2800_defconfig - Build for ixdp2800
  ixdp2801_defconfig - Build for ixdp2801
  ixp4xx_defconfig - Build for ixp4xx
  jornada720_defconfig - Build for jornada720
  lart_defconfig - Build for lart
  lpd7a400_defconfig - Build for lpd7a400
  lpd7a404_defconfig - Build for lpd7a404
  lubbock_defconfig - Build for lubbock
lusl7200_defconfig - Build for lusl7200
  mainstone_defconfig - Build for mainstone
  mx1ads_defconfig - Build for mx1ads
  neponset_defconfig - Build for neponset
  netwinder_defconfig - Build for netwinder
  omap_h2_1610_defconfig - Build for omap_h2_1610
  pleb_defconfig - Build for pleb
  poodle_defconfig - Build for poodle
  pxa255-idp_defconfig - Build for pxa255-idp
  rpc_defconfig - Build for rpc
  s3c2410_defconfig - Build for s3c2410
  shannon_defconfig - Build for shannon
  shark_defconfig - Build for shark
  simpad_defconfig - Build for simpad
  smdk2410_defconfig - Build for smdk2410
  spitz_defconfig - Build for spitz
  versatile_defconfig - Build for versatile


  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
  make O=dir [targets] Locate all output files in "dir", including .config
  make C=1 [targets] Check all c source with $CHECK (sparse)
  make C=2 [targets] Force check of all c source with $CHECK (sparse)

Execute "make" or "make all" to build all targets marked with [*]
For further info see the ./README file

二、内核配置
Kconfig(或Kconfig.ext文件)在大约300个内核子目录中存在。Kconfig用于配置处理,其内容被配置子系统解析,表示用于对配置的选择。

配置工具(如gconf)读入来自arch子目录的Kconfig文件,如下:
gconfig:$(obj)/gconf
 $< arch/$(ARCH)/Kconfig
取决于你建立的架构,gconf读入指定架构的Kconfig作为顶层配置定义。Kconfig包含大量代码行,看起来如下:
source "drivers/pci/Kconfig"

注:GConf是在基于GNOME2的系统中用于应用程序属性配置和管理的工具,完成类似于Windows操作系统注册表的功能。GConf 包括一个配置数据库系统。

ARM架构的部分Kconfig列表如下:
arch/arm/Kconfig <<<<<< (top level Kconfig)
|-> init/Kconfig
| ...
|-> arch/arm/mach-iop3xx/Kconfig
|-> arch/arm/mach-ixp4xx/Kconfig
| ...
|-> net/Kconfig
| |-> net/ipv4/Kconfig
| | |-> net/ipv4/ipvs/Kconfig
| ...
|-> drivers/char/Kconfig
| |-> drivers/serial/Kconfig
| ...
|-> drivers/usb/Kconfig
| |-> drivers/usb/core/Kconfig
| |-> drivers/usb/host/Kconfig
| ...
|-> lib/Kconfig

三、定制配置选项
为指定硬件平台定制配置选项,如…/arch/arm/Kconfig片段:
source "init/Kconfig"
menu "System Type"
choice
  prompt "ARM system type"
  default ARCH_RPC
config ARCH_CLPS7500
  bool "Cirrus-CL-PS7500FE"
config ARCH_CLPS711X
  bool "CLPS711x/EP721x-based"
...
source "arch/arm/mach-ixp4xx/Kconfig

四、内核文档
Linux源码树包含大量的有效信息,在Documentation目录包含大约42个子目录,至少650个文档。虽然这些文档很容易过时,但它提供了各种特定内核子系统或概念的基础信息。

五、所需的组件
除了Linux内核,还需要下列组件来开发、测试和运行你的嵌入式Linux widget:
1)Bootloader移植和配置指定的硬件平台

2)支持所选架构的交叉编译器和相关的toolchain

3)包含支持本地硬件架构/处理器的打包的可执行文件和库的文件系统

4)目标板板载设备的设备驱动器

5)开发环境,包括主机工具软件(tools和utilities)

6)支持特定处理器和主板的Linux内核源码树


目录
相关文章
|
7天前
|
资源调度 JavaScript 搜索推荐
Linux系统之部署envlinks极简个人导航页
【4月更文挑战第11天】Linux系统之部署envlinks极简个人导航页
40 2
|
9天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
61 0
|
10天前
|
监控 Unix Linux
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
26 0
|
8天前
|
存储 算法 Linux
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
22 6
|
3天前
|
运维 网络协议 Unix
18.系统知识-Linux常用命令
18.系统知识-Linux常用命令
|
4天前
|
Linux 编译器 测试技术
嵌入式 Linux 下的 LVGL 移植
嵌入式 Linux 下的 LVGL 移植
|
11天前
|
Prometheus 监控 Cloud Native
【Linux】查看系统内存命令(详细讲解)
【Linux】查看系统内存命令(详细讲解)
|
14天前
|
Linux API C语言
FFmpeg开发笔记(一)搭建Linux系统的开发环境
本文指导初学者如何在Linux上搭建FFmpeg开发环境。首先,由于FFmpeg依赖第三方库,可以免去编译源码的复杂过程,直接安装预编译的FFmpeg动态库。推荐网站<https://github.com/BtbN/FFmpeg-Builds/releases>提供适用于不同系统的FFmpeg包。但在安装前,需确保系统有不低于2.22版本的glibc库。详细步骤包括下载glibc-2.23源码,配置、编译和安装。接着,下载Linux版FFmpeg安装包,解压至/usr/local/ffmpeg,并设置环境变量。最后编写和编译简单的C或C++测试程序验证FFmpeg环境是否正确配置。
35 8
FFmpeg开发笔记(一)搭建Linux系统的开发环境
|
15天前
|
资源调度 JavaScript 安全
Linux系统之部署web-check网站分析工具
【4月更文挑战第3天】Linux系统之部署web-check网站分析工具
63 9
|
16天前
|
Java Unix Linux
Linux系统常用命令速查手册
Linux系统常用命令速查手册