Page 1 of 1 [ 4 posts ] 

K_Kelly
Veteran
Veteran

User avatar

Joined: 18 Apr 2014
Age: 33
Gender: Male
Posts: 1,452

26 Oct 2015, 9:36 pm

I'm learning C so I can one day do a project of developing an operating system. I need to know which C dialects that OSes, even those like Windows and Linux are coded in. The more proper way to phrase this would be, does the standard matter?

And I'm a relatively new coder, but I have had no real trouble with C yet. I can see why some may even endorse it as a first language.



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 57
Gender: Female
Posts: 2,820
Location: S.F Bay Area

26 Oct 2015, 10:15 pm

Well, here's some classic Linus Torvalds on why Linux is written in pure C and not C++:
http://article.gmane.org/gmane.comp.version-control.git/57918
(although much of userland is written in Python, C++, etc.)

Windows: C++, kernel is in C
Mac: Objective C, kernel is in C (IO PnP subsystem is Embedded C++)

Many embedded OS's: C
Many realtime OS's: even lower level


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


K_Kelly
Veteran
Veteran

User avatar

Joined: 18 Apr 2014
Age: 33
Gender: Male
Posts: 1,452

27 Oct 2015, 5:44 pm

No, I know C is the language, but is there a particular C standard like ANSI that OSDev uses?



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 57
Gender: Female
Posts: 2,820
Location: S.F Bay Area

27 Oct 2015, 9:51 pm

I wish more people knew about OSDev that want to dig deeper into operating systems.

Linux:
gnu89, soon to be C11 if it isn't already (I've not kept track, but it'll be when the next version of gcc is released)

Windows:
C, C#, C++, some assembly.
The C is mostly ANSI C.

Mac:
Appears to be Embedded C++?


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan