1 / 39

Binary Translation

Binary Translation. Cambio di architettura. Problemi. E il vecchio software?. Costo di produzione software (tempo e denaro). Soluzioni. Compilare il vecchio sorgente con nuovi compilatori Emulazione hardware Emulazione/interpretazione software Binary translation. Binary translation.

karsen
Télécharger la présentation

Binary Translation

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. Binary Translation

  2. Cambio di architettura

  3. Problemi E il vecchio software?

  4. Costo di produzione software(tempo e denaro)

  5. Soluzioni • Compilare il vecchio sorgente con nuovi compilatori • Emulazione hardware • Emulazione/interpretazione software • Binary translation

  6. Binary translation • Nessuna ricompilazione

  7. Binary translation • Nessuna ricompilazione • Indipendenza dal sorgente

  8. Binary translation • Nessuna ricompilazione • Indipendenza dal sorgente • Risparmio di tempo

  9. Binary translation • Nessuna ricompilazione • Indipendenza dal sorgente • Risparmio di tempo • Ottimizzazione

  10. Binary translation • Nessuna ricompilazione • Indipendenza dal sorgente • Risparmio di tempo • Ottimizzazione • Risparmio sui test

  11. Binary translation • Nessuna ricompilazione • Indipendenza dal sorgente • Risparmio di tempo • Ottimizzazione • Risparmio sui test • Nessun disagio per gli utenti

  12. Binary translation • Nessuna ricompilazione • Indipendenza dal sorgente • Risparmio di tempo • Ottimizzazione • Risparmio sui test • Nessun disagio per gli utenti • Distribuzione multipiattaforma

  13. Difficoltà • Simili a disassembler e decompilers • Problema della terminazione • Problema nella staticità

  14. Decompilation

  15. Decompilazione (MikeVanEmmerik )

  16. Esempio: dcc void main () { int loc1; int loc2; int loc3; int loc4; printf ("Input number of iterations: "); scanf ("%d", &loc1); loc3 = 1; while ((loc3 <= loc1)) {   printf ("Input number:"); scanf ("%d", &loc2); loc4 = proc_1 (loc2); printf ("fibonacci(%d) = %u\n", loc2, loc4); loc3 = (loc3 + 1); } /* end of while */ exit(0); }

  17. Esempio: REC main() { /* unknown */ void ebx; /* unknown */ void esi; /* unknown */ void Vfffffffc; (save)"Input number: "; printf(); (save) & Vfffffffc; (save)"%d"; scanf(); ebx = Vfffffffc; esp = esp + 12; if(ebx > 1) { esi = fib(ebx - 1); eax = fib(ebx - 2) + esi; } else { eax = ebx; } printf("fibonacci(%d) = %d\n", Vfffffffc, eax); esp = ebp - 12; return(0); }

  18. Esempio: Boomerang Output di The Boomerang: void main() { int local0; local0 = proc1(3, 4) ; local0 = printf("%i\n", local0) ; return ; } int proc1(int arg1, int arg2) { return arg2+arg1; } Esempio di codice: int somma(int a, int b) { return a + b; } int main() { printf("%i\n", somma(3, 4)); }

  19. Static binary translation

  20. Dynamic binary translation

  21. Retargetable binary translator

  22. MIMIC (Ibm 1987) • Emulatore • IBM System/370  IBM RT PC • Tecniche di caching • Fattore di espansione 1:4 (non 1:100)

  23. Accelerator (Tandem 1992) • Traduttore binario • TNS CISC  TNS RISC • 1% di interpretazione • Codice tradotto più veloce (5-8X)

  24. Flashport (AT&T 1994) • Set generale di piattaforme • Intervento utente • Da una settimana a sei mesi di computazione

  25. Tibbit (1995) • Motorola 68000  IBM RS/6000, AIX 3.2 • Traduzione applicazioni real-time tra processori con velocità differenti

  26. Digital (anni 90) • VAX, MIPS, SPARC  Alpha • VEST, Freeport express • Ore di computazione

  27. FX!32 (Digital 1996) • Ibrido: emulatore/binary translator • WinNT(32bit) x86  WinNT(64bit) Alpha

  28. NJMC (1999) • New Jersey Machine-Code Toolkit • Indipendente dalla macchina • Aiuta a scrivere parsers e debuggers • Introduce il Register Transfer Language (RTL)

  29. Disassembler, generazione 1-2 • Dcc: 860 linee in più giorni • NJMC: 208 linee in poche ore

  30. Aries (HP, 2000) • PA-RISC  ia64 • all user-level applications

  31. Futuro

  32. Futuro

  33. Futuro

  34. Futuro

  35. Futuro Aries(PA-RISC/ia64) Cindy ZhengCarol Thompson

  36. Futuro Aries(PA-RISC/ia64) Cindy ZhengCarol Thompson HP-UXWOW64

  37. Futuro Actually, being able to run IA-32 code on IA-64 HP-UX machines is not a primary goal for HP. Instead, it is a positive side effect of a software partitioning solution that HP is developing to allow multiple operating systems to share CPUs and other resources. IA-64 will never execute 32-bit code as well as a dedicated processor

  38. Bibliografia (1) Libri: • "Compilers - Principles, Techniques and Tools", Aho, Sethi, Ullman, • "Advanced Compiler Design & Implementation", Steven Muchnick • "How debuggers work - Algorithms, Data Structures, and Architecture", Jonathan Rosemberg • “A Conceptual Foundation for Software Re-Engineering”,E. J. Byrne Links: • http://www.mpowernet.com/kamal/www.fravia.org • http://www.quequero.tk • http://www.program-transformation.org

  39. Bibliografia (2) • “Transparent Execution, No Recompilation”Cindy ZhengCarol Thompson • “Running IA-32 Code on IA-64” by Christophe de Dinechin • “Binary Translation: Static, Dynamic, Retargetable?*”, C. Cifuentes, V. Malhotra

More Related