Page 1 of 1
OS in OBJ-C
Posted: Mon Sep 27, 2010 5:10 am
by arjo129
I would like to know if it is possible to write an OS in Obj-C. I have not found much documentation on it but like the language.
Re: OS in OBJ-C
Posted: Mon Sep 27, 2010 6:45 am
by Solar
See
Languages in the Wiki.
Plus, personal advice: Answer yourself the question if you like the language, period, or if you like the language
because you know it better than the others.
It is usually easier to adapt your skillset to the project (learning a new language), than it is to adapt your project to the skillset (doing a project in a language that is not the best choice for the problem domain).
Re: OS in OBJ-C
Posted: Mon Sep 27, 2010 6:49 am
by JamesM
I thought we had an Obj-C barebones around - I searched for it but couldn't find it.
Did we have one, or am I just seeing things?
Re: OS in OBJ-C
Posted: Mon Sep 27, 2010 8:10 am
by Owen
I don't think we have.
Objective-C is very doable - but fast Objective-C isn't at all easy. Even the biggest promoters of it, Apple, use C++ instead for their kernel.
Basically, the biggest issue is that you will need some form of heap before you can bring up most of the optimizations - which implies you end up with two code paths for the same thing.
Of course, you're in pretty good luck since the Objective-C runtime can be written in straight C (you may want to implement things like objc_msgSend in assembly for speed, though).
Re: OS in OBJ-C
Posted: Mon Sep 27, 2010 8:56 pm
by rocko384
Mac os x uses objective c... Look it up on wikipedia.
Re: OS in OBJ-C
Posted: Mon Sep 27, 2010 10:16 pm
by TylerH
rocko384 wrote:Mac os x uses objective c... Look it up on wikipedia.
Do you expect to start w/o a kernel? Everyone here assumes you mean you want to start a kernel, b/c your asking about starting an OS, with obviously starts with writing the kernel. Contrary to anything you may have read on Wikipedia, very little(I've found no .m so far.) of XNU is in obj-c.
See for yourself... Look it up on Apple's website.
Re: OS in OBJ-C
Posted: Tue Sep 28, 2010 2:54 am
by arjo129
Apple's OS is mostly in c and c++ (XNU). The Objective-C is for high level only. the main reason I would like to use objective c is its convienience and the fact that a single method can return two variables. Would it need a different linker script?
Re: OS in OBJ-C
Posted: Tue Sep 28, 2010 3:26 am
by Combuster
Moot?
Objective-C is not inherently contributing to good programming practices, and it accepts only one argument to return (which basically means there is no advantage over any other language as C and C++ do multiple returns in the same fashion: via pointer arguments or structs)
And the mere fact that you blankly ask about linker script changes suggests that you do not have the expert knowledge on the language required to use it in an OS development context.
In other words: Solar++; learn a proper language for the job.
Re: OS in OBJ-C
Posted: Tue Sep 28, 2010 3:56 am
by arjo129
I have been deving my OS in C thus far. just wanted a change