Using Xcode for OSDev

Programming, for all ages and all languages.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Using Xcode for OSDev

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Using Xcode for OSDev

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Using Xcode for OSDev

Post 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).
Attachments
autocomplete
autocomplete
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: Using Xcode for OSDev

Post by dozniak »

requimrar wrote:Any help?
Yep. ST3!
Learn to read.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Using Xcode for OSDev

Post 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.
User avatar
nerdguy
Member
Member
Posts: 70
Joined: Wed Oct 30, 2013 8:11 am

Re: Using Xcode for OSDev

Post 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.
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: Using Xcode for OSDev

Post 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?
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Using Xcode for OSDev

Post 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.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Using Xcode for OSDev

Post 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>
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: Using Xcode for OSDev

Post 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.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Using Xcode for OSDev

Post 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.
User avatar
nerdguy
Member
Member
Posts: 70
Joined: Wed Oct 30, 2013 8:11 am

Re: Using Xcode for OSDev

Post 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)
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Using Xcode for OSDev

Post 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?
User avatar
nerdguy
Member
Member
Posts: 70
Joined: Wed Oct 30, 2013 8:11 am

Re: Using Xcode for OSDev

Post 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.
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Using Xcode for OSDev

Post 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?
Post Reply