1
votes

I am creating a OS kernel in C, C++ and assembly. I am developing on a installed Eclipse CDT IDE on my Ubuntu 16.04 LTS machine. I am searching about run configurations in eclipse, but it seems to be that it is used for executing application binaries. My OS kernel is not a normal binary that can be executed under Linux. It must be emulated using software like QEMU and Bochs.

My Makefile uses the command q to run the kernel inside QEMU after building its components:

make q

Using the build configuration, I can make Eclipse build the kernel by executing the following command in a bash shell:

make Build

How can I create a run configuration in Eclipse so that it can run the kernel after building it? Currently, I have to type in the terminal window to run the kernel, or create an alterative build configuration to run the kernel, even if I click the build button.

1

1 Answers

0
votes

After a long time, I have found the solution to this problem. The thing is that your kernel is not a normal C++ application. Eclipse can only execute the app in the context of the already running operating system. You need to make a launcher program that executes things on your behave or runs a script to run the kernel.

Well, since you use a makefile, you could just run the make program directly. Its binary may be stored in usr/bin/make.

In your run configuration, pass the location of your makeprogram as the C++ application's path. In addition to this, add the arguments given to the C++ application, including -

  • RunCommand - The command in the makefile that runs your kernel.
  • -f/path/to/makefile - The make program needs to know where your Makefile is because it is being executed by a absolute path (usr/bin/make).
  • -I/path/to/project-dir - The make program must also switch the current working directory to your project directory so that the commands work.