CSL862: Assignment 1 on Binary Translation
Background reading
- QEMU, a Fast and Portable Dynamic Translator, Fabrice Bellard.
- QEMU Emulator User Documentation
- Intel Reference Manuals
Running a Guest Operating System on QEMU
- Run the pintos kernel on QEMU
- Download QEMU and build it
- Download pintos.tar.gz and type 'make' in the threads/ directory to build kernel.bin
- Use the command 'pintos/src/utils/pintos --make-disk=guest.dsk --hardware --kernel pintos/src/threads/build/kernel.bin --loader=pintos/src/threads/build/loader.bin --' to build 'os.dsk'
Counting the number of Instructions Executed
- Read the QEMU paper and understand how the dynamic translator inside QEMU works
- Change the dynamic translator to count the number of instructions executed in one execution of pintos, and print this value at the end of the execution.
- Change the dynamic translator to count the number of increment ('inc') instructions executed in one execution of pintos, and print this value at the end of the execution.
- Count the number of 'call' instructions and the number of 'ret' instructions. Report, how many call instructions you see, and how many ret instructions you see. Why is there a mismatch between the two counts?
Note:
- To be done in groups of two.
- The last date of submission is Aug 14