arhangeldim / qemu_arm Goto Github PK
View Code? Open in Web Editor NEWarm on arm qemu optimization
License: Other
arm on arm qemu optimization
License: Other
Content 1. ARM assembly. Building binary 1) For cross-compile use this toolchain https://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 If there is an ARM board use default tools for compile (as, ld, etc...) 2) There is a simple assembly module (add two numbers) simple.s @@@@@@@@@@@@@@@@@@@@@@@@@@@@ .text start: @ Label, not really required mov r0, #5 @ Load register r0 with the value 5 mov r1, #4 @ Load register r1 with the value 4 add r2, r1, r0 @ Add r0 and r1 and store in r2 stop: b stop @ INfinity loop. Or use bx lr @@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3) Script for compile (on ARM) #!/bin/bash as -o out.o "$1" ld -Ttext=0x0 -o out.elf out.o objcopy -O binary out.elf out.bin 2. QEMU running #!/bin/bash dd if=/dev/zero of=flash.bin bs=4096 count 4096 dd if=out.bin of=flash.bin bs=4096 conv=notrunc qemu-system-arm -M connex -pflash flash.bin -nographic -serial /dev/null -D ~/qemu.log -d in_asm,out_asm,op QEMU options -M model -pflash flash memory -serial i/o device -D path to log file -d log option -s wait for gdb connection -S set breakpoint before first code line 3. GDB if qemu is ran with -s option we can connect with gdb for remote debugging (default port 1234). (gdb) target remote localhost:1234 4. PROCESS generation of intermediate code. cpu-exec.c: int cpu_exec(CPUState *env) static void cpu_exec_nocache(CPUState *env, int max_cycles, TranslationBlock *orig_tb) exec.c: TranslationBlock *tb_gen_code(CPUState *env, target_ulong pc, target_ulong cs_base, int flags, int cflags) translate-all.c: int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr) //gen target mashine code cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size_ptr) target-arm/translate.c: static inline void gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, int search_pc) static void disas_arm_insn(CPUState * env, DisasContext *s) 5. ADDITION Translation stops when a conditional branch is encountered. Otherwise the subsequent code could get translated several times. Also stop translation when a page boundary is reached. This ensures prefetch aborts occur at the right place.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.