Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embedded Control Systems Introduction to cross development techniques.

Similar presentations


Presentation on theme: "Embedded Control Systems Introduction to cross development techniques."— Presentation transcript:

1 Embedded Control Systems Introduction to cross development techniques

2 What is cross development Cross development is the process of developing code on one machine – the host, to run on another machine – the target The host will be a normal, powerful machine running an operating system The target will often be a single board computer that may have no or limited software and hardware resources

3 Host System Targets

4 Features of cross development The code created can’t run on the host system –Sometimes an emulator is used Special tools are required –The standard PC compiler won’t do! The code has to be downloaded

5 Why cross develop? Code is cross developed for a number of reasons –Frequently the development can’t be done on the board The board has no disc, compiler, screen etc –The development environment is very powerful and fast Games developers do this –Often the development might be done by a team on networked machines

6 Cross development tools In order to do cross development you need special tool kits, sometimes called toolchains. These consist of –Cross compiler, assembler and linkers –Downloading and conversion software –Remote debuggers –Useful utilities Files to dump or strip binary files, all in binutils.

7 Cross compilers Before we understand what cross compilers do it might be worth reviewing what compilers do –Simply put they take an input text source program file and output an executable binary output file (or some error messages!) Source Program file Executable Binary File

8 The compilation process mode detail cc –flags myfile.c thisfile.o PreprocessingCompilationOptimisation*Link/loading #includes.h header files #defines Text Assembler or Object format Relocatable Object file Executable Binary Object files Library file Start-up code *optional

9 High AddressArgs and env vars Command line arguments and environment variables Stack | V Unused memory ^ | Heap Uninitialized Data Segment (bss) Initialized to zero by exec. Initialized Data Segment Read from the program file by exec. Low AddressText Segment Read from the program file by exec. Program segments

10 Program Segments Code Data BSS Stack Heap char strng=“hello”; int count, this, that; main() { int i, j, k; char *sp; …….. for (i=0;i != 100;i++) …… sp= (char*) malloc(sizeof(i));

11

12 Executable formats There are a number of different exectuable formats –A.out is the traditional UNIX format –Elf – Executable and Linking Format –COFF – Common Object File Format –Plus lots of others

13

14 Elf format p_type p_offset p_vaddr p_filesz p_memsz p_flags p_type p_offset p_vaddr p_filesz p_memsz p_flags CODE DATA ‘E’ ‘L’ ‘F’ 0x8048090 52 2 e_indent e_entry e_phoff e_phentsize e_phnum PT_LOAD 0 0x804800 68532 PF_R, PF_X PT_LOAD 68536 0x8059BB8 2200 4248 PF_R, PF_W Physical Header Physical Header

15


Download ppt "Embedded Control Systems Introduction to cross development techniques."

Similar presentations


Ads by Google