vxworks学习经验.rar

  • JohnieSi
    了解作者
  • C/C++
    开发工具
  • 13KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 9
    下载次数
  • 2020-08-10 14:59
    上传日期
关于vxworks学习的一些心得体会 关于如何去学习vxworks 有一个大概的介绍!
vxworks学习经验.rar
  • vxworks学习经验.txt
    33.3KB
内容介绍
vxWorks6.x BSP 驱动 怎么写(1-准备) (2014-01-14 15:47:30) 标签: vxworks 分类: vxWorks6.x_BSP 打算有空的时候写这样一个主题的系列文章,将这几年的工作用这种方式做一个总结,1来方便新入门的xdjm能够快速了解,2来对自己有一个交代(万一哪天不干这行了vxWorks6.x <wbr>BSP <wbr>驱动 <wbr>怎么写(1-准备)还能有点货能拿出来)。写这么一篇文章,或多或少有些班门弄斧的感觉,vxworks里的大牛们可以自动飘过,在下也是从校园里的青葱少年到现在对vxworks略知一二,经历过无数迷茫,知道干这行的无助和迷茫啊,感谢曾经伸出过援助之手的前辈们。废话少说,脑子里很乱,大概的思路如下:因本人长期从事基于PowerPPC的BSP和驱动开发,其中又主要是从事freescale的board开发,所以会更多的从这两方面入手,不可能面面俱到,因为东西太多,如果那里理解不对,也欢迎大牛们指点一二。 写BSP的时候你需要准备哪些东西? 1.最需要的是先找一个相同的,类似的BSP,这个太重要了,你可以省去太多太多的麻烦,再这样的基础上再做修改才能事半功倍,别闭门造车,写一个全新的BSP难度是非常大的,比如PPC的BSP,先从arch级别,至少是PPC的,再从core找,是e300,e500,e500mc之类的,再从系列找,比如mpc85xx系列,mpc83xx系列,P1P2系列,P3P5系列等等,到这一级别的时候,恭喜你,你已经离成功相当近了,只是时间问题。 2.可参考的关于板子的一切代码,uboot,linux之类的或者厂商提供的启动代码,test代码,这样你不用再对着datasheet看寄存器定义,犹豫该怎么配,如果有能启动的image,你也可以反向的dump出内存,看寄存器是怎么配的。当然vxworks的源码也是必须的,网上一抓一大把,别告诉我你找不到vxWorks6.x <wbr>BSP <wbr>驱动 <wbr>怎么写(1-准备) 3.调试工具,点灯 < 串口打印 < 第三方的调试工具,如果能把你串口打通,基本所有的调试用它就够了,arch的代码除外。 4.对硬件的了解,如果你对硬件的工作原理一窍不通,那么先学习之,不然你不明白代码为什么这样写,下一步要干什么。想让一个BSP跑起来,至少你需要了解时钟,中断,cpu需要哪些硬件的初始化。 5.google baidu之类的,你至少要对vxworks下的BSP有个初步了解,知道你要做什么,什么不用做。 做BSP最好分阶段进行,这样你的干扰会很少,第一阶段的基本目标是让时钟,中断,uart工作起来,bootrom或者vxworks可以跑起来,接着再开发其他的功能。 http://blog.sina.com.cn/vx567 vxWorks memDrv/ramDrv 的区别 (2013-07-08 17:18:27) 标签: vxworks it 分类: vxWorks6.x_FS vxWorks里经常会看见有下面这2个组件,INCLUDE_MEMDRV,INCLUDE_RAMDRV 特别容易混淆而且不明白它们具体是干什么用的, 今天做了个研究,共享之。 1. INCLUDE_MEMDRV(memDrv) Component INCLUDE_MEMDRV { NAME MEM disk driver SYNOPSIS allows a filesystem to be put on top of memory MODULES memDrv.o INIT_RTN memDrv (); HDR_FILES memDrv.h } #ifdef INCLUDE_MEMDRV memDrv (); #endif typedef struct { DEV_HDR devHdr; MEM_DRV_DIRENTRY dir; off_t allowOffset; } MEM_DEV; 风河的注释: The memDrv device allows the I/O system to access memory directly as a pseudo-I/O device. Memory location and size are specified when the device is created. The device provides a high-level means for reading and writing bytes in absolute memory locations through I/O calls. It is useful when data must be preserved between boots of VxWorks or when sharing data between CPUs. The memDrv driver is initialized automatically by the system with memDrv( ) when the INCLUDE_USR_MEMDRV component is included in VxWorks. The call for device creation must be made from the kernel: STATUS memDevCreate (char * name, char * base, int length) Memory for the device is an absolute memory location beginning at base. The length parameter indicates the size of the memory. For additional information on the memory driver, see the memDrv( ), memDevCreate( ), and memDevCreateDir( ) entries in the VxWorks API reference. 我的理解是,把memDevCreate出来的这些存贮区域(可以是内存也可以是norflash上的一段地址空间)当成一个"文件"来用,一个假的IO设备,可以调用标准的IO操作和文件操作来访问这块区域。 memDrv的一个典型应用就是可以把vxWorks烧写到norflash的一片区域里,这片区域一定要通过memDevCreate创建, bootrmo就可以直接加载memDevCreate里存的vxworks,在无网络的情况调试非常方便。直接上代码: 比如从norFlash的0xff800000(MMU 映射过)开始放vxWorks image,编译出来的vxWorks image的大小是0x1f6fa0, 在config.h中加入: #define INCLUDE_BOOT_FILESYSTEMS #define INCLUDE_MEMDRV 在usrConfig.c中memDrv初始化之后加入: memDevCreate("/mem/",0xff800000, 0x1f6fa0); 注意:size一定要对,不能比实际的size小了。 重新编译bootrom并烧写到板子上,并且把vxWorks image烧写到0xff800000开始处 [VxWorks Boot]: devs drv name 0 /null 1 /tyCo/0 1 /tyCo/1 5 /mem/ 3 /tffs0 3 /tffs1 7 host: [VxWorks Boot]:d 0xff800000 0xff800000: 7f45 4c46 0102 0100 0000 0000 0000 0000 *.ELF............* 0xff800010: 0002 0014 0000 0001 0001 0000 0000 0034 *...............4* 0xff800020: 002c dab4 8000 0000 0034 0020 0004 0028 *.,.......4. ...(* 0xff800030: 001c 001b 0000 0001 0000 00c0 0001 0000 *................* 0xff800040: 0001 0000 001c ef74 001c ef74 0000 0007 *.......t...t....* 0xff800050: 0000 0001 0000 0001 001c f034 001d ef74 *...........4...t* 0xff800060: 001d ef74 0000 012c 0000 012c 0000 0006 *...t...,...,....* 0xff800070: 0000 0001 0000 0001 001c f160 001d f0a0 *...........`....* [VxWorks Boot]: @ boot device : fs unit number : 0 processor number : 0 host name : host file name : /mem/0 inet on ethernet (e) : 192.168.101.108:fffffe00 host inet (h) : 192.168.101.63 gateway inet (g) : 192.168.101.1 user (u) : target ftp password (pw) : vxTarget flags (f) : 0x0 other (o) : motetsec1 Loading /mem/0...1896308 + 300 + 568 + 335992 Starting at 0x10000... Adding 7654 symbols for standalone. VxWorks Copyright 1984-2012 Wind River Systems, Inc. CPU: Unsupported processor Runtime Name: VxWorks Runtime Version: 6.6 BSP version: 6.6/0 Created: Jul 26 2012, 10:06:01 ED&R Policy Mode: Deployed WDB Comm Type: WDB_COMM_END WDB: Ready. -> 2. INCLUDE_RAMDRV(ramDrv) Component INCLUDE_RAMDRV { NAME RAM disk driver SYNOPSIS allows a filesystem to be put on top of RAM MODULES ramDrv.o INIT_RTN ramDrv (); HDR_FILES ramDrv.h } #ifdef INCLUDE_RAMDRV ramDrv (); #endif typedef struct { BLK_DEV ram_blkdev; off_t ram_blkOffset; char *ram_addr; } RAM_DEV; 风河注释: This driver emulates a disk driver, but actually keeps all data in memory. Once the device has been created, it must be associated with a name and file system (dosFs, hrfs, or rawFs). This is accomplished in a two step process. The ramDevCreate() call returns a pointer to a block device structure (BLK_DEV). This structure contains fields that describe the physical properties of a disk device and specify the addresses of routines within the ramDrv driver. The BLK_DEV structure address should be passed to an XBD wrapper via xbdBlkDevCreate() along with the name of the device. XBDs are the new and preferred method for interfacing with file systems. After the XBD wrapper is created, the file system framework will attempt to identify the type of file system instantiated on the device. If it can not be identified, then it is instantiated with rawFs. The desired file system (dosFs or hrfs) can be instantiated on the ram drive using either dosFsVolFormat(), dosfsDiskFormat(),hrfsFormat(), or hrfsDiskFormat(). The ram drive to be formatted is identified by the name of the device given in the XBD wrapper. EXAMPLE In the following example, a 208-Kbyte RAM disk is created with automatically allocated memory, 512-byte blocks, 32 blocks per track, and no block offset. The device is then initialized for use with dosFs and assigned the name "/ramDrv": BLK_DEV *pBlkDev; pBlkDev = ramDevCreate (NULL, 512, 32, 416, 0); xbdBlkDevCreate (pBlkDev, "/ramDrv"); dosFsVolFormat ("/ramDrv:0", DOS_OPT_BLANK, NULL); The names used in xbdBlkDevCreate() and dosFsVolFormat() are slightly different on purpose. The ":0" is appended to "/ramDrv" by xbdBlkDevCreate() and represents the whole (unpartitioned) disk. If the RAM disk memory already contains a disk image created e
评论
    相关推荐
    • Vxworks.rar
      初学Vxworks时参考的一些资料,分享给大家,目前正在从事相关开发,希望能互相帮助。
    • vxworks开发资料
      从网上搜集的vxworks开发资料,中间少了几个,下面是文档目录,需要的朋友看清楚了再下载 1 BootRom实验.pdf 2 基于目标板的Bootable工程建立.pdf 3 利用u-boot下载VxWorks操作系统.pdf 4 Target Shell的建立.pdf 5 ...
    • vxworks资料大全
      最近在学Vxworks 可是网上资料不是太多,这是找公司同事收集的比较好的资料,包括内核,设备驱动的开发,源码。BSP的开发等。网上的介绍的开发工具都是torbado 很少有介绍workbench的,希望有这方面资料的网友们分享...
    • Vxworks培训讲稿
      一本微缩的VxWorks书,概要的讲述了VxWorks的主要内容,虽然简 单,但有些内容还是比较通俗易懂的,适合总结性学习和初次浏览, 其目录如下:1.VxWorks & Tornado Overview 2.Real Time A&D 3.Programming...
    • VxWorks Netrom实现
      The text assumes knowledge of the Wind River development environment, including VxWorks and the various debugging tools. For additional information about NetROM, refer to the NetROM User’s ...
    • tornado vxworks
      开发源码 vxworks tornado
    • vxworks课件
      VxWorks是美国WindRiver公司于1983年设计开发的一种嵌入式实时操作系统(RTOS),是Tonado II嵌入式开发环境的关键组成部分。良好的持续发展能力、高性能的内核以及友好的用户开发界面,使其在嵌入式操作系统领域占据...
    • vxworks的移植
      VXWORKS移植到S3C4510B的开发板上,非官方版本。 平台是:Tornado2.2(vxworks5.5 version).同时包含个人移植心得,一看即会,避免走弯路。另外附赠移植过程中参考的重要文档。是初学者入门的捷径,按照本人说述 ...
    • vxworks入门.rar
      VXWORKS NEW it may be helpful to the new man studying vxworks os
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路