ArmLinux BOOTLOADER全程详解(基于三星2410)

ARM单片机使用CAN总线部署BootLoader 单片机BootLoader至关重要,负责初始化硬件、加载操作系统、提供启动选项和OTA更新。CAN总线以高效可靠著称,广泛应用于多领域。ARM单片机BootLoader功能丰富,包括版本获取、内存操作等,并强调安全可靠性。随着物联网和智能设备发展,BootLoader作用凸显,未来将更智能安全。它是系统启动关键,确保嵌入式系统稳定可靠运行。 阅读详情
 

ArmLinux BOOTLOADER全程详解

文章 / 专栏:dongleijun2002
发表者 taling 在 2005 年 01 月 14 日 - 12:42 PM

ArmLinux BOOTLOADER全程详解
作者:董磊鋆
1.几个重要的概念
COMPRESSED KERNEL and DECOMPRESSED KERNEL
Jffs2 File System
RAMDISK
启动参数(摘自IBM developer)
2.开发环境和开发板配置:
3.启动方式:
4.代码分析


网上关于Linux的BOOTLOADER文章不少了,但是大都是vivi,blob等比较庞大的程序,读起来不太方便,编译出的文件也比较大,而且更多的是面向开发用的引导代码,做成产品时还要裁减,这一定程度影响了开发速度,对初学者学习开销也比较大,在此分析一种简单的BOOTLOADER,是在三星公司提供的2410 BOOTLOADER上稍微修改后的结果,编译出来的文件大小不超过4k,希望对大家有所帮助.

1.几个重要的概念

COMPRESSED KERNEL and DECOMPRESSED KERNEL

压缩后的KERNEL,按照文档资料,现在不提倡使用DECOMPRESSED KERNEL,而要使用COMPRESSED KERNEL,它包括了解压器.因此要在ram分配时给压缩和解压的KERNEL提供足够空间,这样它们不会相互覆盖.

当执行指令跳转到COMPRESSED KERNEL后,解压器就开始工作,如果解压器探测到解压的代码会覆盖掉COMPRESSED KERNEL,那它会直接跳到COMPRESSED KERNEL后存放数据,并且重新定位KERNEL,所以如果没有足够空间,就会出错.

Jffs2 File System

可以使armlinux应用中产生的数据保存在FLASH上,我的板子还没用到这个.

RAMDISK

使用RAMDISK可以使ROOT FILE SYSTEM在没有其他设备的情况下启动.一般有两种加载方式,我就介绍最常用的吧,把COMPRESSED RAMDISK IMAGE放到指定地址,然后由BOOTLOADER把这个地址通过启动参数的方式ATAG_INITRD2传递给KERNEL.具体看代码分析.

启动参数(摘自IBM developer)

在调用内核之前,应该作一步准备工作,即:设置 Linux 内核的启动参数。Linux 2.4.x 以后的内核都期望以标记列表(tagged list)的形式来传递启动参数。启动参数标记列表以标记 ATAG_CORE 开始,以标记 ATAG_NONE 结束。每个标记由标识被传递参数的 tag_header 结构以及随后的参数值数据结构来组成。数据结构 tag 和 tag_header 定义在 Linux 内核源码的include/asm/setup.h 头文件中.

在嵌入式 Linux 系统中,通常需要由 BOOTLOADER 设置的常见启动参数有:ATAG_CORE、ATAG_MEM、ATAG_CMDLINE、ATAG_RAMDISK、ATAG_INITRD等。

(注)参数也可以用COMMANDLINE来设定,在我的BOOTLOADER里,我两种都用了.

2.开发环境和开发板配置:

CPU:S3C2410,BANK6上有64M的SDRAM(两块),BANK0上有32M NOR FLASH,串口当然是逃不掉的.这样,按照数据手册,地址分配如下:

0x4000_0000开始是4k的片内DRAM.

0x0000_0000开始是32M FLASH 16bit宽度

0x3000_0000开始是64M SDRAM 32bit宽度

注意:控制寄存器中的BANK6和BANK7部分必须相同.

0x4000_0000(片内DRAM)存放4k以内的BOOTLOADER IMAGE

0x3000_0100开始存放启动参数

0x3120_0000 存放COMPRESSED KERNEL IMAGE

0x3200_0000 存放COMPRESSED RAMDISK

0x3000_8000 指定为DECOMPRESSED KERNEL IMAGE ADDRESS

0x3040_0000 指定为DECOMPRESSED RAMDISK IMAGE ADDRESS

开发环境:Redhat Linux,armgcc toolchain, armlinux KERNEL

如何建立armgcc的编译环境:建议使用toolchain,而不要自己去编译armgcc,偶试过好多次,都以失败告终.

先下载arm-gcc 3.3.2 toolchain

将arm-linux-gcc-3.3.2.tar.bz2 解压到 /toolchain

# tar jxvf arm-linux-gcc-3.3.2.tar.bz2

# mv /usr/local/arm/3.3.2 /toolchain

在makefile 中在把arch=arm CROSS_COMPILE设置成toolchain的路径

还有就是INCLUDE = -I ../include -I /root/my/usr/local/arm/3.3.2/include.,否则库函数就不能用了

3.启动方式:

可以放在FLASH里启动,或者用Jtag仿真器.由于使用NOR FLASH,根据2410的手册,片内的4K DRAM在不需要设置便可以直接使用,而其他存储器必须先初始化,比如告诉memory controller,BANK6里有两块SDRAM,数据宽度是32bit,= =.否则me
Amlogic-Android-Driver-GPIO 基于Amlogic平台,以控制显示外设上下电为例,梳理GPIO的控制过程。 阅读详情

相关推荐

ARM开发中的Boot和Bootloader

它的主要任务是初始化硬件设备,设置系统环境,并加载操作系统到内存中。Bootloader还负责校验操作系统的完整性,并提供启动选项,例如从不同的存储介质中加载操作系统。Bootloader则是在Boot过程中的一个组成部分,它负责加载操作系统到内存中,并将控制权转移到操作系统的入口点。实际的Bootloader可能会更加复杂,并具有更多的功能,例如加载更大的操作系统映像、校验映像的完整性等。Boot(引导)是指系统启动的过程,而Bootloader(引导加载程序)是负责加载操作系统并启动系统的程序。

LklAngular的博客 630

【Pytorch】DCGAN实战(三):二次元动漫头像生成

文章目录1.实现效果2.环境配置2.1Python2.2Pytorch、CUDA2.3Python IDE3.具体实现3.1数据预处理(data.py)(1)导入包(2)定义数据类3.2模型Generator,Discriminator,权重初始化(model.py)(1)导入包(2)Generator(3)Discriminator(4)权重初始化3.3网络训练(net.py)(1)导入包(2)创建类3.4 主函数(main.py)(1)导入文件(2)定义超参数(3)实例化(4)进行训练4.训练过程4.1

qq_44031210的博客 4917

LaTeX伪代码字体大小调整全攻略:从algorithm到algorithm2e的实战技巧

本文详细介绍了在LaTeX中调整伪代码字体大小的全面技巧,涵盖algorithm、algorithmicx和algorithm2e等主流算法包的使用方法。从基础命令到高级配置,帮助用户解决学术论文和技术文档中的伪代码排版问题,提升算法展示的专业性和可读性。特别针对不同期刊格式要求,提供了实用的字体调整方案。

weixin_29297127的博客 437

SRAM:SRAM入门指南与工作原理

SRAM(Static Random Access Memory),即静态随机存取存储器,是一种能够读取和写入数据的内存(RAM)。它使用由晶体管组成的触发器来存储数据,只要有电源供应,数据就可以稳定地保存。与动态随机存取存储器(DRAM)不同,SRAM 不需要周期性地刷新来保持数据。

weixin_42896509的博客 1万+

用Frida-RPC搞定大麦App最新版签名:一个脚本解决x-sign和x-mini-wua

本文深入解析大麦App最新版签名机制(x-sign和x-mini-wua),详细介绍如何利用Frida-RPC技术开发稳定脚本获取签名参数。通过实战案例展示Java上下文切换、参数序列化等关键技术解决方案,为安全研究和技术验证提供可靠方案。

weixin_42525738的博客 642

Java服务端实现Google Pay支付功能

全网最全代码、最清晰服务端处理Google Pay,最清晰讲解Google Pay集成逻辑。

jack2350536098的博客 1万+

【Qt开发教程】网络代理QNetworkProxy类详解及实战应用

QNetworkProxy 提供了一种灵活而强大的方式来配置和管理网络代理,通过设置代理类型、主机、端口和认证信息,可以使应用程序的所有网络请求通过代理服务器进行。结合 QNetworkProxyFactory 可以实现动态代理选择和自动配置,提高应用的网络通信能力和安全性。在实际应用中,通过合理设置代理、处理代理认证和错误情况,可以确保应用程序在复杂的网络环境中稳定运行,为用户提供可靠的网络访问体验。

科技改变人类,技术成就未来 1542

开源的预测气象大模型与数据获取/可视化

「开源气象大模型与数据获取指南」摘要: 当前主流AI气象模型(如ECMWF的AIFS、DeepMind的GraphCast、华为Pangu等)主要基于ERA5/HRES数据训练。开源资源可通过ECMWF OpenData、GitHub仓库及Google Cloud获取,其中AIFS数据采用CCBY-4.0许可可商用,其他模型多有限制性许可。典型应用流程包括:1)通过Python包获取实时预报数据;2)加载预训练权重进行推理;3)使用xarray/cartopy或Zarr进行可视化。训练数据可从CDS下载ER

专注AI大模型,软件混淆,授权 794

科研级实战】YOLOv11 pose部署至RK3588全流程:让姿态估计模型在边缘端毫秒级运行,我来帮你突破人体行为分析落地壁垒

在智慧安防人体行为分析场景中,基于YOLOv11 pose的模型在云端推理单帧耗时150ms,硬件成本超15000元;经本方案部署到RK3588后,单帧推理耗时降至30ms,硬件成本仅4000元,且关键点检测准确率高达93%以上。在运动姿态评估场景,同款技术路径使模型边缘端推理速度提升6倍,姿态分类精度达95%。这意味着,你也能让自己的姿态估计模型在边缘设备上实现的工业化落地,接下来让我们开启从模型训练到端侧部署的实战征程。

m0_71589036的博客 223

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

上一篇: Bootloader简介及UBOOT移植 (转)
下一篇: 嵌入式系统开发 (Linux)
ryman
博客等级 码龄22年 77粉丝 104原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值