Page 1 of 2
Visual Studio 2008
Posted: Tue Apr 28, 2009 6:43 pm
by InsightSoft
Hi,
Well I have a big problem...
I really want to take advantage of this IDE... why? because the the Microsoft MASM instructions are very similar to that one that is present on Intel's manuals... and we can compile C/C++ and ASM code just clicking on build solution... Yes, we need to make some adjustment, switching off some features like informations for debug on the fly... But that's OK... Even with some limitations, even so, I still believe that is more attractive working with Visual Studio rater than with GCC+NASM...
Is there any suggestion? for example controlling stack overflows? Does anybody tell me the exactly advantage of working with GCC+NASM (because the majority of tuts on the net use this tools); Or is there any IDE that we can use with GCC+NASM that cannot be targeted to a specific OS?
Re: Visual Studio 2008
Posted: Tue Apr 28, 2009 6:54 pm
by imate900
InsightSoft wrote:Hi,
Well I have a big problem...
I really want to take advantage of this IDE... why? because the the Microsoft MASM instructions are very similar to that one that is present on Intel's manuals... and we can compile C/C++ and ASM code just clicking on build solution... Yes, we need to make some adjustment, switching off some features like informations for debug on the fly... But that's OK... Even with some limitations, even so, I still believe that is more attractive working with Visual Studio rater than with GCC+NASM...
Is there any suggestion? for example controlling stack overflows? Does anybody tell me the exactly advantage of working with GCC+NASM (because the majority of tuts on the net use this tools); Or is there any IDE that we can use with GCC+NASM that cannot be targeted to a specific OS?
GCC is better in some areas than the Microsoft C compilers in Visual Studio. Firstly, the Microsoft compilers (and thus VS08) is more targeted at Windows; GCC can target any platform (I can develop on the GNU Hurd if I want to ^_^). Second, then we have the open-sourced GCC and closed Microsoft C. Third, GCC is a little smarter. Finally, GCC supports more languages.
NASM is in every way similar to the VS08 Intel-style assembly. The only difference is NASM supports more formats.
IDE? How about Code::Blocks (closest thing found)? You would need to program in gas (but this is fixed by .intel_syntax noprefix at the top of the Assembler file, though).
Re: Visual Studio 2008
Posted: Tue Apr 28, 2009 7:53 pm
by pcmattman
The biggest advantage to GCC is that it's extremely easy to use for many different architectures. It's also quite standards compliant and, because many people use it (especially here on OSDev.org) you can get support with your problems extremely quickly.
On the other hand, neon (iirc) has a bunch of tutorials about making an OS using Visual C++.
If all you want is the IDE, it's also possible to create a "Makefile Project" and have that run your project's Makefiles when you click "Build".
Re: Visual Studio 2008
Posted: Tue Apr 28, 2009 8:31 pm
by neon
Is there any suggestion?
The only suggestion that I usually give out is to use the best tools for your project and that you have the most experience with. If you feel more comfortable with MSVC, use it. If you do not, try something else.
Decide what tool chain is best for your project and try it.
Re: Visual Studio 2008
Posted: Wed Apr 29, 2009 12:35 am
by gedd
InsightSoft wrote:But that's OK... Even with some limitations, even so, I still believe that is more attractive working with Visual Studio rater than with GCC+NASM...
So keep your prefered IDE. I try many solutions to develop my OS on windows and
for me the two best are
- Eclipse CDT(5.x) + cygwin(gcc cross compiled) + nasm
- Visual Studio and eventualy nasm in a VS makefile project for boot and loader
The two solution give you intellisense and fast acces to your function, definition, class, etc, ... and other good feature
When your os grow up, it's very important.
I worked long time with Eclipse CDT but now i'm on Visual C++ 2008 that is more confortable.
Re: Visual Studio 2008
Posted: Wed Apr 29, 2009 5:19 am
by Creature
Don't want to burst anyone's bubble here, but isn't using MASM to develop your own OS illegal? Doesn't the license explicitly say that you can only create Windows software with it? Correct me if I wrong, but if I remember correctly, it's not allowed.
Besides that, if you like the IDE so much but don't want to use the compiler/assembler, that's fine. Visual Studio has build rules for these kind of things. I build my entire OS by just clicking the 'build' button, build & run builds my entire OS and runs Bochs with the new version. When I add a new ASM/C/C++ source file, it automatically gets assigned to YASM/GCC. The only thing I haven't managed to do inside visual studio is use the GCC linker instead of the VC++ one, I just use a separate batch for that and let it execute post-build.
Re: Visual Studio 2008
Posted: Wed Apr 29, 2009 6:30 am
by ru2aqare
Creature wrote:Don't want to burst anyone's bubble here, but isn't using MASM to develop your own OS illegal? Doesn't the license explicitly say that you can only create Windows software with it? Correct me if I wrong, but if I remember correctly, it's not allowed.
Using MASM (which comes with VS) is not illegal. Using MASM32 for osdev'ing (which does not come with VS and you have to download it from a 3rd party site) is illegal.
Re: Visual Studio 2008
Posted: Wed Apr 29, 2009 6:44 am
by neon
In addition to ru2aqare, you can also always configure MSVC to use another assembler instead of MASM.
Re: Visual Studio 2008
Posted: Wed Apr 29, 2009 7:13 am
by gedd
Creature wrote:Besides that, if you like the IDE so much but don't want to use the compiler/assembler, that's fine. Visual Studio has build rules for these kind of things.
Yes makefile project and/or tools menu
I personnaly use a makefile projet with nasm for boot&loader and C++ project for kernel and libs, in my solution.
Creature wrote:I build my entire OS by just clicking the 'build' button, build & run builds my entire OS and runs Bochs with the new version
Visual Studio[F5, F7], Eclipse [F11, CTRL-F11], and other I[ntegrated]DE can do that.
Creature wrote:The only thing I haven't managed to do inside visual studio is use the GCC linker instead of the VC++ one, I just use a separate batch for that and let it execute post-build.
VC++ link PE format executable file, either use PE format (neon wrote tuto about it) or use makefile to compile/link.
Many solution, many different way , many different people with many differrent experience .. and so on...
Real question is "how i feel my devellopment tools ?"
I you feel good use it and stop asking you question ;o)
Re: Visual Studio 2008
Posted: Thu Apr 30, 2009 7:14 am
by InsightSoft
Thanks guys...
It has been more difficult to choose the correct tools than understanding what is need to do to make up and running an operating system... actualy I have the same piece of intelligence running in C and NASM and the same on Visual C++ and MASM... i am trying to solve a little problem in this last one...
My big problem is that with growing of the code, I become a lost man...
In C+NASM seems to me that is more easy to control the implementation;
With visual studio, with so much help it become easy to get lost, mainly on implementations C++/MASM..., etc
Why I still trying Visual Studio: For a long time I use that IDE; I start learning programming the absolte low-level with MASM (lot of manuals, ect)
When I realize that NASM, GAS can be the next choice, I was getting upset with some diferences with opcodes with standards (Intel books that I have eaten) (for ex: OUT DX, AL)...
I dont sleep for 4 days... I am working 24h per day trying to learn as quick as possible, reading books and books and books... (This weekend, after the grand premio of MotoGP I will sleep one week straight)
Now, what I am looking for, is steal some experience from you Guys... and be sure that I will take the correct line, correct steps...
That's why, I thanks all of you...
Re: Visual Studio 2008
Posted: Thu Apr 30, 2009 12:55 pm
by Creature
ru2aqare wrote:Creature wrote:Don't want to burst anyone's bubble here, but isn't using MASM to develop your own OS illegal? Doesn't the license explicitly say that you can only create Windows software with it? Correct me if I wrong, but if I remember correctly, it's not allowed.
Using MASM (which comes with VS) is not illegal. Using MASM32 for osdev'ing (which does not come with VS and you have to download it from a 3rd party site) is illegal.
Yes, sorry, my mistake, the names just look so much alike
.
Re: Visual Studio 2008
Posted: Thu Apr 30, 2009 12:57 pm
by ru2aqare
Creature wrote:Yes, sorry, my mistake, the names just look so much alike
.
No fret, a few years ago I also thought that MASM32 was official...
Re: Visual Studio 2008
Posted: Thu Apr 30, 2009 1:49 pm
by InsightSoft
...one of the advantages of NASM is the variety of output formats (like truly binary (free of headers, etc) (And I like that)
Re: Visual Studio 2008
Posted: Thu Apr 30, 2009 4:11 pm
by ru2aqare
InsightSoft wrote:...one of the advantages of NASM is the variety of output formats (like truly binary (free of headers, etc) (And I like that)
Not to start a flame war or anything, but creating the final output - linking the object files together - is not the assembler's job.
One of the advantages of MASM is the strong type checking for structure types. For example, you can use the "assume <register>, ptr <structurename>" construct and the assembler checks that you only access members of that structure via that register. It's a kind of strong typing. I missed this functionality in NASM.
Re: Visual Studio 2008
Posted: Thu Apr 30, 2009 5:36 pm
by InsightSoft
yes... you are right... Actually, when I reefer to NASM I really meaning the full environment
(compiler+linker)...