Visual Studio 2008

Programming, for all ages and all languages.
InsightSoft
Member
Member
Posts: 76
Joined: Mon Aug 18, 2008 6:17 am

Visual Studio 2008

Post 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?
User avatar
imate900
Member
Member
Posts: 80
Joined: Sat Feb 28, 2009 11:43 am

Re: Visual Studio 2008

Post 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).
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Visual Studio 2008

Post 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".
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Visual Studio 2008

Post 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. :)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Re: Visual Studio 2008

Post 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.
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Visual Studio 2008

Post 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.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
ru2aqare
Member
Member
Posts: 342
Joined: Fri Jul 11, 2008 5:15 am
Location: Hungary

Re: Visual Studio 2008

Post 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.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Visual Studio 2008

Post by neon »

In addition to ru2aqare, you can also always configure MSVC to use another assembler instead of MASM.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Re: Visual Studio 2008

Post 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)
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !
InsightSoft
Member
Member
Posts: 76
Joined: Mon Aug 18, 2008 6:17 am

Re: Visual Studio 2008

Post 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...
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Visual Studio 2008

Post 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 :P.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
ru2aqare
Member
Member
Posts: 342
Joined: Fri Jul 11, 2008 5:15 am
Location: Hungary

Re: Visual Studio 2008

Post by ru2aqare »

Creature wrote:Yes, sorry, my mistake, the names just look so much alike :P.
No fret, a few years ago I also thought that MASM32 was official...
InsightSoft
Member
Member
Posts: 76
Joined: Mon Aug 18, 2008 6:17 am

Re: Visual Studio 2008

Post 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)
ru2aqare
Member
Member
Posts: 342
Joined: Fri Jul 11, 2008 5:15 am
Location: Hungary

Re: Visual Studio 2008

Post 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.
InsightSoft
Member
Member
Posts: 76
Joined: Mon Aug 18, 2008 6:17 am

Re: Visual Studio 2008

Post by InsightSoft »

yes... you are right... Actually, when I reefer to NASM I really meaning the full environment
(compiler+linker)...
Post Reply