U-BOOT源码分析及移植(12)

邂逅黄昏 分享 2021-06-02 下载文档

U-BOOT源码分析及移植

ipaddr 定义本地的IP地址

stdin 定义标准输入设备,一般是串口

stdout 定义标准输出设备,一般是串口

stderr 定义标准出错信息输出设备,一般是串口

4)设备相关:

标准IO设备数组?evice_t *stdio_devices[] = { NULL, NULL, NULL };

设备列表 list_t devlist = 0;

device_t的定义:include\devices.h中:

typedef struct {

int flags; /* Device flags: input/output/system */

int ext; /* Supported extensions */

char name[16]; /* Device name */

/* GENERAL functions */

int (*start) (void); /* To start the device */

int (*stop) (void); /* To stop the device */

/* 输出函数 */

void (*putc) (const char c); /* To put a char */

void (*puts) (const char *s); /* To put a string (accelerator) */

/* 输入函数 */

int (*tstc) (void); /* To test if a char is ready... */

int (*getc) (void); /* To get that char */

/* Other functions */

void *priv; /* Private extensions */

} device_t;

u-boot把可以用为控制台输入输出的设备添加到设备列表devlist,并把当前用作标准IO的设备指针加入stdio_devices数组中。

在调用标准IO函数如printf()时将调用stdio_devices数组对应设备的IO函数如putc()。

5)命令相关的数据结构,后面介绍。

6)与具体设备有关的数据结构,


U-BOOT源码分析及移植(12).doc 将本文的Word文档下载到电脑

下一篇:CSS相关学习内容总结

相关推荐
相关阅读
本类排行
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 7 元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xxxxxx QQ:xxxxxx