u-boot-2012.10 官方文档翻译--构建软件

构建软件


构建U-BOOT已经在许多本地构建环境和一些交叉构建环境下测试过。当然,我们不保证所有现存的版本支持所有的交叉开发工具。在工具链选择的问题上,我们推荐ELDK(可以看 http://www.denx.de/wiki/DULG/ELDK),它被广泛用于构建和测试U-BOOT。

如果你不使用本地环境,假设在你的路径下有GUN交叉编译工具。这种情况下,你必须在shell中设置环境变量CROSS_COMPILE。注意,要保证没有改变Makefile或者其它源文件。一个用于4xx CPU上ELDK的使用示例,输入:

$ CROSS_COMPILE=ppc_4xx-
$ export CROSS_COMPILE


注意:如果你想要生成Windows版的工具,你可以在工具目录下使用MinGW工具链。(http://www.mingw.org).  设置你的主机工具为MinGW工具链,并且执行'make tools'.例如:

$ make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools

二进制文件工具/mkimage.exe 将被创建,可以在运行Windows的电脑上执行。

U-Boot趋向简单的构建,在安装源码后,你必须指定一个板型配置U-Boot。要作这个,可以输入:

make NAME_config


"NAME_config"是一个现在有的配置组合,可以查看 boards.cfg 了解支持的名字。

注意:一些电路板的配置名可能已经存在,从电路板供应商那儿核对可用的附加信息,例如,要使 TQM823L 系统支持或不支持LCD,

你可以在选择配置的时候选择这种“功能”。

make TQM823L_config

将配置一个一般的 TQM823L,不支持LCD。


make TQM823L_LCD_config

将配置一个支持LCD的U-BOOT控制台的 TQM823L。

最后,输入"make all",你能得到一些U-BOOT 镜像文件,可以将这些文件下载/安装到你的系统上。

- "u-boot.bin"  是一个二进制镜像文件。
- "u-boot"  是一个ELF格式的二进制文件。
- "u-boot.srec"  是Motorola S-Record格式文件。


默认情况下,构建是在本地执行,并且项目文件是存放在源目录内。有两种方法可以改变这种行为,

让U-BOOT在一些外部目录构建:

1.增加 O= make命令行调用:

make O=/tmp/build distclean
make O=/tmp/build NAME_config
make O=/tmp/build all

2.设置环境变量 BUILD_DIR 指向理想的位置:

export BUILD_DIR=/tmp/build
make distclean
make NAME_config
make all

注意:命令行"O="的设置,会覆盖环境变量 BUILD_DIR 的值。


请注意,以上是假设你使用GUN make。比如你使用NetBSD的话,你需要用"gmake"代替这里的"make"。

如果你的系统板没有被列出来,你需要移植U-BOOT到你的硬件平台上。可以按照下面的步骤进行:


1.为你的板在根目录下增加一个新的配置文件"boards.cfg"file,使用已经存在的项目作为例子。

下面的指令应该在同一个板型上按顺序执行。

2.根据你的板子创建一个新的代码目录。添加你需要的文件。在你的板目录下,

至少需要"Makefile"、"<board>.c"、"flash.c"和"u-boot.lds"。

3.为你的板子创建一个新的配置文件"include/configs/<board>.h"。

4.如果你移植U-BOOT到一个新的CPU,还要根据你的CPU创建一个新的代码目录。然后添加你需要的文件。

5.使用你的新名字运行"make <board>_config"。

6.键入"make",你会获得一个用于安装在目标系统的"u-boot.srec"文件。

7.调试和解决可能出现的任何问题.

[当然,最后一步比听起来困难的多。]


Building the Software:
======================


Building U-Boot has been tested in several native build environments
and in many different cross environments. Of course we cannot support
all possibly existing versions of cross development tools in all
(potentially obsolete) versions. In case of tool chain problems we
recommend to use the ELDK (see http://www.denx.de/wiki/DULG/ELDK)
which is extensively used to build and test U-Boot.


If you are not using a native environment, it is assumed that you
have GNU cross compiling tools available in your path. In this case,
you must set the environment variable CROSS_COMPILE in your shell.
Note that no changes to the Makefile or any other source files are
necessary. For example using the ELDK on a 4xx CPU, please enter:


$ CROSS_COMPILE=ppc_4xx-
$ export CROSS_COMPILE


Note: If you wish to generate Windows versions of the utilities in
      the tools directory you can use the MinGW toolchain
      (http://www.mingw.org).  Set your HOST tools to the MinGW
      toolchain and execute 'make tools'.  For example:


       $ make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools


      Binaries such as tools/mkimage.exe will be created which can
      be executed on computers running Windows.


U-Boot is intended to be simple to build. After installing the
sources you must configure U-Boot for one specific board type. This
is done by typing:


make NAME_config


where "NAME_config" is the name of one of the existing configu-
rations; see boards.cfg for supported names.


Note: for some board special configuration names may exist; check if
      additional information is available from the board vendor; for
      instance, the TQM823L systems are available without (standard)
      or with LCD support. You can select such additional "features"
      when choosing the configuration, i. e.


      make TQM823L_config
- will configure for a plain TQM823L, i. e. no LCD support


      make TQM823L_LCD_config
- will configure for a TQM823L with U-Boot console on LCD


      etc.




Finally, type "make all", and you should get some working U-Boot
images ready for download to / installation on your system:


- "u-boot.bin" is a raw binary image
- "u-boot" is an image in ELF binary format
- "u-boot.srec" is in Motorola S-Record format


By default the build is performed locally and the objects are saved
in the source directory. One of the two methods can be used to change
this behavior and build U-Boot to some external directory:


1. Add O= to the make command line invocations:


make O=/tmp/build distclean
make O=/tmp/build NAME_config
make O=/tmp/build all


2. Set environment variable BUILD_DIR to point to the desired location:


export BUILD_DIR=/tmp/build
make distclean
make NAME_config
make all


Note that the command line "O=" setting overrides the BUILD_DIR environment
variable.




Please be aware that the Makefiles assume you are using GNU make, so
for instance on NetBSD you might need to use "gmake" instead of
native "make".




If the system board that you have is not listed, then you will need
to port U-Boot to your hardware platform. To do this, follow these
steps:


1.  Add a new configuration option for your board to the toplevel
    "boards.cfg" file, using the existing entries as examples.
    Follow the instructions there to keep the boards in order.
2.  Create a new directory to hold your board specific code. Add any
    files you need. In your board directory, you will need at least
    the "Makefile", a "<board>.c", "flash.c" and "u-boot.lds".
3.  Create a new configuration file "include/configs/<board>.h" for
    your board
3.  If you're porting U-Boot to a new CPU, then also create a new
    directory to hold your CPU specific code. Add any files you need.
4.  Run "make <board>_config" with your new name.
5.  Type "make", and you should get a working "u-boot.srec" file
    to be installed on your target system.
6.  Debug and solve any problems that might arise.
    [Of course, this last step is much harder than it sounds.]

深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值