OS in OBJ-C

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
arjo129
Posts: 21
Joined: Mon May 03, 2010 10:19 pm
Location: Asia, Planet Earth, Solar system, Milky way

OS in OBJ-C

Post 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. :shock:
Zephirum OS- Super secure http://code.google.com/p/zephirum-server/
Number of blue screens of death I have seen: 19
Number of apple OS X kernel panics I have seen: 2
Number of linux kernel panics I have seen: 0
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: OS in OBJ-C

Post 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).
Last edited by Solar on Mon Sep 27, 2010 6:49 am, edited 1 time in total.
Every good solution is obvious once you've found it.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: OS in OBJ-C

Post 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?
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: OS in OBJ-C

Post 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).
User avatar
rocko384
Posts: 18
Joined: Mon Aug 30, 2010 12:09 am
Location: Racine, WI
Contact:

Re: OS in OBJ-C

Post by rocko384 »

Mac os x uses objective c... Look it up on wikipedia.
I've been programming for 6 years, and can learn most languages in a day....you really wanna start a fight?
TylerH
Member
Member
Posts: 285
Joined: Tue Apr 13, 2010 8:00 pm
Contact:

Re: OS in OBJ-C

Post 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.
arjo129
Posts: 21
Joined: Mon May 03, 2010 10:19 pm
Location: Asia, Planet Earth, Solar system, Milky way

Re: OS in OBJ-C

Post 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?
Zephirum OS- Super secure http://code.google.com/p/zephirum-server/
Number of blue screens of death I have seen: 19
Number of apple OS X kernel panics I have seen: 2
Number of linux kernel panics I have seen: 0
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: OS in OBJ-C

Post 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.
"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 ]
arjo129
Posts: 21
Joined: Mon May 03, 2010 10:19 pm
Location: Asia, Planet Earth, Solar system, Milky way

Re: OS in OBJ-C

Post by arjo129 »

I have been deving my OS in C thus far. just wanted a change
Zephirum OS- Super secure http://code.google.com/p/zephirum-server/
Number of blue screens of death I have seen: 19
Number of apple OS X kernel panics I have seen: 2
Number of linux kernel panics I have seen: 0
Post Reply