Page 1 of 2

Using Xcode for OSDev

Posted: Thu Oct 10, 2013 1:33 am
by zhiayang
Hello! I'm sure this has been discussed before, but I couldn't find any concrete info.
As the title suggests, I'm trying to setup an Xcode project for my OS.

I've managed to use an External Build System template to set up my makefile and at least get the project to build.

Problem is, none of the code-stuff works, such as Go to Implementation or a proper autocomplete (right now I think it just lists a bunch of matching symbols)
It all seems to be overly-biased towards actually creating App store apps, and not as a fully-featured IDE...
but it looks so good!

Any help?

Re: Using Xcode for OSDev

Posted: Thu Oct 10, 2013 2:32 am
by Combuster
requimrar wrote:but it looks so good!
Mac user stereotype detected! :mrgreen:
Problem is, none of the code-stuff works, such as Go to Implementation or a proper autocomplete (right now I think it just lists a bunch of matching symbols)
It all seems to be overly-biased towards actually creating App store apps, and not as a fully-featured IDE...
XCode's autocomplete is far from perfect, and it works best with "typical" objective-C use, Basically, if you're trying regular C like I'm guessing you are, then there will be relatively less context-sensitive things to autocomplete as the only place you can try that is by accessing struct members.

Based on the description I just can't deduce if autocompletion is working worse than it would for a normal C app.

Re: Using Xcode for OSDev

Posted: Thu Oct 10, 2013 3:52 am
by bluemoon
Combuster wrote:Based on the description I just can't deduce if autocompletion is working worse than it would for a normal C app.
Exactly. However the way xcode does with autocompletion is different from visual studio, kdev or code block.
It blindly scan the whole project and put every word into the dictionary for completion, therefore you don't get class specific hints, even for normal C++ project.
(Or it was designed so poorly I could not make use of it).

Re: Using Xcode for OSDev

Posted: Thu Oct 10, 2013 7:07 am
by dozniak
requimrar wrote:Any help?
Yep. ST3!

Re: Using Xcode for OSDev

Posted: Thu Oct 10, 2013 10:30 am
by zhiayang
Oh well. I'm actually using C++, so there's slightly more autocomplete-able things out there.

Too bad then.
dozniak wrote: Yep. ST3!
I'm actually currently using that, just that with the new version 3 it's terrible hard to edit the language files (now hidden inside the .app, thanks a lot for nothing!) to change a couple of things that I want to

Combuster wrote: Mac user stereotype detected! :mrgreen:
Well. Let's just say I really like the new ios7 look (:





Also, another unrelated issue; right now my makefile is set up to execute qemu, which mostly works fine... except for one annoyance.
For some reason, the QEMU window doesn't come into focus automatically. It used to do that before, but now for some reason it stopped, and I have to click on the dock icon to bring it up.

Not game-breaking, but definitely an inconvenience.

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 4:42 am
by nerdguy
When it comes to OSDeving I guess there are only 2 OSes that are "made" for that :
Linux
BSD
No buggy Windows or Stylish Macintosh is optimized for OSDeving,
Anyways Seems that you would need some help
First set up GCC, (Nope,I don't care Whatever the XCode Compiler is. OSDeving is best on GCC.(But that's my opinion))
Read Here : http://stackoverflow.com/questions/9353 ... -xcode-4-4
Now goto the Wiki and checkout C Barebones,
Follow the steps,
Or maybe you could set up a light-weight Linux Distro on a Virtual Machine? Howzz That?
If you are having any problems them keep us updated.

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 4:44 am
by bwat
nerdguy wrote:When it comes to OSDeving I guess there are only 2 OSes that are "made" for that :
Linux
BSD
Then tell me how did those two operating systems get developed?

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 4:47 am
by zhiayang
nerdguy wrote:When it comes to OSDeving I guess there are only 2 OSes that are "made" for that :
Linux
BSD
No buggy Windows or Stylish Macintosh is optimized for OSDeving,
Anyways Seems that you would need some help
First set up GCC, (Nope,I don't care Whatever the XCode Compiler is. OSDeving is best on GCC.(But that's my opinion))
Read Here : http://stackoverflow.com/questions/9353 ... -xcode-4-4
Now goto the Wiki and checkout C Barebones,
Follow the steps,
Or maybe you could set up a light-weight Linux Distro on a Virtual Machine? Howzz That?
If you are having any problems them keep us updated.

One, help appreciated.
Two, you misunderstand.
This topic is purely about the IDE. Nothing about compilers of any of the sort.


Three, my toolchain is already set up, and I'd like to say that I prefer clang, simply because you don't need to rebuild for every damn platform, but to each his own.

Four, I don't need any barebones tutorial, because as I said this discussion is purely about using an IDE.

Five, I've already tried doing OSDev in a VM and let's just say it is /not/ pleasant.
Six, if you'd read between the lines the problem was already solved by compromise, Xcode is simply not suitable for this kind of stuff.



Last, I'd suggest you understand the topic before you go randomly posting things.
No offence intended.

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 4:48 am
by zhiayang
bwat wrote:
nerdguy wrote:When it comes to OSDeving I guess there are only 2 OSes that are "made" for that :
Linux
BSD
Then tell me how did those two operating systems get developed?

<sarcasm>

Someone used BSD to develop Linux.
Elsewhere, someone used Linux to develop BSD.

</sarcasm>

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 4:54 am
by bwat
requimrar wrote: One, help appreciated.
Two, you misunderstand.
This topic is purely about the IDE. Nothing about compilers of any of the sort.
...
Last, I'd suggest you understand the topic before you go randomly posting things.
No offence intended.
Thought you handled that very well. You see a certain problem with reading comprehension on internet forums but it seems especially bad here. I've bitten my tongue more than once today.

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 5:39 am
by zhiayang
bwat wrote:
Thought you handled that very well. You see a certain problem with reading comprehension on internet forums but it seems especially bad here. I've bitten my tongue more than once today.

Haha thanks!

I try to distance myself from these discussions, because more often than not these are a bunch of wannabes who think this is some easy thing to do. Also those who can't really speak english (not a problem with that), and are using that as a crutch or excuse instead of actually doing the required reading etc.

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 5:44 am
by nerdguy
Haha thanks!

I try to distance myself from these discussions, because more often than not these are a bunch of wannabes who think this is some easy thing to do. Also those who can't really speak english (not a problem with that), and are using that as a crutch or excuse instead of actually doing the required reading etc.
I agree.
Anyways, Did you get the answer? (I am sorry for the misunderstanding)

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 5:49 am
by iansjack
nerdguy wrote:When it comes to OSDeving I guess there are only 2 OSes that are "made" for that :
Linux
BSD
No buggy Windows or Stylish Macintosh is optimized for OSDeving,
I wonder if you can expand on your answer a little. What, in your experience of using XCode, makes it unsuitable for OS development?

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 6:07 am
by nerdguy
As I said it's all my opinion, For XCode there aren't many docs available + the wiki kernel tutorials doesn't tell you anything for XCode
Google Searches would prove it.
https://www.google.com/search?q=buildin ... 20mac%20os
Brokenthron Kernel Tutorials use Visual C++ as an IDE. (I take back my Windows Statement but again you need a lot of tools like Cygwin which make it a bit uncomfortable for OSDeving)
Also COSMOS (C# Open-Source Managed OS) uses VC#,VB,VC++ or any other .NET Language IDE.
I have nothing to say about Linux and BSD. (Most of the OSes can be easily Compiled on Linux and BSD)
Also people in this topic have said that to compile the Linux Kernel on Mac is to use a Virtual Machine that runs Linux.
http://stackoverflow.com/questions/1001 ... n-mac-os-x
Except one who gave an unclear solution.
Note that it's all my opinion, Might be that someone may have managed to compile a kernel on a Mac. But it's not fitting for certain reasons like Documentation.

Re: Using Xcode for OSDev

Posted: Thu Nov 07, 2013 6:19 am
by iansjack
I'm just curious as to how this translates into your actual experience of development on a Mac. After all, it uses the same compiler as Linux, so it should be trivial to apply any tutorials based on Linux to a Mac. I can't see that documentation is a problem. (And there are plenty of OS tutorials aimed at Windows.)

I'm not really interested in third-hand accounts from StackOverflow - I could read them for myself. I am just interested to know what experience makes you recommend against using a Mac for OS development. What particular problems have you encountered?