嵌入式操作系统 2 GNU( 交叉 ) 开发工具链简介 陈香兰 苏州研究院中国科学技术大学 Fall 2014 November 28,

Size: px
Start display at page:

Download "嵌入式操作系统 2 GNU( 交叉 ) 开发工具链简介 陈香兰 苏州研究院中国科学技术大学 Fall 2014 November 28,"

Transcription

1 嵌入式操作系统 2 GNU( 交叉 ) 开发工具链简介 陈香兰 (xlanchen@ustceducn) 苏州研究院中国科学技术大学 Fall 2014 November 28, 2014 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 1 / 111

2 Outline 工欲善其事, 必先利其器 -- 论语 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 2 / 111

3 Outline 1 前言交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 3 / 111

4 Outline 1 前言交叉开发 2 GNU Tools 简介 3 GNU tools 交叉开发环境的安装和试用 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 4 / 111

5 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 5 / 111

6 交叉开发 本地开发 vs 交叉平台开发 1 本地开发 : 一般软件的开发属于本地开发, 即开发软件的系统与运行软件的系统是相同的 2 交叉平台开发 : 本课程所涉及到的嵌入式系统开发属于交叉平台开发, 即开发软件的系统与运行软件的系统不同 交叉开发平台 主机 : 开发软件的平台, 称为主机, 往往是通用电脑 ; 目标机 : 运行软件的平台, 称为目标机, 在这里是嵌入式系统 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 6 / 111

7 嵌入式交叉开发工具 掌握嵌入式开发工具的使用是进行嵌入式开发的前提条件之一 与主流开发工具类似, 嵌入式交叉开发工具也包括 编译器即能够把一个源程序编译生成一个可执行程序的软件调试工具即能够对执行程序进行源码或汇编级调试的软件软件工程工具用于协助多人开发或大型软件项目的管理的软件 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 7 / 111

8 GNU tools GNU tools 和其他一些优秀的开源软件可以完全覆盖上述软件开发工具 为了更好的开发嵌入式系统, 需要熟悉如下一些软件 GCC GNU 编译器集 Binutils 辅助 GCC 的主要软件 Gdb 调试器 make 软件工程工具 diff, patch 补丁工具 CVS 版本控制系统 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 8 / 111

9 Outline 1 前言 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 9 / 111

10 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 10 / 111

11 GCC The GNU Compiler Collection 不仅仅是 C 语言编译器目前,GCC 可以支持多种高级语言, 如 C C++ ADA Objective-C Objective-C++ JAVA Fortran PASCAL 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 11 / 111

12 GCC 下的工具 GCC 下的工具包括 cpp 预处理器 GNU C 编译器在编译前自动使用 cpp 对用户程序进行预处理 gcc 符合 ISO 等标准的 C 编译器 g++ 基本符合 ISO 标准的 C++ 编译器 gcj GCC 的 java 前端 gnat GCC 的 GNU ADA 95 前端等等 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 12 / 111

13 GNU Tools gcc gcc 是一个强大的工具集合, 它包含了预处理器 编译器 汇编器 链接器等组件 它会在需要的时候调用其他组件 输入文件的类型和传递给 gcc 的参数决定了 gcc 调用具体的哪些组件 对于开发者, 它提供的足够多的参数, 可以让开发者全面控制代码的生成, 这对嵌入式系统级的软件开发非常重要 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 13 / 111

14 gcc 使用举例 源程序 :gcctestc #include <stdioh> int main(void) { int i,j; i=0;j=0; i=j+1; printf( Hello World!\n ); printf( i=j+1=%d\n,i); } 编译和运行 gcc o gcctest gcctestc /gcctest 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 14 / 111

15 gcc 的工作过程 如果使用 -v 选项, 则可以看到许多被隐藏的信息 例如 gcc -o gcctest gcctestc -v 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 15 / 111

16 gcc 的编译过程 一般情况下,c 程序的编译过程为 1 预处理 2 编译成汇编代码 3 汇编成目标代码 4 链接 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 16 / 111

17 1 预处理 预处理 : 使用 -E 参数输出文件的后缀为 cpp gcc -E -o gcctestcpp gcctestc 使用 wc 命令比较预处理后的文件与源文件, 可以看到两个文件的差异 wc 命令 :wc gcctestc gcctestcpp gcctestc gcctestcpp 总用量 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 17 / 111

18 关于 wc 命令 wc help 用法 :wc [ 选项 ] [ 文件 ] 或 :wc [ 选项 ] files0-from=f Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified With no FILE, or when FILE is -, read standard input A word is a non-zero-length sequence of characters delimited by white space The options below may be used to select which counts are printed, always in the following order: newline, word, character, byte, maximum line length -c, bytes print the byte counts -m, chars -l, lines files0-from= 文件 -L, max-line-length -w, words help version print the character counts print the newline counts 从指定文件读取以 NUL 终止的名称, 如果该文件被 指定为 - 则从标准输入读文件名 显示最长行的长度 显示单词计数 显示此帮助信息并退出 显示版本信息并退出 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 18 / 111

19 2 编译成汇编代码 预处理文件 汇编代码 1 使用 -x 参数说明根据指定的步骤进行工作, cpp-output 指明从预处理得到的文件开始编译 2 使用 -S 说明生成汇编代码后停止工作 gcc -x cpp-output -S -o gcctests gcctestcpp 也可以直接编译到汇编代码 gcc -S gcctestc 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 19 / 111

20 3 编译成目标代码 汇编代码 目标代码 gcc -x assembler -c gcctests 直接编译成目标代码 gcc -c gcctestc 使用汇编器生成目标代码 as -o gcctesto gcctests 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 20 / 111

21 4 编译成执行代码 目标代码 执行代码 gcc -o gcctest gcctesto 直接生成执行代码 gcc -o gcctest gcctestc 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 21 / 111

22 gcc 的高级选项 -Wall: 打开所有的警告信息 gcc -o gcctest gcctestc -Wall gcctestc: In function main : gcctestc:8:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 22 / 111

23 gcc 的高级选项 根据警告信息检查源程序 源程序 :gcctestc #include <stdioh> int main(void){ int i,j; i=0;j=0; i=j+1; printf( Hello World!\n ); printf( i=j+1=%d\n,i); } Main 函数的返回值为 int 在函数的末尾应当添加返回一个值 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 22 / 111

24 gcc 的高级选项修改源程序 源程序 ( 修改 ):gcctestc #include <stdioh> int main(void){ int i,j; i=0;j=0; i=j+1; printf( Hello World!\n ); printf( i=j+1=%d\n,i); return 0; } 再次运行命令 : 无上述警告信息 gcc -o gcctest gcctestc -Wall 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 22 / 111

25 优化编译 优化编译选项有 : -O0 缺省情况, 不优化 -O1 -O2 -O3 等等 不同程度的优化不同的优化内容 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 23 / 111

26 gcc 的优化编译举例 源代码 :mytestc #include <stdioh> #include <mathh> int main(void) { int i,j; double k=00,k1,k2,k3; k1=k2=k3=10; for (i=0;i<50000;i++) for (j=0;j<50000;j++) { k+=k1+k2+k3; k1 += 05; k2 += 02; k3 = k1+k2; k3 -= 01; } return 0; } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 24 / 111

27 gcc 的优化编译举例 使用不同的优化选项, 分别生成不同的可执行文件 gcc -O0 -o m0 mytestc gcc -O1 -o m1 mytestc gcc -O2 -o m2 mytestc gcc -O3 -o m3 mytestc 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 24 / 111

28 gcc 的优化编译举例 使用 time 命令统计程序的运行 time /m0 real 0m17068s user 0m17056s sys 0m0000s time /m1 real 0m1720s user 0m1716s sys 0m0000s time /m2 real 0m0001s user 0m0000s sys 0m0000s time /m3 real 0m0001s user 0m0000s sys 0m0000s 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 24 / 111

29 gcc 的优化编译举例 一个以前机器上的结果 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 24 / 111

30 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 25 / 111

31 GNU binutils I binutils 是一组二进制工具程序集, 是辅助 GCC 的主要软件主要包括 1 addr2line 把程序地址转换为文件名和行号 在命令行中给它一个地址和一个可执行文件名, 它就会使用这个可执行文件的调试信息指出在给出的地址上是哪个文件以及行号 2 ar 建立 修改 提取归档文件 归档文件是包含多个文件内容的一个大文件, 其结构保证了可以恢复原始文件内容 3 as GNU 汇编器, 主要用来编译 GNU C 编译器 gcc 输出的汇编文件, 它将汇编代码转换成二进制代码, 并存放到一个 object 文件中, 该目标文件将由连接器 ld 连接 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 26 / 111

32 GNU binutils II 4 C++filt 解码 C++ 符号名, 连接器使用它来过滤 C++ 和 Java 符号, 防止重载函数冲突 5 gprof 显示程序调用段的各种数据 6 ld 是连接器, 它把一些目标和归档文件结合在一起, 重定位数据, 并链接符号引用, 最终形成一个可执行文件 通常, 建立一个新编译程序的最后一步就是调用 ld 7 nm 列出目标文件中的符号 8 objcopy 把一种目标文件中的内容复制到另一种类型的目标文件中 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 27 / 111

33 GNU binutils III 9 objdump 显示一个或者更多目标文件的信息 使用选项来控制其显示的信息 它所显示的信息通常只有编写编译工具的人才感兴趣 10 ranlib 产生归档文件索引, 并将其保存到这个归档文件中 在索引中列出了归档文件各成员所定义的可重分配目标文件 11 readelf 显示 elf 格式可执行文件的信息 12 size 列出目标文件每一段的大小以及总体的大小 默认情况下, 对于每个目标文件或者一个归档文件中的每个模块只产生一行输出 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 28 / 111

34 GNU binutils IV 13 strings 打印某个文件的可打印字符串, 这些字符串最少 4 个字符长, 也可以使用选项 -n 设置字符串的最小长度 默认情况下, 它只打印目标文件初始化和可加载段中的可打印字符 ; 对于其它类型的文件它打印整个文件的可打印字符, 这个程序对于了解非文本文件的内容很有帮助 14 strip 丢弃目标文件中的全部或者特定符号 15 libiberty 包含许多 GNU 程序都会用到的函数, 这些程序有 : getopt, obstack, strerror, strtol 和 strtoul 16 libbfd 二进制文件描述库 17 libopcodes 用来处理 opcodes 的库, 在生成一些应用程序的时候也会用到它, 比如 objdumpopcodes 是文本格式可读的处理器操作指令 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 29 / 111

35 binutils 开发工具使用举例 1 ar 2 nm 3 Objcopy 4 Objdump 5 readelf 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 30 / 111

36 1 ar ar 用于建立 修改 提取归档文件 (archive) 一个归档文件, 是包含多个被包含文件的单个文件 ( 也可以认为归档文件是一个库文件 ) 被包含的原始文件的内容 权限 时间戳 所有者等属性都保存在归档文件中, 并且在提取之后可以还原 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 31 / 111

37 使用 ar 建立库文件 源程序 addc // addc int Add(int a, int b) { int result; result = a+b; return result; } Step1: 使用命令 源程序 minusc // minusc int Minus(int a, int b) { int result; result = a-b; return result; } gcc -c addc minusc 生成 addo 和 minuso 两个目标文件 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 32 / 111

38 使用 ar 建立库文件 step2: 使用命令 ar rv libtesta addo minuso 生成库文件 libtesta, 并使用命令 复制到 /usr/lib/ 目录下 ar rv libtesta addo minuso ar: 正在创建 libtesta a - addo sudo cp libtesta /usr/lib/ a - minuso sudo cp libtesta /usr/lib/ 关于 ar 命令 : r - replace existing or insert new file(s) into the archive v - be verbose 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 32 / 111

39 库文件使用举例 : step1: 在代码中使用 Add 和 Minus 函数 源代码 testc #include <stdioh> int main(void) { int a=8; int b=3; printf( a=%d\tb=%d\n,a,b); int sum = Add(a,b); printf( a+b=%d\n,sum); int cha = Minus(a,b); printf( a-b=%d\n,cha); return 0; } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 33 / 111

40 库文件使用举例 : step2: 在编译时指定库文件 在链接时, 使用 -l<name> 选项来指明库文件 step3: 运行 /test a=8 b=3 a+b=11 a-b=5 gcc -o test testc -ltest 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 33 / 111

41 2 nm nm 的主要功能是列出目标文件中的符号 程序员可以使用此工具定位和分析执行程序和目标文件中的符号信息和它的属性 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 34 / 111

42 nm 显示的符号类型 A: 符号的值是绝对值, 并且不会被将来的链接所改变 B: 符号位于未初始化数据部分 (BSS 段 ) C: 符号是公共的 公共符号是未初始化的数据 在链接时, 多个公共符号可能以相同的名字出现 如果符号在其他地方被定义, 则该文件中的这个符号会被当作引用来处理 D: 符号位于已初始化的数据部分 T: 符号位于代码部分 U: 符号未被定义?: 符号类型未知, 或者目标文件格式特殊 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 35 / 111

43 nm 使用举例 1 分别查看 addo 和 minuso 中的符号 nm addo minuso addo: T Add minuso: T Minus 2 重新编译 testc 为 testo, 然后查看 testo 的符号 gcc -c testc nm testo U Add T main U Minus U printf 作业 : 使用 nm 列出可执行文件 test 的符号, 与 testo 进行比较 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 36 / 111

44 3 objcopy 可以将一种格式的目标文件内容进行转换, 并输出为另一种格式的目标文件 它使用 GNU BFD(binary format description) 库读 / 写目标文件, 通过这个 BFD 库,objcopy 能以一种不同于源目标文件的格式生成新的目标文件 objcopy -h 在 makefile 里面用 -o binary 选项来生成原始的二进制文件, 即通常说的 image 文件 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 37 / 111

45 Objcopy 使用举例 step1: 查看可执行文件 test 的文件类型相关信息 在 ubuntu-1404 中, 命令 :file test test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2624, BuildID[sha1]=f2eaec4b4747af071d6b309f2d1 3cff079a9f1bb, not stripped step2: 将 test 分别转换为 srec 格式的文件 ts 和 bianry 格式的文件 testbin objcopy -O srec test ts objcopy -O binary test testbin step3: 使用 file 命令查看 ts 和 testbin 的文件类型信息 file ts ṭs: Motorola S-Record; binary data in text format file testbin ṭestbin: data 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 38 / 111

46 文件格式 aout: assembler and link editor output 汇编器和链接编辑器的输出 coff common object file format 一种通用的对象文件格式 ELF excutive linked file Linux 系统所采用的一种通用文件格式, 支持动态连接 ELF 格式可以比 COFF 格式包含更多的调试信息 Flat elf 格式有很大的文件头,flat 文件对文件头和一些段信息做了简化 µclinux 系统使用 flat 可执行文件格式 SREC MOTOROLA S-Recoder 格式 (S 记录格式文件 ) 等等 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 39 / 111

47 4 objdump 显示一个或多个目标文件的信息, 由其选项来控制显示哪些信息 一般来说,objdump 只对那些要编写编译工具的程序员有帮助, 但是我们通过这个工具可以方便的查看执行文件或者库文件的信息 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 40 / 111

48 Objdump 使用举例 1 -f 选项显示文件头的内容 objdump -f test test: 文件格式 elf32-i386 体系结构 :i386, 标志 0x : EXEC_P, HAS_SYMS, D_PAGED 起始地址 0x objdump -f ts ts: 文件格式 srec 体系结构 :UNKNOWN!, 标志 0x : 起始地址 0x objdump -f testbin ọbjdump: testbin: 不可识别的文件格式 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 41 / 111

49 Objdump 使用举例 2 -d 选项进行反汇编 objdump -d addo addo: 文件格式 elf32-i386 Disassembly of section text: <Add>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 10 sub $0x10,%esp 6: 8b 45 0c mov 0xc(%ebp),%eax 9: 8b mov 0x8(%ebp),%edx c: 01 d0 add %edx,%eax e: fc mov %eax,-0x4(%ebp) 11: 8b 45 fc mov -0x4(%ebp),%eax 14: c9 leave 15: c3 ret 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 41 / 111

50 5 readelf readelf: 显示一个或多个 ELF 格式的目标文件信息 例如 :readelf -h test ELF 头 : Magic: 7f 45 4c Class: ELF32 Data: 2 s complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC ( 可执行文件 ) Machine: Intel Version: 入口点地址 : 程序头起点 : Start of section headers: 标志 : 本头的大小 : 52 ( 字节 ) 程序头大小 : 32 ( 字节 ) Number of program headers: 9 节头大小 : 40 ( 字节 ) 节头数量 : 30 字符串表索引节头 : 27 0x1 0x (bytes into file) 4428 (bytes into file) 0x0 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 42 / 111

51 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 43 / 111

52 GNU Toolchain gdb Gdb = GNU debuger GNU tools 中的调试器, 功能强大 设置断点监视 修改变量单步执行显示 / 修改寄存器的值堆栈查看远程调试 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 44 / 111

53 gdb 使用举例 源代码 bugc #include <stdioh> #include <stdlibh> static char buff[256]; static char* string; int main(void){ printf( input a string: ); scanf( %s\n,string); printf( \n Your string is:%s\n,string); return 0; } 编译并运行 : gcc -o bug bugc /bug input a string:hello 段错误 ( 核心已转储 ) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 45 / 111

54 使用 gdb 调试 bug gdb bug (gdb) run Starting program: /home/xlanchen/workspace/gdb_test/bug input a string:hello Program received signal SIGSEGV, Segmentation fault _IO_gets (buf=0x0) at iogetsc:54 54 iogetsc: 没有那个文件或目录 (gdb) list 49 in iogetsc 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 46 / 111

55 静态编译 bugc 并调试 gcc -static -o bug bugc (gdb) run Starting program: /home/xlanchen/workspace/gdb_test/bug input a string:hello Program received signal SIGSEGV, Segmentation fault 0x0804f75a in gets () (gdb) where #0 0x0804f75a in gets () #1 0x08048e66 in main () 能否查看 bugc 源代码? 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 47 / 111

56 使用 gcc 的 -g 参数生成调试信息 gcc -g -static -o bug bugc (gdb) run Starting program: /home/xlanchen/workspace/gdb_test/bug input a string:hello Program received signal SIGSEGV, Segmentation fault 0x0804f75a in gets () (gdb) list 1 #include <stdioh> 2 #include <stdlibh> 3 4 static char buff[256]; 5 static char* string; 6 7 int main(void){ 8 printf( input a string: ); 9 gets(string); 10 printf( \n Your string is:%s\n,string); (gdb) print string $1 = 0x0 (gdb) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 48 / 111

57 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 49 / 111

58 使用 GNU make 管理项目 GNU I make 是一种代码维护工具, 在使用 GNU 编译器开发大型应用时, 往往要使用 make 管理项目 如果不使用 make 管理项目, 就必须重复使用多个复杂的命令行维护项目和生成目标代码 Make 通过将命令行保存到 makefile 中简化了编译工作 Make 的主要任务是根据 makefile 中定义的规则和步骤, 根据各个模块的更新情况, 自动完成整个软件项目的维护和代码生成工作 Make 可以识别出 makefile 中哪些文件已经被修改, 并且在再次编译的时候只编译这些文件, 从而提高编译的效率 Make 会检查文件的修改和生成时间戳, 如果目标文件的修改或者生成时间戳比它的任意一个依赖文件旧, 则 make 就执行 makefile 文件中描述的相应命令, 以便更新目的文件只更新那些需要更新的文件, 而不重新处理那些并不过时的文件 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 50 / 111

59 使用 GNU make 管理项目 GNU II 特点 : 适合于支持多文件构成的大中型软件项目的编译 链接 清除中间文件等管理工作提供和识别多种默认规则, 方便对大型软件项目的管理支持对多目录的软件项目进行递归管理对软件项目具有很好的可维护性和扩展性 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 51 / 111

60 makefile Makefile 告诉 make 该做什么 怎么做 makefile 主要定义了 1 依赖关系即有关哪些文件的最新版本是依赖于哪些别的文件产生或者组成的 2 需要用什么命令来产生目标文件的最新版本 3 以及一些其他的功能 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 52 / 111

61 Makefile 的规则 规则 一条规则包含 3 个方面的内容, 1 要创建的目标 ( 文件 ) 2 创建目标 ( 文件 ) 所依赖的文件列表 ; 3 通过依赖文件创建目标文件的命令组 规则一般形式 target : prerequisites <tab>command <tab> <tab> 例如 test:testc;gcc -O -o test testc 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 53 / 111

62 一个简单的 makefile edit : maino kbdo commando displayo inserto \ searcho fileso utilso cc -o edit maino kbdo commando displayo inserto \ searcho fileso utilso maino : mainc defsh cc -c mainc kbdo : kbdc defsh commandh cc -c kbdc commando : commandc defsh commandh cc -c commandc displayo : displayc defsh bufferh cc -c displayc inserto : insertc defsh bufferh cc -c insertc searcho : searchc defsh bufferh cc -c searchc fileso : filesc defsh bufferh commandh cc -c filesc utilso : utilsc defsh cc -c utilsc clean : rm edit maino kbdo commando displayo inserto \ searcho fileso utilso 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 54 / 111

63 Make 的工作过程 default goal 在缺省的情况下,make 从 makefile 中的第一个目标开始执行 Make 的工作过程类似一次深度优先遍历过程 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 55 / 111

64 Makefile 中的变量 使用变量可以 降低错误风险简化 makefile 例 :objects 变量 ($(objects)) objects = maino kbdo commando \ displayo inserto searcho fileso utilso edit : $(objects) cc -o edit $(objects) 有点像环境变量 环境变量在 make 过程中被解释成 make 的变量 可以被用来 贮存一个文件名列表 贮存可执行文件名 如用变量代替编译器名 贮存编译器 FLAG 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 56 / 111

65 预定义变量 Make 使用了许多预定义的变量, 如 AR AS CC CXX CFLAGS CPPFLAGS 等等 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 57 / 111

66 简化后的 makefile 文件 objects = maino kbdo commando displayo \ inserto searcho fileso utilso edit : $(objects) cc -o edit $(objects) maino : defsh kbdo : defsh commandh commando : defsh commandh displayo : defsh bufferh inserto : defsh bufferh searcho : defsh bufferh fileso : defsh bufferh commandh utilso : defsh PHONY : clean clean : rm edit $(objects) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 58 / 111

67 内部变量 扩展成当前规则的目的文件名 $< 扩展成依赖列表中的第一个依赖文件 $^ 扩展成整个依赖列表 ( 除掉了里面所有重复的文件名 ) 等等 不需要括号括住 例如 : CC = gcc CFLAGS = -Wall -O -g fooo : fooc fooh barh $(CC) $(CFLAGS) -c $< -o $@ 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 59 / 111

68 隐含规则 (Implicit Rules) 内置的规则告诉 make 当没有给出某些命令的时候, 应该怎么办 用户可以使用预定义的变量改变隐含规则的工作方式, 如 一个 C 编译的具体命令将会是 : $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 60 / 111

69 设定目标 (Phony Targets) 设定目标 目标不是一个文件其目的是为了让一些命令得以执行 使用 PHONY 显式声明设定目标 PHONY: clean 使用设定目标实现多个目的 all: prog1 prog2 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 61 / 111

70 典型的设定目标 设定目标也可以用来描述一些其他的动作 例如, 想把中间文件和可执行文件删除, 可以在 makefile 里设立这样一个规则 : clean: rm *o exec_file 前提是没有其它的规则依靠这个 clean 目标, 它将永远不会被执行 但是, 如果你明确的使用命令 make clean, make 会把这个目标做为它的主要目标, 执行那些 rm 命令 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 62 / 111

71 Makefile 中的函数 (Functions) I 用来计算出要操作的文件 目标或者要执行的命令 使用方法 : $(function arguments) 几个典型函数 1 $(substfrom,to,text) 例如 : $(subst ee,ee,feet on the street) 相当于 feet on the street 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 63 / 111

72 Makefile 中的函数 (Functions) II 2 $(patsubst pattern,replacement,text) 例如 : $(patsubst %c,%o,xcc barc) 相当于 xco baro 3 $(wildcard pattern) 例如 : $(wildcard *c) 又如 : objects := $(wildcard *o) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 64 / 111

73 makefile 中的条件语句 or conditional-directive text-if-true endif conditional-directive text-if-true else text-if-false endif 四种条件语句 ifeqelseendif ifneq else endif ifndef else endif ifndefelse endif 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 65 / 111

74 实际项目中的 makefiles 找到 Linux 或者 µclinux 源代码中所有的 makefile, 分析它们的功能 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 66 / 111

75 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 67 / 111

76 GNU Tools ld ld,the GNU Linker Linux 上常用的链接器 ld 软件的作用是把各种目标文件 (o 文件 ) 和库文件链接在一起, 并定位数据和函数地址, 最终生成可执行程序 gcc 可以间接的调用 ld, 使用 gcc 的 -Wl 参数可以传递参数给 ld 使用下面的命令可以列出 ld 常用的一些选项 : ld --help 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 68 / 111

77 ld 使用举例 I 源程序 //helloc #include <stdioh> int main(void) { } printf( \n\nhello World!\n\n ); 编译 helloc 到 helloo gcc -c helloc 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 69 / 111

78 ld 使用举例 II 链接 ( 在 ubuntu-1404 中 ) ld -dynamic-linker /lib/ld-linuxso2 /usr/lib/i386-linux-gnu/crt1o /usr/lib/i386-linux-gnu/crtio /usr/lib/i386-linux-gnu/crtno helloo -lc -o hello 运行 /hello 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 70 / 111

79 目标文件 ld 通过 BFD 库可以读取和操作 coff elf aout 等各种执行文件格式的目标文件 BFD(Binary File Descriptor) 目标文件 (object file) 由多个节 (section) 组成, 常见的节有 : text 节保存了可执行代码, data 节保存了有初值的全局标量, bss 节保存了无初值的全局变量 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 71 / 111

80 使用 objdump 查看目标文件的信息 objdump hhelloo helloo: 文件格式 elf32-i386 节 : Idx Name Size VMA LMA File off Algn 0 text **0 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 data b 2**0 CONTENTS, ALLOC, LOAD, DATA 2 bss b 2**0 ALLOC 3 rodata f b 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 comment a 2**0 CONTENTS, READONLY 5 notegnu-stack f 2**0 CONTENTS, READONLY 6 eh_frame **2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA 作业 : 比较 hello 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 72 / 111

81 链接描述文件 ( Linker script ) 可以使用链接描述文件控制 ld 的链接过程 链接描述文件,command file 又称为链接脚本,Linker script 用来控制 ld 的链接过程 描述各输入文件的各节如何映射到输出文件的各节控制输出文件中各个节或者符号的内存布局 使用的语言为 : The ld command language, 链接命令语言 ld 命令的 -T commandfile 选项指定了链接描述文件名 如果不指定链接描述文件,ld 就会使用一个默认的描述文件来产生执行文件 作业 : 找到 Linux 或者 µclinux 中的链接描述文件并分析 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 73 / 111

82 链接描述文件的命令 链接描述文件的命令主要包括如下几类 : 设置入口点命令处理文件的命令处理文件格式的命令其他 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 74 / 111

83 常用的命令 设置入口点 格式 : ENTRY(symbol) 设置 symbol 的值为执行程序的入口点 ld 有多种方法设置执行程序的入口点, 确定程序入口点的顺序如下 : ld 命令的 -e 选项指定的值 Entry(symbol) 指定的值 text 节的起始地址 入口点为 0 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 75 / 111

84 常用的命令 包含其他 filename 的链接描述文件 INCULDE filename 指定多个输入文件名 INPUT(file,file, ) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 76 / 111

85 常用的命令 指定输出文件的格式 OUTPUT_FORMAT(bfdname) 指定目标机器体系结构 OUTPUT_ARCH ( bfdname ) 例如 : OUTPUT_ARCH(arm) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 77 / 111

86 常用的命令 MEMORY: 这个命令在用于嵌入式系统的链接描述文件中经常出现, 它描述了各个 MEMORY { name [(attr)]:origin = origin,length = len } 例如 : MEMORY { rom : ORIGIN=0x1000, LENGTH=0x1000 } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 78 / 111

87 Memory 举例 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 79 / 111

88 SECTIONS 命令 I SECTIONS 告诉 ld 如何把输入文件的各个节映射到输出文件的各个节中 在一个链接描述文件中只能有一个 SECTIONS 命令 在 SECTIONS 命令中可以使用的命令有三种 : 定义入口点赋值定义输出节 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 80 / 111

89 SECTIONS 命令 II 定义输出节 SECTIONS { secname : { contents } } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 81 / 111

90 SECTIONS 命令 III 例如 : SECTIONS { ROM:{*(text)}>rom } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 82 / 111

91 定位计数器 定位计数器,The Location Counter 一个特殊的 ld 变量, 使用 表示总是在 SECTIONS 中使用 例如 : SECTIONS { output: { file1(text); = ; file2(text); = ; file3(text); } = 0x1234; } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 83 / 111

92 一个简单例子 下面是一个简单的例子 : 例中, 输出文件包含 text,data,bss 三个节, 而输入文件也只包含这 3 个节 : SECTIONS { =0x ; text:{*(text)}; =0x ; data:{*(data)}; bss:{*(bss)}; } 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 84 / 111

93 SECTIONS 举例 ( 对应于上面的 MEMORY 例子 ) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 85 / 111

94 linux-2626, ARCH=arm 作业 : 分析链接描述文件 ( 提交电子版 ) Vmlinux: arch/$(arch)/kernel/vmlinuxlds 制作压缩版映像时 : linux/arch/arm/boot/compressed/vmlinuxlds 制作 bootp 时 : linux/arch/arm/boot/bootp/bootplds 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 86 / 111

95 Outline 1 前言 2 GNU Tools 简介 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 87 / 111

96 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 88 / 111

97 GNU tools 交叉开发环境的安装 交叉开发环境 源代码配置安装,or 直接安装二进制工具 第一种方法比较复杂, 如果有现成的二进制交叉环境, 建议直接使用 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 89 / 111

98 使用源代码安装交叉开发环境 GNU tools 的各个软件包相对独立, 在选择时要注意各个软件包的版本号及其依赖关系如果全部是最新版本, 也并不能保证可以配置并安装成功 在安装 GNU tools 交叉开发环境之前, 首先必须建立本地 GNU tools 环境 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 90 / 111

99 一个可行的 GNU tools 与 Linux 内核之间关系表 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 91 / 111

100 交叉开发环境的安装顺序 需要 5 个步骤完成整个 GNU Tools 的配置 / 编译 / 安装 : 1 内核头文件配置 2 binutils 软件包安装 3 Bootstrap GNU 编译器 ( 可完成基本 C 语言编译工作的编译器 ) 4 C library 的安装, 一般是 glibc 5 完整的 GNU 编译器安装 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 92 / 111

101 软件包安装步骤 对每个单独的软件包, 一般安装过程包括下面 4 步 下载并解压软件包配置软件包编译软件包安装软件包 在 kubuntu 等环境下, 有些交叉环境也可以使用 apt-get 等命令安装 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 93 / 111

102 安装现成的二进制交叉环境 根据来源, 可以有 2 种 : 1 安装 ubuntu-1404 源自带的交叉编译环境 2 安装其他现成的二进制交叉编译环境 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 94 / 111

103 1 安装 ubuntu-1404 源自带的交叉编译环境 安装 Ubuntu-1404 中自带的交叉编译工具 : sudo apt-get install gcc-arm-linux-gnueabi 查看是否安装成功 : arm-linux-gnueabi-<tab> arm-linux-gnueabi-<tab> arm-linux-gnueabi-addr2line arm-linux-gnueabi-ar arm-linux-gnueabi-as arm-linux-gnueabi-c++filt arm-linux-gnueabi-cpp arm-linux-gnueabi-cpp-47 arm-linux-gnueabi-dwp arm-linux-gnueabi-elfedit arm-linux-gnueabi-gcc arm-linux-gnueabi-gcc-47 arm-linux-gnueabi-gcc-ar-47 arm-linux-gnueabi-gcc-nm-47 arm-linux-gnueabi-gcc-ranlib-47 arm-linux-gnueabi-gcov arm-linux-gnueabi-gcov-47 arm-linux-gnueabi-gprof arm-linux-gnueabi-ld arm-linux-gnueabi-ldbfd arm-linux-gnueabi-ldgold arm-linux-gnueabi-nm arm-linux-gnueabi-objcopy arm-linux-gnueabi-objdump arm-linux-gnueabi-ranlib arm-linux-gnueabi-readelf arm-linux-gnueabi-size arm-linux-gnueabi-strings arm-linux-gnueabi-strip 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 95 / 111

104 1 安装 ubuntu-1404 源自带的交叉编译环境查看交叉编译器的版本信息 arm-linux-gnueabi-gcc -v arm-linux-gnueabi-gcc -v 使用内建 specs COLLECT_GCC=arm-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/47/lto-wrapper 目标 :arm-linux-gnueabi 配置为 :/src/configure -v with-pkgversion= Ubuntu/Linaro ubuntu1 with-bugurl=file:///usr/share/doc/gcc-47/readmebugs enable-languages=c,c++,go,fortran,objc,obj-c++ prefix=/usr program-suffix=-47 enable-shared enable-linker-build-id libexecdir=/usr/lib without-included-gettext enable-threads=posix with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/473 libdir=/usr/lib enable-nls with-sysroot=/ enable-clocale=gnu enable-libstdcxx-debug enable-gnu-unique-object disable-libmudflap disable-libitm enable-plugin with-system-zlib enable-objc-gc with-cloog enable-cloog-backend=ppl disable-cloog-version-check disable-ppl-version-check enable-multiarch enable-multilib disable-sjlj-exceptions with-arch=armv5t with-float=soft disable-werror enable-checking=release build=i686-linux-gnu host=i686-linux-gnu target=arm-linux-gnueabi program-prefix=arm-linux-gnueabi- includedir=/usr/arm-linux-gnueabi/include 线程模型 :posix 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 95 / 111 gcc 版本 473 (Ubuntu/Linaro ubuntu1)

105 2 安装其他现成的二进制交叉编译环境 以 arm-elf-tools 为例, 其他用到时再说 下载 arm-elf-tools 的最新版本或合适的版本如 :arm-elf-tools sh 安装 地址 1:arm-elf-tools sh 或者 :arm-elf-tools sh 在 root 权限下运行 sh /arm-elf-tools sh 这个命令会在开发主机上自动建立一个 µclinux-arm 的交叉编译环境 陈香兰 ( 苏州研究院中国科学技术大学 November 28, Fall ) 96 / 111

106 安装成功? I 检查一下 arm-elf-<tab> xlanchen@xlanchen-system-product-name:~/workspace$ arm-elfarm-elf-addr2line arm-elf-gasp arm-elf-protoize arm-elf-ar arm-elf-gcc arm-elf-ranlib arm-elf-as arm-elf-gdb arm-elf-readelf arm-elf-c++ arm-elf-ld arm-elf-run arm-elf-c++filt arm-elf-ldreal arm-elf-size arm-elf-elf2flt arm-elf-nm arm-elf-strings arm-elf-flthdr arm-elf-objcopy arm-elf-strip arm-elf-g++ arm-elf-objdump arm-elf-unprotoize xlanchen@xlanchen-system-product-name:~/workspace$ arm-elf- 对 arm-elf 运用 shell 的 tab 功能可以看到一系列 arm-elf 打头的程序, 如 binutils 系列 gcc gdb 等等 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 97 / 111

107 安装成功? II 运行 arm-elf-gcc -v arm-elf-gcc -v Reading specs from /usr/local/lib/gcc-lib/arm-elf/2953/specs gcc version (release)(coldfire patches from XIP and shared lib patches from 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 98 / 111

108 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, Fall ) 99 / 111

109 使用安装好的交叉编译器编译 hello helloc 循环输出 HelloWorld! #include <stdioh> int main(void){ while(1) printf( HelloWorld!\n ); return 0; } 分别使用几个不同的编译器编译 helloc gcc -o hello0 helloc arm-linux-gnueabi-gcc -o hello1 helloc arm-elf-gcc -elf2flt -o hello2 helloc 问题 :hello1 和 hello2 是否能在主机上直接运行? 为什么? 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 100 / 111

110 使用安装好的交叉编译器编译 hello file hello0 hello0: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2624, BuildID[sha1]=a34dd50d bc8a7b3a61ffe d2e8ded77f18, not stripped file hello1 hello1: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2632, BuildID[sha1]=e1c7864cacb6b576c1d48bc116d7 191d72614c83, not stripped file hello2 ḥello2: BFLT executable - version 4 ram 问题 :hello1 和 hello2 能在什么样的平台上运行? 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 100 / 111

111 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 101 / 111

112 使用安装好的交叉编译器编译 linux 尝试一下缺省编译 cd linux-2626 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabis3c2410_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- 编译的产物 : 源代码根目录下的 vmlinux arch/arm/boot/zimage 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 102 / 111

113 Outline 1 前言 交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 103 / 111

114 编译 µclinux: 1 准备交叉编译环境 I 1 下载 arm-linux-tools targz 2 在主机的系统根目录下或在当前目录下解压缩 sudo tar zvxf arm-linux-tools targz 3 查看安装是否成功 /usr/local/bin/arm-linux-<tab> arm-linux-addr2line arm-linux-g77 arm-linux-jv-scan arm-linux-addr2nameawk arm-linux-gcc arm-linux-ld arm-linux-ar arm-linux-gcc-344 arm-linux-ldreal arm-linux-arm-linux-gcjh arm-linux-gccbug arm-linux-nm arm-linux-as arm-linux-gcj arm-linux-objcopy arm-linux-c++ arm-linux-gcjh arm-linux-objdump arm-linux-c++filt arm-linux-gcov arm-linux-ranlib arm-linux-cpp arm-linux-gnatbind arm-linux-readelf arm-linux-elf2flt arm-linux-grepjar arm-linux-size arm-linux-flthdr arm-linux-jar arm-linux-strings arm-linux-g++ arm-linux-jcf-dump arm-linux-strip 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 104 / 111

115 编译 µclinux: 1 准备交叉编译环境 II 4 查看版本信息 /usr/local/bin/arm-linux-gcc -v Reading specs from /home/xlanchen/workspace/usr/local/bin//lib/gcc/arm-linux/344/specs Configured with: /configure target=arm-linux disable-shared prefix=/usr/local with-headers=/home/gerg/new-waveixdp425/linux-24x/include with-gnu-as with-gnu-ld enable-multilib Thread model: posix gcc version 344 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 105 / 111

116 编译 µclinux: 2 配置并编译 µclinux 1 下载源代码 uclinux-dist tarbz2 2 解压缩 3 配置并编译 tar -jvxf uclinux-dist tarbz2 export LDLIBS=-ldl( 可能需要 ) ( 还可能需要安装一些软件, 请根据错误信息提示安装所需软件 ) make xconfig (1) 在 vendor/product 选项中选择 GDB/ARMulator (2)Kernel 版本选择 24x (3) 其他选项不变 ( 使用缺省选项 ) make dep; make 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 106 / 111

117 编译 µclinux: 2 配置并编译 µclinux 4 查看编译出来的内核映像 images 目录下 : images/ bootrom linux romfs-instlog linux-24x 目录下 :linux 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 106 / 111

118 编译 µclinux: 3 运行 uclinux 的内核 ( 不使用根文件系统 ) 编写 skyeyeconf, 内容如下 : skyeyeconf #skyeye config file sample cpu: arm7tdmi mach: at91 mem_bank: map=m, type=rw, addr=0x , size=0x mem_bank: map=m, type=rw, addr=0x , size=0x mem_bank: map=i, type=rw, addr=0xf , size=0x 运行 : skyeye -e linux -c skyeyeconf 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 107 / 111

119 Outline 1 前言 2 GNU Tools 简介 3 GNU tools 交叉开发环境的安装和试用 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 108 / 111

120 小结 1 前言交叉开发 2 GNU Tools 简介 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 3 GNU tools 交叉开发环境的安装和试用 GNU tools 交叉开发环境的安装使用安装好的交叉编译器编译 hello 使用安装好的交叉编译器编译 linux 编译 µclinux 4 小结和作业 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 109 / 111

121 作业 : 1 在课件中 2 注意 : 两个对链接描述文件的分析作业, 选择 Linux/µClinux/armlinux 的一个就可以了 ( 推荐 :armlinux) 陈香兰 (xlanchen@ustceducn) ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 110 / 111

122 Thanks! The end 陈香兰 ( 苏州研究院中国科学技术大学 November 28, 2014 Fall 2014) 111 / 111

前言 GNU Tools 简介小结和作业.... Linux 操作系统分析 2 GNU 开发工具链简介 陈香兰 苏州研究院中国科学技术大学 Spring 陈香兰 (xlanche

前言 GNU Tools 简介小结和作业.... Linux 操作系统分析 2 GNU 开发工具链简介 陈香兰  苏州研究院中国科学技术大学 Spring 陈香兰 (xlanche 2 GNU 开发工具链简介 陈香兰 (xlanchen@ustceducn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Spring 2010 陈香兰 (xlanchen@ustceducn) 工欲善其事, 必先利其器 -- 论语 陈香兰 (xlanchen@ustceducn) Outline 1 2 GNU Tools 简介 3 小结和作业 陈香兰 (xlanchen@ustceducn)

More information

Linux 操作系统分析 Linux 操作系统分析 2 GNU 开发工具链简介 陈香兰 苏州研究院中国科学技术大学 Spring

Linux 操作系统分析 Linux 操作系统分析 2 GNU 开发工具链简介 陈香兰  苏州研究院中国科学技术大学 Spring 2 GNU 开发工具链简介 陈香兰 (xlanchen@ustc.edu.cn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Spring 2011 工欲善其事, 必先利其器 -- 论语 Outline 前言 GCC GNU binutils Gdb 调试器 GNU make 软件工程工具 GNU ld 链接器 小结和作业 前言 GNU tools GNU tools

More information

Outline 1 SkyEye 简介 2 SkyEye 的安装 SkyEye 的安装试用 skyeye 下载 skyeye 源代码, 编译并安装 3 启动 Linux 执行自己的程序添加 hello 到 uclinux 的根文件系统中在 ArmLinux 中运行 hello 4 编译 linux

Outline 1 SkyEye 简介 2 SkyEye 的安装 SkyEye 的安装试用 skyeye 下载 skyeye 源代码, 编译并安装 3 启动 Linux 执行自己的程序添加 hello 到 uclinux 的根文件系统中在 ArmLinux 中运行 hello 4 编译 linux 嵌入式操作系统 4 SkyEye 简介 陈香兰 (xlanchen@ustceducn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Fall 2014 November 28, 2014 陈香兰 (xlanchen@ustceducn) ( 计算机应用教研室 @ 计算机学院嵌入式系统实验室嵌入式操作系统 @ 苏州研究院中国科学技术大学 November 28,

More information

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un Linux C July 27, 2016 Contents 1 Linux IDE 1 2 GCC 3 2.1 hello.c hello.exe........................... 5 2.2............................... 9 2.2.1 -Wall................................ 9 2.2.2 -E..................................

More information

Cygwin Cygwin windows Linux Cygwin.dll Windows Linux API Linux Windows Linux 2

Cygwin Cygwin windows Linux Cygwin.dll Windows Linux API Linux Windows Linux 2 uclinux 1 Cygwin Cygwin windows Linux Cygwin.dll Windows Linux API Linux Windows Linux 2 Cygwin Cygwin GNU gccgdbxfree86bashtetexopengl perlpython Linux Windows Cygwin Linux GNU Windows 3 Cygwin Cygwin

More information

Outline 1 SkyEye 简介 2 SkyEye 的安装 SkyEye 的安装下载 skyeye 源代码, 编译并安装 3 在 Linux 的根文件系统中添加 hello 在 Linux 的根文件系统中添加 hello 4 命令行安装 skyeye 添加 hello 到 uclinux 的根

Outline 1 SkyEye 简介 2 SkyEye 的安装 SkyEye 的安装下载 skyeye 源代码, 编译并安装 3 在 Linux 的根文件系统中添加 hello 在 Linux 的根文件系统中添加 hello 4 命令行安装 skyeye 添加 hello 到 uclinux 的根 4 SkyEye 简介 陈香兰 (xlanchen@ustceducn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 /media/samsung/work/6 实验室相关 陈香兰 (xlanchen@ustceducn) Outline 1 SkyEye 简介 2 SkyEye 的安装 SkyEye 的安装下载 skyeye 源代码, 编译并安装 3 在 Linux

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++

More information

华恒家庭网关方案

华恒家庭网关方案 LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU

More information

第 1 页共 9 页 文档履历 版本号日期制 / 修订人内容描述 V 正式版本

第 1 页共 9 页 文档履历 版本号日期制 / 修订人内容描述 V 正式版本 V3s 项目 CamDroid 编译第三方程序 / V1.0 第 1 页共 9 页 文档履历 版本号日期制 / 修订人内容描述 V1.0 2014-04-23 正式版本 第 2 页共 9 页 目录 1. 交叉编译环境... 3 2. 第三方库的 Makefile 示例... 4 3. 第三方应用 Makefile 示例... 5 4. 第三方应用 CamLinux.mk 示例... 6 5. 常见错误...

More information

Abstract arm linux tool-chain root NET-Start! 2

Abstract arm linux tool-chain root NET-Start! 2 Lab III - Embedding Linux 1 Abstract arm linux tool-chain root NET-Start! 2 Part 1.4 Step1. tool-chain 4 Step2. PATH 4 Part 2 kernel 5 Step1. 5 Step2... 6 Step3...8 Part 3 root. 8 Step1. 8 Step2. 8 Part

More information

ebook8-30

ebook8-30 3 0 C C C C C C++ C + + C++ GNU C/C++ GNU egcs UNIX shell s h e l l g a w k P e r l U N I X I / O UNIX shell awk P e r l U N I X C C C C C C U N I X 30.1 C C U N I X 70 C C U N I X U N I X U N I X C Dennis

More information

02

02 Thinking in C++: Volume One: Introduction to Standard C++, Second Edition & Volume Two: Practical Programming C++ C C++ C++ 3 3 C C class C++ C++ C++ C++ string vector 2.1 interpreter compiler 2.1.1 BASIC

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

Prepare.ppt [兼容模式]

Prepare.ppt [兼容模式] 课前实验 Linux 操作系统的安装 C 语言编程环境的设置 TinyOS 开发环境的设置 一 实验目的 1 学会在计算机或虚拟机环境中安装 Linux 操作系统 2 学会在 Linux 下进行 C 语言编程 3 掌握交叉编译开发, 学会在 Linux 下设置 TinyOS 开发环 境, 能够完成基于 NesC 的 TinyOS 应用程序开发 二 Linux 操作系统的安装 14.04.4-desktop-amd64.iso

More information

Linux 操作系统分析 Chapter 9-2 Linux 中程序的执行 陈香兰 苏州研究院中国科学技术大学 Fall 2014 November 4,

Linux 操作系统分析 Chapter 9-2 Linux 中程序的执行 陈香兰  苏州研究院中国科学技术大学 Fall 2014 November 4, Linux 操作系统分析 Chapter 9-2 Linux 中程序的执行 陈香兰 (xlanchen@ustceducn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Fall 2014 November 4, 2014 陈香兰 (xlanchen@ustceducn) ( 计算机应用教研室 Linux 操作系统分析 @ 计算机学院嵌入式系统实验室 Chapter

More information

. Outline 编译 Linux 在 QEMU 模拟器上运行制作带 grub 启动的磁盘映像...1 编译 Linux 在 QEMU 模拟器上运行...2 制作带 grub 启动的磁盘映像

. Outline 编译 Linux 在 QEMU 模拟器上运行制作带 grub 启动的磁盘映像...1 编译 Linux 在 QEMU 模拟器上运行...2 制作带 grub 启动的磁盘映像 .... 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Fall 2010 . Outline 编译 Linux 在 QEMU 模拟器上运行制作带 grub 启动的磁盘映像...1 编译 Linux 在 QEMU 模拟器上运行...2 制作带 grub 启动的磁盘映像 . 编译 Linux 在 QEMU 模拟器上运行 qemu+linux-2.6.26.1. 准备模拟器.2.

More information

Microsoft Word - 在VMWare-5.5+RedHat-9下建立本机QTopia-2.1.1虚拟平台a.doc

Microsoft Word - 在VMWare-5.5+RedHat-9下建立本机QTopia-2.1.1虚拟平台a.doc 在 VMWare-5.5+RedHat-9 下建立 本机 QTopia-2.1.1 虚拟平台 张大海 2008-5-9 一 资源下载 1. 需要以下安装包 : tmake-1.13.tar.gz qtopia-free-source-2.1.1.tar.gz qt-embedded-2.3.10-free.tar.gz qt-x11-2.3.2.tar.gz qt-x11-free-3.3.4.tar.gz

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows

More information

Outline 制作带 grub 启动的磁盘映像 利用 qemu+gdb 来调试 linux

Outline 制作带 grub 启动的磁盘映像 利用 qemu+gdb 来调试 linux Linux 操作系统分析 陈香兰 (xlanchen@ustc.edu.cn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Spring 2011 Outline 制作带 grub 启动的磁盘映像 利用 qemu+gdb 来调试 linux qemu+linux-2.6.26 1. 准备模拟器 2. 编译 Linux 内核 3. 准备根文件系统 1 准备模拟器

More information

EK-STM32F

EK-STM32F STMEVKIT-STM32F10xx8 软 件 开 发 入 门 指 南 目 录 1 EWARM 安 装... 1 1.1 第 一 步 : 在 线 注 册... 1 1.2 第 二 步 : 下 载 软 件... 2 1.3 第 三 步 : 安 装 EWARM... 3 2 基 于 STMEVKIT-STM32F10xx8 的 示 例 代 码 运 行... 6 2.1 GPIO Demo... 6 2.2

More information

PowerPoint 演示文稿

PowerPoint 演示文稿 Linux 操 作 系 统 基 础 介 绍 课 程 目 标 及 要 求 了 解 Linux 操 作 系 统 的 登 入 方 式 掌 握 常 用 命 令 的 基 本 用 法 能 够 熟 练 在 各 个 目 录 转 换 Outline 1. Linux 操 作 系 统 简 介 2. Linux 操 作 系 统 的 登 录 3. Linux 操 作 系 统 的 目 录 结 构 4. 常 用 命 令 5.

More information

C/C++语言 - 运算符、表达式和语句

C/C++语言 - 运算符、表达式和语句 C/C++ Table of contents 1. 2. 3. 4. C C++ 5. 6. 7. 1 i // shoe1.c: # include # define ADJUST 7. 64 # define SCALE 0. 325 int main ( void ) { double shoe, foot ; shoe = 9. 0; foot = SCALE * shoe

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

Eclipse C C++, or

Eclipse C C++,  or Eclipse C C++, Emailctchen@pl.csie.ntut.edu.tw or s1669021@ntut.edu.tw, s2598003@ntut.edu.tw http://pl.csie.ntut.edu.tw/~ctchen, http://www.ntut.edu.tw/~s2598003/ 2004/9/10 (0.02 ) Eclipse http://www.eclipse.org

More information

PTS7_Manual.PDF

PTS7_Manual.PDF User Manual Soliton Technologies CO., LTD www.soliton.com.tw - PCI V2.2. - PCI 32-bit / 33MHz * 2 - Zero Skew CLK Signal Generator. - (each Slot). -. - PCI. - Hot-Swap - DOS, Windows 98/2000/XP, Linux

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

C/C++程序设计 - 字符串与格式化输入/输出

C/C++程序设计 - 字符串与格式化输入/输出 C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int

More information

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE Project Properties IDE makefile 1. Oracle Solaris Studio 12.2 IDE 2010 9 2 8 9 10 11 13 20 26 28 30 32 33 Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1. "File" > "New

More information

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP:  ******************* * 关于 Java 测试试题 ****** ******************* * 关于 Java 测试试题 ******************* 問 1 运行下面的程序, 选出一个正确的运行结果 public class Sample { public static void main(string[] args) { int[] test = { 1, 2, 3, 4, 5 ; for(int i = 1 ; i System.out.print(test[i]);

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information

六域链联盟 SDChain-Matrix 节点搭建指南 2018/07/26 Version : 1.0.0

六域链联盟 SDChain-Matrix 节点搭建指南 2018/07/26 Version : 1.0.0 SDChain-Matrix 节点搭建指南 目录 1 环境要求... 3 2 软件下载... 4 3 安装部署... 4 3.1 部署可执行程序目录... 4 3.2 部署配置文件目录... 4 3.3 部署数据库文件目录... 4 3.4 部署日志文件目录... 4 3.5 部署依赖库文件目录... 4 4 配置参数... 5 5 启动运行... 7 5.1 普通模式启动... 7 5.2 加载启动模式...

More information

Computer Architecture

Computer Architecture ECE 3120 Computer Systems Assembly Programming Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Prev: Basic computer concepts

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與 程 式 編 写 語 言 在 完 成 這 章 後, 你 將 能 夠 了 解 程 式 編 写 語 言 的 功 能 了 解 高 階 語 言 和 低 階 語 言 之 間 的 分 別 知 道 翻 譯 程 式 的 意 義 和 能 夠 把 翻 譯 程 式 分 類 為 : 匯 編 程 式 編 譯 程 式 和 解 譯 程 式 認 識 不 同 翻 譯 程 式 的 優 點 和 缺 點 程 式 是 指 揮 電 腦 的 指

More information

51 C 51 isp 10 C PCB C C C C KEIL

51 C 51 isp 10   C   PCB C C C C KEIL http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom

More information

untitled

untitled 2006 6 Geoframe Geoframe 4.0.3 Geoframe 1.2 1 Project Manager Project Management Create a new project Create a new project ( ) OK storage setting OK (Create charisma project extension) NO OK 2 Edit project

More information

2/80 2

2/80 2 2/80 2 3/80 3 DSP2400 is a high performance Digital Signal Processor (DSP) designed and developed by author s laboratory. It is designed for multimedia and wireless application. To develop application

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

Oracle Oracle Solaris Studio IDE makefile C C++ Fortran makefile IDE Solaris Linux C/C++/Fortran Oracle IDE "P

Oracle Oracle Solaris Studio IDE makefile C C++ Fortran makefile IDE Solaris Linux C/C++/Fortran Oracle IDE P Oracle Solaris Studio 12.3 IDE 2011 12 E26461-01 2 7 8 9 9 Oracle 10 12 14 21 26 27 29 31 32 33 Oracle Solaris Studio IDE makefile C C++ Fortran makefile IDE Solaris Linux C/C++/Fortran Oracle IDE "Project

More information

C/C++ - 函数

C/C++ - 函数 C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh

More information

ARM JTAG实时仿真器安装使用指南

ARM JTAG实时仿真器安装使用指南 ARM JTAG Version 1.31 2003. 11. 12 ARM JTAG ARM JTAG.3 ARM 2.1.4 2.2.4 ARM JTAG 3.1 18 3.2 18 3.2.1 Multi-ICE Server.18 3.2.2 ADS..21 ARM JTAG 4.1 Multi-ICE Server 33 4.1.1 Multi-ICE Server..... 33 4.1.2

More information

PowerPoint 演示文稿

PowerPoint 演示文稿 Linux 环境下程序编译 曙光信息产业 ( 北京 ) 有限公司 提 纲 1. GCC 编译 2. Make 简介 3. 常用编译器 一个简单的例子 hello.c 用 vi 编写源文件 : #include void main() { printf( hello world, I am \n ); } 用 gcc 编译 运行 gcc hello.c./a.out 第二个例子 vim

More information

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor 1 4.1.1.1 (Load) 14 1.1 1 4.1.1.2 (Save) 14 1.1.1 1 4.1.2 (Buffer) 16 1.1.2 1 4.1.3 (Device) 16 1.1.3 1 4.1.3.1 (Select Device) 16 2 4.1.3.2 (Device Info) 16 2.1 2 4.1.3.3 (Adapter) 17 2.1.1 CD-ROM 2 4.1.4

More information

2 2 3 DLight CPU I/O DLight Oracle Solaris (DTrace) C/C++ Solaris DLight DTrace DLight DLight DLight C C++ Fortran CPU I/O DLight AM

2 2 3 DLight CPU I/O DLight Oracle Solaris (DTrace) C/C++ Solaris DLight DTrace DLight DLight DLight C C++ Fortran CPU I/O DLight AM Oracle Solaris Studio 12.2 DLight 2010 9 2 2 3 DLight 3 3 6 13 CPU 16 18 21 I/O DLight Oracle Solaris (DTrace) C/C++ Solaris DLight DTrace DLight DLight DLight C C++ Fortran CPU I/O DLight AMP Apache MySQL

More information

NEXT SDT2.51 C:\ARM251 SDT2.51 ARM SDT 2.51 ARM PROJECT MANAGER SDT 2

NEXT SDT2.51 C:\ARM251 SDT2.51 ARM SDT 2.51 ARM PROJECT MANAGER SDT 2 S3C44B0 SDT DRAGNBOY MICROSTAR ARM 51 ARM S3C44B0 ARM SDT2.51 IAR ADS SDT2.51 S3C44B0 LEDTEST SDT ARM 1 2 SDT embed.8800.org SDT2.51 SDT2.51 ARM ARM CPU ARM SDT ADS ADS MULTI-ICE SDT JTAG JTAG SDT SDT2.51

More information

Microsoft PowerPoint - 嵌入式系统设计课件第二讲.ppt

Microsoft PowerPoint - 嵌入式系统设计课件第二讲.ppt Embedded Linux 开发环境 Linux 操作系统概述 Linux 下的编辑器 Linux 下的编译器 Linux 下的 make 工具 Linux 的 FHS 1 Embedded Linux 操作系统概述 Linux 的系统架构 Linux Kernel 硬件 2 Embedded Linux 的硬件支持 Embedded Linux 是基于特定硬件平台的应用程序解决方案 Embedded

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

More information

ebook50-15

ebook50-15 15 82 C / C + + Developer Studio M F C C C + + 83 C / C + + M F C D L L D L L 84 M F C MFC DLL M F C 85 MFC DLL 15.1 82 C/C++ C C + + D L L M F C M F C 84 Developer Studio S t u d i o 292 C _ c p l u s

More information

提纲 1 2 OS Examples for 3

提纲 1 2 OS Examples for 3 第 4 章 Threads2( 线程 2) 中国科学技术大学计算机学院 October 28, 2009 提纲 1 2 OS Examples for 3 Outline 1 2 OS Examples for 3 Windows XP Threads I An Windows XP application runs as a seperate process, and each process may

More information

提纲. 1 实验准备. 2 从实模式进入保护模式. 3 小结 陈香兰 ( 中国科学技术大学计算机学院 ) 软件综合实验之操作系统 July 1, / 11

提纲. 1 实验准备. 2 从实模式进入保护模式. 3 小结 陈香兰 ( 中国科学技术大学计算机学院 ) 软件综合实验之操作系统 July 1, / 11 .. 软件综合实验之操作系统 进入保护模式 陈香兰 中国科学技术大学计算机学院 July 1, 2016 陈香兰 ( 中国科学技术大学计算机学院 ) 软件综合实验之操作系统 July 1, 2016 1 / 11 提纲. 1 实验准备. 2 从实模式进入保护模式. 3 小结 陈香兰 ( 中国科学技术大学计算机学院 ) 软件综合实验之操作系统 July 1, 2016 2 / 11 实验准备 实验环境准备

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

PowerPoint 演示文稿

PowerPoint 演示文稿 The BitCoin Scripting Language 交易实例 交易结构 "result": { "txid": "921a dd24", "hash": "921a dd24", "version": 1, "size": 226, "locktime": 0, "vin": [ ], "vout": [ ], "blockhash": "0000000000000000002c510d

More information

C

C C 2017 3 14 1. 2. 3. 4. 2/95 C 1. 3/95 C I 1 // talkback.c: 2 #include 3 #include 4 #define DENSITY 62.4 5 int main(void) 6 { 7 float weight, volume; 8 int size; 9 unsigned long letters;

More information

C C

C C C C 2017 3 8 1. 2. 3. 4. char 5. 2/101 C 1. 3/101 C C = 5 (F 32). 9 F C 4/101 C 1 // fal2cel.c: Convert Fah temperature to Cel temperature 2 #include 3 int main(void) 4 { 5 float fah, cel; 6 printf("please

More information

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1 C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 月 3 日 1 1 INPUTOUTPUT 1 InputOutput 题目描述 用 cin 输入你的姓名 ( 没有空格 ) 和年龄 ( 整数 ), 并用 cout 输出 输入输出符合以下范例 输入 master 999 输出 I am master, 999 years old. 注意 "," 后面有一个空格,"." 结束,

More information

Converting image (bmp/jpg) file into binary format

Converting image (bmp/jpg) file into binary format RAiO Image Tool 操作说明 Version 1.0 July 26, 2016 RAiO Technology Inc. Copyright RAiO Technology Inc. 2013 RAiO TECHNOLOGY INC. www.raio.com.tw Revise History Version Date Description 0.1 September 01, 2014

More information

chap07.key

chap07.key #include void two(); void three(); int main() printf("i'm in main.\n"); two(); return 0; void two() printf("i'm in two.\n"); three(); void three() printf("i'm in three.\n"); void, int 标识符逗号分隔,

More information

Microsoft Word - 正文.doc

Microsoft Word - 正文.doc 1 2 1 2 3 4 5 6 7 8 9 10 3 1 150 2 150 1 1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.4 1.4.1 CPU 1.4.2 I/O 1.4.3 I/O 1.5 1.5.1 CISC RISC 1.5.2 1.5.3 1.6 1.6.1 1.6.2 N 1.6.3 2 2.1 2.1.1 2.1.2 2.1.3

More information

Microsoft Word - 100118002.htm

Microsoft Word - 100118002.htm 100 年 度 11800 電 腦 軟 體 應 用 乙 級 技 術 士 技 能 檢 定 學 科 測 試 試 題 本 試 卷 有 選 擇 題 80 題, 每 題 1.25 分, 皆 為 單 選 選 擇 題, 測 試 時 間 為 100 分 鐘, 請 在 答 案 卡 上 作 答, 答 錯 不 倒 扣 ; 未 作 答 者, 不 予 計 分 准 考 證 號 碼 : 姓 名 : 選 擇 題 : 1. (3)

More information

嵌入式系统实验报告之一

嵌入式系统实验报告之一 南京航空航天大学 嵌入式系统综合实验报告 Qtopia 在 S3C2440 开发板上的移植 040630520 彭立勋 2009.05 一 实验目的 1. 熟悉 ARM 体系结构 ; 2. 熟悉 Qtopia 图形环境 二 实验内容 将 Qtopia 图形环境移植到 FriendlyARM QQ2440 开发板 三 预备知识 Qtopia 的体系结构 四 实验设备及工具 硬件 :QQ2440 开发板

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc 2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.

More information

プログラムの設計と実現II

プログラムの設計と実現II UNIX C ls mkdir man http://www.tj.chiba-u.jp/lecture/prog2/ Ctrl+x, Ctrl+s ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

Outline 1 课程的意义 组成和目标 2 Text & Reference book 3 成绩评定方法和高分攻略 4 联系方式 陈香兰 ( 苏州研究院中国科学技术大学 November

Outline 1 课程的意义 组成和目标 2 Text & Reference book 3 成绩评定方法和高分攻略 4 联系方式 陈香兰 (  苏州研究院中国科学技术大学 November 嵌入式操作系统 0 课程简介 陈香兰 (xlanchen@ustceducn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Fall 2014 November 18, 2014 陈香兰 (xlanchen@ustceducn) ( 计算机应用教研室 @ 计算机学院嵌入式系统实验室嵌入式操作系统 @ 苏州研究院中国科学技术大学 November 18, Fall

More information

1

1 SDT Uclinux SDT.alf.c 44blib.alf 44blib.c jtag ADS.alf.c make menuconfig make dep make clean make lib_only make user_only make romfs make image make uclinux ext2 cash lcd frambuffer 1 armsys-c uclinux

More information

How to Debug Tuxedo Server printf( Input data is: %s, inputstr); fprintf(stdout, Input data is %s, inputstr); fprintf(stderr, Input data is %s, inputstr); printf( Return data is: %s, outputstr); tpreturn(tpsuccess,

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

untitled

untitled 8086/8088 CIP /. 2004.8 ISBN 7-03-014239-X.... TP313 CIP 2004 086019 16 100717 http://www.sciencep.com * 2004 8 2004 8 1 5 500 787 1092 1/16 16 1/2 391 000 1 2 ii 1 2 CAI CAI 3 To the teacher To the student

More information

Microsoft Word - MSP430 Launchpad 指导书.docx

Microsoft Word - MSP430 Launchpad 指导书.docx Contents 3... 9... 14 MSP430 LAUNCHPAD 指导书 3 第一部分第一个工程 New Project File > New > CCS Project Project name: ButtonLED Device>Family: MSP430 Variant: MSP430G2553 Project templates and examples : Empty Project

More information

untitled

untitled 年度 路 IVI 劉 隆 年 597 598 IVI 錄... 601 行... 601... 601 1.... 601 2. 路... 602 3.... 603... 604 1.IPv4 to IPv6... 604 2.IPv6 to IPv4... 605 -... 606 ( )IVI Server... 606 ( )IVI Server... 610 ( )IVI DNS Server...

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

Chapter 24 DC Battery Sizing

Chapter 24  DC Battery Sizing 26 (Battery Sizing & Discharge Analysis) - 1. 2. 3. ETAP PowerStation IEEE 485 26-1 ETAP PowerStation 4.7 IEEE 485 ETAP PowerStation 26-2 ETAP PowerStation 4.7 26.1 (Study Toolbar) / (Run Battery Sizing

More information

Simulator By SunLingxi 2003

Simulator By SunLingxi 2003 Simulator By SunLingxi sunlingxi@sina.com 2003 windows 2000 Tornado ping ping 1. Tornado Full Simulator...3 2....3 3. ping...6 4. Tornado Simulator BSP...6 5. VxWorks simpc...7 6. simulator...7 7. simulator

More information

D C 93 2

D C 93 2 D9223468 3C 93 2 Java Java -- Java UML Java API UML MVC Eclipse API JavadocUML Omendo PSPPersonal Software Programming [6] 56 8 2587 56% Java 1 epaper(2005 ) Java C C (function) C (reusability) eat(chess1,

More information

epub 63-3

epub 63-3 3 Solaris S o l a r i s S o l a r i s 2 S o l a r i s s h e l l p a s s w d v i l s c a t p g m o r e r m 3.1 3.1.1 c p c p c o p y c p c p cp source-file destination-file s o u r c e - f i l e c p d e

More information

Linux服务器构建与运维管理

Linux服务器构建与运维管理 1 Linux 服务器构建与运维管理 第 2 章 :Linux 基本命令 阮晓龙 13938213680 / rxl@hactcm.edu.cn http://linux.xg.hactcm.edu.cn http://www.51xueweb.cn 河南中医药大学管理科学与工程学科 2018.3 2 提纲 目录与文件的操作 mkdir touch mv cp rm rmdir file tree

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc

More information

Microsoft Word - 苹果脚本跟我学.doc

Microsoft Word - 苹果脚本跟我学.doc AppleScript for Absolute Starters 2 2 3 0 5 1 6 2 10 3 I 13 4 15 5 17 6 list 20 7 record 27 8 II 32 9 34 10 36 11 44 12 46 13 51 14 handler 57 15 62 63 3 AppleScript AppleScript AppleScript AppleScript

More information

Ioncube Php Encoder 8 3 Crack 4. llamaba octobre traslado General Search colony

Ioncube Php Encoder 8 3 Crack 4. llamaba octobre traslado General Search colony Ioncube Php Encoder 8 3 Crack 4 ->>->>->> DOWNLOAD 1 / 5 2 / 5 Press..the..General..Tools..category4Encrypt..and..protect..files..with..PHP..encoding,..encryption,..ob fuscation..and..licensing... 2016

More information

C/C++ - 字符串与字符串函数

C/C++ - 字符串与字符串函数 C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed

More information

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double

More information

C语言的应用.PDF

C语言的应用.PDF AVR C 9 1 AVR C IAR C, *.HEX, C,,! C, > 9.1 AVR C MCU,, AVR?! IAR AVR / IAR 32 ALU 1KBytes - 8MBytes (SPM ) 16 MBytes C C *var1, *var2; *var1++ = *--var2; AVR C 9 2 LD R16,-X ST Z+,R16 Auto (local

More information

一 Grass 是 什 么 1 简 介 GRASS (Geographic Resources Analysis Support System, 地 理 资 源 分 析 支 持 系 统 ) 是 最 负 盛 名 的 开 源 地 理 信 息 系 统 (GIS) 以 下 是 它 的 一 些 特 点 : 1

一 Grass 是 什 么 1 简 介 GRASS (Geographic Resources Analysis Support System, 地 理 资 源 分 析 支 持 系 统 ) 是 最 负 盛 名 的 开 源 地 理 信 息 系 统 (GIS) 以 下 是 它 的 一 些 特 点 : 1 GRASS 中 文 教 程 作 者 : 广 东 省 东 莞 市 长 安 中 学 文 合 平 E_mail: wenheping@gmail.com 2007 年 9 月 1 一 Grass 是 什 么 1 简 介 GRASS (Geographic Resources Analysis Support System, 地 理 资 源 分 析 支 持 系 统 ) 是 最 负 盛 名 的 开 源 地 理

More information

Guide to Install SATA Hard Disks

Guide to Install SATA Hard Disks SATA RAID 1. SATA. 2 1.1 SATA. 2 1.2 SATA 2 2. RAID (RAID 0 / RAID 1 / JBOD).. 4 2.1 RAID. 4 2.2 RAID 5 2.3 RAID 0 6 2.4 RAID 1.. 10 2.5 JBOD.. 16 3. Windows 2000 / Windows XP 20 1. SATA 1.1 SATA Serial

More information

ebook140-9

ebook140-9 9 VPN VPN Novell BorderManager Windows NT PPTP V P N L A V P N V N P I n t e r n e t V P N 9.1 V P N Windows 98 Windows PPTP VPN Novell BorderManager T M I P s e c Wi n d o w s I n t e r n e t I S P I

More information

Microsoft PowerPoint - string_kruse [兼容模式]

Microsoft PowerPoint - string_kruse [兼容模式] Strings Strings in C not encapsulated Every C-string has type char *. Hence, a C-string references an address in memory, the first of a contiguous set of bytes that store the characters making up the string.

More information

/ / (FC 3)...

/ / (FC 3)... Modbus/TCP 1.0 1999 3 29 Andy Swales Schneider aswales@modicon.com ... 2 1.... 3 2.... 3 2.1.. 3 2.2..4 2.3..4 2.4... 5 3.... 5 3.1 0... 5 3.2 1... 5 3.3 2... 6 3.4 / /... 7 4.... 7 5.... 8 5.1 0... 9

More information

目 录

目 录 1 Quick51...1 1.1 SmartSOPC Quick51...1 1.2 Quick51...1 1.3 Quick51...2 2 Keil C51 Quick51...4 2.1 Keil C51...4 2.2 Keil C51...4 2.3 1 Keil C51...4 2.4 Flash Magic...9 2.5 ISP...9 2.6...10 2.7 Keil C51...12

More information

概述

概述 Compatibility Report of Red Flag DC Server 4.0 Power by: Product Dept. of Red Flag Date: Mar.31.2003 1...1 2...2 2.1...2 2.2...2 2.3...2 2.4...2 3...3 3.1...3 3.2...15 4...17 1 Red Flag DC Server 4.0 Red

More information

技术资料

技术资料 WM_W60X_SDK_GCC 编译指南 V1.2 (winner micro) 地址 : 北京市海淀区阜成路 67 号银都大厦 18 层电话 :+86-10-62161900 公司网址 :www.winnermicro.com 文档历史 版本完成日期修订记录作者审核 V0.1 2018/9/20 创建 Leihy V1.0 2018/9/28 添加 linux 下交叉编译环境的搭建 Huangll

More information

一个开放源码的嵌入式仿真环境 ― SkyEye

一个开放源码的嵌入式仿真环境 ― SkyEye SkyEye SkyEye http://hpclab.cs.tsinghua.edu.cn/~skyeye/ I hear and I forget, I see and I remember, I do and I understand. SkyEye SkyEye SkyEye SkyEye SkyEye 1. SkyEye PC pervasive computing PC I O PDA

More information

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc TwinCAT 2001.12.11 TwinCAT 1. TwinCAT... 3 2.... 4... 4...11 3. TwinCAT PLC... 13... 13 PLC IEC 61131-3... 14 4. TwinCAT... 17... 17 5. TwinCAT... 18... 18 6.... 19 Maschine.pro... 19... 27 7.... 31...

More information

Outline 1 简介编译 简单分析 源码 2 简介 的下载 编译和运行 的简单分析 3

Outline 1 简介编译 简单分析 源码 2 简介 的下载 编译和运行 的简单分析 3 5 BootLoader 举例 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 /media/samsung/work/6 实验室相关 Outline 1 简介编译 简单分析 源码 2 简介 的下载 编译和运行 的简单分析 3 Outline 简介编译 简单分析 源码 1 简介编译 简单分析 源码 2 简介 的下载 编译和运行 的简单分析 3 (Universal

More information

ICD ICD ICD ICD ICD

ICD ICD ICD ICD ICD MPLAB ICD2 MPLAB ICD2 PIC MPLAB-IDE V6.0 ICD2 usb PC RS232 MPLAB IDE PC PC 2.0 5.5V LED EEDATA MPLAB ICD2 Microchip MPLAB-IDE v6.0 Windows 95/98 Windows NT Windows 2000 www.elc-mcu.com 1 ICD2...4 1.1 ICD2...4

More information

USING MAYA ANIMATION Keyset set Maya sets partitions MEL MEL copykey cutkey pastekey scalekey snapkey keytangent bakeresults MEL Command Reference Edi

USING MAYA ANIMATION Keyset set Maya sets partitions MEL MEL copykey cutkey pastekey scalekey snapkey keytangent bakeresults MEL Command Reference Edi 9 61 62 65 67 69 69 71 74 76 Maya Edit > Keys > Paste Keys Maya 61 USING MAYA ANIMATION Keyset set Maya sets partitions MEL MEL copykey cutkey pastekey scalekey snapkey keytangent bakeresults MEL Command

More information

言1.PDF

言1.PDF MSP430 WINDOWS WORKBENCH MSP430 Flash Green MCU Flash Flash MCU MSP430 16 RISC 27 125ns 1.8V~3.6V A/D 6 s MSP430 10 ESD MSP430 MSP430 10 MSP430 2001 MSP430 Windows Workbench Interface Guide Windows Workbench

More information