MSVC++ additional tweaks that might help

Feedback? Questions? Comments? All discussions on the articles and tutorials hosted or developed by us go in here.

Moderator: Moderators

MSVC++ additional tweaks that might help

Postby Andyhhp » Fri Apr 25, 2008 3:19 pm

Hi everyone,

Having finally found time to finish my stage2 and start my kernel (strangely just after I get back to uni - not that exams are in 5 weeks ^_^), I have found some additional options that help when using the IDE. Who knows? If Mike agrees with them then it might be worth updating the tutorial

Firstly, for this to work, you must set up both the release and debug options. The easy way is to change the options on the 'All Configurations' configuration drop-down box.

In Configuration Properties->Debugging:

Here, you can add information about the program that gets run when you press the compile button. Normally, it would run the program you have just written but we can set it up to run bochs (or VPC if you use that)

Make sure you are in 'All Configurations' mode and set the Command Arguments and Working Directory options.
In my case they are:
Command Arguments: "-q -f bochs\bochsrcexternal.txt"
Working Directory: "C:\Users\Andrew Cooper\Documents\OS Development"

The Command Arguments are the commandline arguments that you normally use while Working Directory is the directory that you have your script (.cmd or .bat) that runs bochs.

Now - go into 'release' mode and change the 'Command' option to be the path to bochs (again, my case is "C:\Users\Andrew Cooper\Documents\OS Development\bochs\bochs").
Then, in 'debug' mode, change the Command option to the bochs debugger ("C:\Users\Andrew Cooper\Documents\OS Development\Bochs\bochsdbg").

Now, If you set all the other options up correctly and put the output dir as on your floppy disk/VFD as the tutorial states, when you press compile, MSVC will compile and link your code, then it will run either bochs or bochs debugger depending on whether you are in release or debug mode.

I personally think that this is easer than hitting compile, getting rid of the dialog box that comes up, Alt Tabbing (unless you use 2 screens) then running a script that runs bochs.

In addition to that, I have a few other tweaks that may or may not help.

Firstly, you can disable the embedded manifest file which will save you 1K filesize (filespace is premium of a floppy disk) by going to Configuration Properties->Linker->Manifest File and setting Generate Mainfest to 'No'. The only thing that I know manifest files can be usefully used for is for forcing an application to use windows XP/Vista themes - so no use to us.

Secondly, you can forcibly disable some of the linker warnings that appear in the build box. This is purely a matter of person preference but I try to remove warnings that I am aware of from the build box so I notice new warnings more easily. To get rid of the linker warnings associated with the kernel not having a proper entry point or the compatibility problems with Win 95 and 98 by having the base address at 1Meg, add the following options "/ignore:4086 /ignore:4096 /ignore:4216" to the linker command line in Configuration Properties->Linker->Command Line.

Note: For some reason, this doesn't always disable the 4086 warning. It seems random when it appears and when it doesnt but the MSDN forums seem to suggest that there is a bug to do with the /ignore function in the linker provided with MSVC++ express.

I hope this helps and I will post anything else that I discover. Feel free to contact me if any of this stops your compilation from working (it shouldn't but life is like that) and I would be interested to hear what other people think of it, particularly the first hack.


Posts: 387
Joined: Tue Oct 23, 2007 10:05 am

Return to Article Feedback

Who is online

Users browsing this forum: No registered users and 1 guest