OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:29 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Raspberry Pi OS Dev in Visual Studio?
PostPosted: Thu Jun 07, 2018 8:07 am 
Offline

Joined: Mon May 14, 2018 5:05 am
Posts: 2
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?


Top
 Profile  
 
 Post subject: Re: Raspberry Pi OS Dev in Visual Studio?
PostPosted: Thu Jun 07, 2018 9:20 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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


Top
 Profile  
 
 Post subject: Re: Raspberry Pi OS Dev in Visual Studio?
PostPosted: Fri Jun 08, 2018 1:31 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 640
Location: Ukraine, Bachmut
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

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Top
 Profile  
 
 Post subject: Re: Raspberry Pi OS Dev in Visual Studio?
PostPosted: Fri Jun 08, 2018 9:22 pm 
Offline
User avatar

Joined: Wed Jun 06, 2018 9:15 pm
Posts: 15
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 73 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group