Page 1 of 1
Making OS in VS 2005 (pro)
Posted: Tue Jun 26, 2007 4:18 pm
by Speewave
i have both Visual Studio 2005 Professional Edition with C++ and Cygwin. i heard you can make a OS in Visual Studio... Is it Possible?
Posted: Tue Jun 26, 2007 4:22 pm
by t0xic
I would not suggest using VC++ to compile your kernel/os
I use VC++ as my IDE, but I use a cygwin cross compiler to actually compile it.
Good luck,
--Michael
Posted: Tue Jun 26, 2007 4:27 pm
by Speewave
thanks... Visual Studio does have a good debugger! but can i still use things like iostream or something like that?
Posted: Tue Jun 26, 2007 5:19 pm
by Crazed123
No, not at all. An OS has no software sitting under it providing it with neat little APIs.
Posted: Tue Jun 26, 2007 5:28 pm
by t0xic
Exactly.
There is an article in the wiki about configuring VC++ for compiling, so you might want to give it a try. (not for the weak of heart)
--Michael
Posted: Fri Jul 06, 2007 2:27 pm
by dc0d32
what benefits (apart from a great IDE) do you get when using VS2005? No debugger (unless you write a windbg stub for your kernel), no EH (and if you try to support it, you sacrifise FS register), less control over compiler (as comparef to gcc).
The trick in the wiki really cheats (so does msvceok) and isnt a very elegant of solution.
The solution (as suggested by many) - use VS as an IDE, compile using gcc.
I once tried writing test kernel in VS2005 C++, it was a basic kernel-success! But trust me - gcc makes life much more easier.
Posted: Fri Jul 06, 2007 2:34 pm
by Colonel Kernel
@Any moderator:
This thread belongs in OS Development.
Posted: Fri Jul 06, 2007 2:37 pm
by Alboin
Yeah. I really can't suggest it either. Go with Cygwin. (Or Mingw. Did they ever fix that bug? I haven't used it in ages...)
As for the debugger, I believe several emulators come with one built in. (GDB, I think.)
That's about it. You could even try a different editor if you like. (Vi is nice.)
That's about it.

Posted: Sat Jul 07, 2007 3:00 am
by Kevin McGuire
The trick in the wiki really cheats (so does msvceok) and isnt a very elegant of solution.
No, msvceok does not cheat. At the very least I had been arguing that it was a very elegant way. It uses a stub inserted by the linker which loads the PE32
correctly into memory.
I wrote that. I remember, before any other had. By the way does anyone have the most recent version of that I wrote? I lost it a while back. Found it for a guy and uploaded to the old forum.. then during the transition here it got lost again (the post attachment)... sadly..
The trick in the wiki really cheats..
You are right about this. I kept telling people it would not work forever. They just would not listen. I am glad someone else finally views that ""
trick in the wiki"" the same as I did.
Posted: Thu Jul 12, 2007 5:33 am
by LaurensR1983
I'm using a combination of the microsoft c compiler with the GNU linker and NASM.
I did this by creating a makefile project in VS2005 and creating a batchfile wich calls cl.exe (the MS C compiler). I used the GNU linker because it offers some flexibility that the microsoft linker doesn't have (or that I'm not aware of).. in my case linker scripts
I suggest you learn some information about Multiboot compatible PE kernels to start out with. I don't reccommend doing a non multiboot compatible PE kernel, because you would need a custom bootloader which is able to load PE images.
It's not possible to use VS2005 debugging, because:
- You would be running in a virtual enviroment (either Bochs, Virtual PC, VmWare etc)
- VS2005 uses a background service (called MDM) for debugging windows applications. Which you clearly don't have in your OS.
So if you want good debugging tools, I suggest you use BOCHS (helped me out a lot of times).