1 / 15

Embedded Systems Programming

Embedded Systems Programming . Introduction to cross development techniques. What is cross development. Cross development is the process of developing code on one machine – the host , to run on another machine – the target

cpettitt
Télécharger la présentation

Embedded Systems Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Embedded Systems Programming 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. Targets Host System

  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!) Compiler Source Program file Executable Binary File

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

  9. Program segments

  10. Code Data BSS Heap Stack Program Segments 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. 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

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

More Related