OSDev.org
https://forum.osdev.org/

Raspberry Pi OS Dev in Visual Studio?
https://forum.osdev.org/viewtopic.php?f=1&t=32991
Page 1 of 1

Author:  kiunthmo [ Thu Jun 07, 2018 8:07 am ]
Post subject:  Raspberry Pi OS Dev in Visual Studio?

Is it possible to use Visual Studio (for Windows) to program an OS for a Raspberry Pi using C++?

I'm very much a beginner to this and maybe I'm looking for too easy an answer. I understand I need a cross compiler and methods of linking to the C++ runtime to be able to build the program. Is this possible to do?

Author:  iansjack [ Thu Jun 07, 2018 9:20 am ]
Post subject:  Re: Raspberry Pi OS Dev in Visual Studio?

I'm sure it's possible, but I'm not sure it's the best solution, even on a Windows machine.

Personally I would use Eclipse or Visual Studio Code. (Actually, personally I would use Linux rather than Windows for this work as I find it a more natural fit.)

There's a thread here that might help: https://www.raspberrypi.org/forums/view ... p?t=203761

Author:  zaval [ Fri Jun 08, 2018 1:31 pm ]
Post subject:  Re: Raspberry Pi OS Dev in Visual Studio?

kiunthmo wrote:
Is it possible to use Visual Studio (for Windows) to program an OS for a Raspberry Pi using C++?

I'm very much a beginner to this and maybe I'm looking for too easy an answer. I understand I need a cross compiler and methods of linking to the C++ runtime to be able to build the program. Is this possible to do?

Didn't check, but it could target UEFI, so, probably yes.

There is yet another option worth paying attention to, for the OS development case especially. This is to throw all those fancy IDE bloat away and use command line tools. For ARM, both a32 and a64 instruction sets, there is Linaro toolchains. For Windows too, I use it btw. It's everything you need for the OS development. Unfortunately, for some GNU/reasons, :D it's size bloated as hell, and cannot make PE targets. But with it, you start to do what you really want very fast. Forgetting about all that distracting crap, you could concentrate exactly on your own work, because you need to learn the ARM architecture, its assembly, compiler options related to it etc, and not how to force your gigabytes worth stupid IDE to disconnect finally out of the host OS specifics it spits at you. no matter Windows it is or Linux. I don't know, I'd never do OS on these IDEs. using them is a burden. :D
1) you download "bare metal" linaro toolchain (no, they didn't manage to combine 32 and 64 bits, maybe it's better, hard to imagine what a mess it could be, so distinct toolchains). install it.
2) you create a simple .cmd file setting PATH, some other useful things like the prefix for those lenghty names of the binaries, then make a command prompt link that has this file as a target. launching such a prompt will bring you into a working command line with properly set environment.
3) and that's all! you start to write your OS, in asm, C, or even C++! reading gcc documentation - it is right there - will teach you about loader scripts, compiler options, and assembly thingies. ah, and make. You need a make utility yet. :)
Isn't it much cooler than IDE? Yes it is! Because you need to spend your project time on architecting your OS and fighting several thousands pages of ARM manuals and manuals from the SoC vendor, and not on fighting a stupid, ineficient IDE.

Oh and as a visual example of that, below is a screenshot of my initial work on an OS loader running on a 64 bit bare board (Pine64+). I wrote it exactly with the help of such a toolset. It prints into UART by itself, and that printing starts from ANTOSLOADER string. :)
Image

Author:  MSDOSDudeNot [ Fri Jun 08, 2018 9:22 pm ]
Post subject:  Re: Raspberry Pi OS Dev in Visual Studio?

It's very possible, it can write C/C++ code, right? :wink:

The only thing that I do not see happening is having IDE support for this platform. I don't know of any plug-ins that would enable custom builds to this architecture. But you can definitely use it write the code for the operating system. You will have to setup the building procedures yourself, though.

So yes, use it to write the code and files for you operating system, but unless there are plug-ins to add support for this kind of project, since it doesn't exist, at least to the best of my knowledge, you won't be able to build the project through Visual Studio.

Good luck, man!

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/