Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
lol sorry, don't know what I was thinking atm. I meant the calling convention. I have no idea what __CorExeMain@0 does. Is it a wrapper around the main function to init runtime features? No idea.
Are you sure you are not compiling a .NET application, because I know that __CorExeMain is an export from .NET for use by executables.
Did you create an empty new project, and not one form a template? If you did, then you may want to go ahead and create a new empty project, because you may run into problems down the road.
Also, depending on how you design your system, it may be in your best interest to compile using build scripts, instead of relying on the IDE to do it for you. Say for instance, you suddenly want to move over to MinGW/Cygwin, you basically have nothing but what is in the configuration dialog. Just my opinion..
This isn't about the Visual C++ compiler, but I have kernel compiling with Cygwin within the Visual Studio/C++ IDE.
What to do to repeat what I did:
- Create a new project. Make it a Visual C++>General>Makefile Project.
- Set your build/rebuild/clean command to build.bat (or whatever batch file you want to use).
- Set your output file to anything (I think VC++ might check to see if this file exists to see if it compiled correctly?)
- Create build.bat and other batch files (my build.bat set's up Cygwin's paths, then calls build.sh using bash. Build.sh does the actual compiling and puts the disk image togeather.)
- Go to your kernel project properties>Configuration Properties and set your emulator properties here. I set the command to:
C:\Program Files\InnoTek VirtualBox\VBoxManage.exe
and the command arguments to:
startvm "Perception Kernel"
There might be away to get the bochs debugger to interact directly with VS but I haven't discovered how to yet. You could use different configurations for different emulators.
Now you should be able to build your kernel, start the emulator, and use handy features like IntelliSense from within the IDE. I don't know how, but Visual Studio seems to be able to intercept GCC's compile errors and display messages like "4 errors and 2 warnings". Unfortunately, you can't double click the error to take you to the line of code like when using the MS compiler.