跳至主要内容

【转】vivi开发笔记(十八):bootloader开发阶段总结

文章说明:calmarrow(lqm)原创

文章引自:http://piaoxiang.cublog.cn

 
    到今天,vivi源代码基本分析完毕。对bootloader有了更深层的认识。在此期间,仔细阅读了毛德操、胡希明先生编著的《嵌入式系统--采用公开源代码和StrongARM/XScale处理器》第七章:嵌入式系统的引导和装入。看了看出版时间,才明白牛人詹荣开或许也受惠于此书。他在IBM Development上发表的那篇《嵌入式bootloader技术内幕》一文,后来在sourceforge上的开源项目jtager,在此书中有详尽的描述。(当然,他们可能是独立研究的。)两者结合起来看,对自己的帮助非常大。
 
    现在看来,bootloader主要的工作量有三个:一是根据开发板,确定硬件初始化部分;二是内存初始化,不过内存检测技术相对比较成熟了;三是读写存储介质,包括nor/nand flash或者其他。设置内核传递参数相对前面还是比较简单的。如果完成这些基本功能,一个比较简单的实现就是blob;vivi虽然也比较小,但是还是比blob大一些,也复杂一些。有了这个基本的框架,如果公司是为了推销自己的SoC,那么会做Demo板,也就是所谓的"公版",为之开发bootloader,并不打算支持更多的SoC,比如blob,vivi都是这样。他们的功能并不完善,如果后来的维护者想要增强功能,一是在下载手段上下功夫,比如增加tftp下载或者usb下载,二是在支持文件系统方面做工作。另外有机构专门开发并维护bootloader,想要支持尽可能多的SoC,比如uboot,它就可以在软件架构方面更多的考虑可扩展性,可移植性,同时增强上述手段,另外,可以增加monitor功能,在内核尚未移植完成的阶段增加调试手段。
 
    由此形成了对bootloader比较全面的认识。要想继续深入bootloader,那么有下面的工作:
 
    ・提高阅读datasheet,提取有用信息的能力。能够更快的开发出硬件初始化代码。
    ・掌握内存检测算法,能够快速编写。
    ・学习MTD技术,开发存储介质驱动程序。
    ・掌握tag内核参数传递技术。
 
    这些都是具体的细节的工作。在软件架构的学习上,我想还是应该以uboot为主,因为它的可移植性、可扩展性等,都是其他的bootloader不能相比的。要想在基本的简单的bootloader的基础上有所提高,那么就需要深入的去了解学习uboot。在后续的开发中,如果需要自己开发bootloader,那么就以vivi/blob为模型,重新编写;如果仅仅需要移植,而且该SoC并没有自己的bootloader,那么最好还是以uboot最为移植。
 
    bootloader算是比较简单,下点功夫完全掌握并非难事。在bootloader的学习过程中,把相关的基础继续加强巩固。我想,到07年末,这个任务应该可以完成。这次可是充分估计的学习内容的广度和深度了。要想学好,就要学深学透。这部分内容的开发也比较适合自己的知识背景。完成此部分后,再进入内核开发的驱动部分,从外围入手,逐步的深入的学习内核。课题也分配下来了,还需要在应用上做工作。要做的事情很多,但是不要急,慢慢来。还是那句话,这些技术都是非常成熟了,有文档和资料。只要静下心来,就一定能够掌握。所以,学习这些实用技术的同时,还不能忽略专业理论知识的学习。两者结合,才能走得更远。

评论

此博客中的热门博文

【转】smb协议栈使用示例

/*  * * uncdownload.c  * *  * * Utility for downloading files from SMB shares using libsmbclient  * *  * * Copyright(C) 2006 Sophos Plc, Oxford, England.  * *  * * This program is free software; you can redistribute it and/or modify it under the terms of the  * * GNU General Public License Version 2 as published by the Free Software Foundation.  * *  * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  * * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  * * See the GNU General Public License for more details.  * *  * * You should have received a copy of the GNU General Public License along with this program; if not,  * * write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  * *  * */ # include < sys / types . h > # include < sys / time . h > # include ...

【转】Ether Types

Ether Types (last updated 2008-09-09) NOTE: Please see [RFC5342] for current information and registration procedures. This registry will be revised soon and will be replaced with up-to-date information. Many of the networks of all classes are Ethernets (10Mb) or Experimental Ethernets (3Mb). These systems use a message "type" field in much the same way the ARPANET uses the "link" field. If you need an Ether Type, contact: IEEE Registration Authority IEEE Standards Department 445 Hoes Lane Piscataway, NJ 08854 Phone +1 732 562 3813 Fax: +1 732 562 1571 Email: <ieee-registration-authority& ieee.org > http://standards.ieee.org/regauth/index.html The following list of EtherTypes is contributed unverified information from various sources. Another list of EtherTypes is maintained by Michael A. Patton and is accessible at: <URL: http://www.cavebear.com/CaveBear/Ethernet/ > <URL: ftp://ftp.cavebear.com/pub/Ethernet-codes > Assign...

【转】udp编程实例

UDP通讯实例 2008-04-29 15:30:05 / 个人分类: linux C编程 UDP协议的几点好处: 1.UDP不要求保持一个连接; 2.UDP没有因接收方认可收到数据包(或者当数据包没有正确抵达而自动重传)而带来的开销; 3.设计UDP的目的是用于短应用和控制信息; 4.在一个数据包接一个数据包的基础上,UDP要求的 网络 带宽比TCP更小。 UDP的几个缺点: 1.程序员必须创建代码检测传输错误并进行重传(如果应用程序要求这样做); 2.程序员必须把大数据包分片。 code: <1> /* * sender.c--UDP protocol example */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> int port = 6789; int main() {     int socket_descrīptor;     int iter = 0;     char buf[80];     struct sockaddr_in address;     /* Initialize socket address structure for Interner Protocols */     bzero(&address, sizeof(address)); // empty data structure     address.sin_family = AF_INET;     address.sin_addr.s_addr = inet_addr("127.0.0.1");     address...