Compile open-source programs using eclipse in Linux
In Linux, we can use eclipse to compile and debug open-source programs. In this way, we do not need to use the command line all the time. It is very convenient. We will take gxemul as an example to introduce it:
1.
In http://gxemul.sourceforge.net/download gxemul, my version is 0.6.6.Gxemul is an open-source multi-processor architecture simulator that can simulate arm, MIPS, PPC, etc.
2.
Unzip gxemul:
Tar-zxvf gxemul-0.6.0.tar.gz
CD gxemul-0.6.0
First, we need to configure to generate the MAKEFILE file, which is the MAKEFILE file we use.
./Configure
3.
Gxemul is a C ++ project, so we open eclipse and selectFile --> New --> C ++ Project, Enter the Project name:GxemulAnd fill inGxemul decompression path, As follows:
4.
Since we have generated makefile in step 1, we need to tell eclipse not to generate makefile automatically,Select the gxemul project, right-click, and select Properties:
5.
Deselect "generate makefiles automatically" under C/C ++ builder", As follows:
6.
Then start compilation. The compilation output in eclipse is as follows:
7.
After the compilation is complete, run the command at http://blog.csdn.net/htttw/article/details/7724785. We use qemu_mipsas an example:
Wget http://wiki.qemu.org/download/mips-test-0.2.tar.gz
Tar zxvf mips-test-0.2.tar.gz
8.
Select the gxemul project, right-click, and choose run as --> RUN deployments. In the second arguments, enter:
-E qemu_mips -x -M 128 -o 'console=ttyS0 rd_start=0x80800000 rd_size=10000000 init=/bin/sh' 0x80800000:mips-test/initrd.gz mips-test/vmlinux-2.6.18-3-qemu
Enter the preceding parameters in the console when running gxemul:
. /Gxemul-e qemu_mips-X-M 128-O 'console = ttys0 rd_start = 0x80800000 rd_size = 10000000 init =/bin/Sh' 0x80800000: MIPs-test/initrd.gz MIPS-test/vmlinux-2.6.18-3-qemu
Is the same
Note: You must enter the preceding parameter path according to the decompressed path in step 3!
9.
Run it with eclipse. The result is as follows. Note that the window in the middle is the Linux running in gxemul:
Done!