Thread: Why Can't C++ Be Used to Develop Operating System?

  1. #1
    C/C++Newbie Antigloss's Avatar
    Join Date
    May 2005
    Posts
    216

    Why Can't C++ Be Used to Develop Operating System?

    Hello, every body.

    I'm sorry to bother you when you are busy. But I do need to get help from you. Recently, I had a discussion with a friend about C and C++. He said that C++ is used to develop software only, while C can not only be used to develop software, but also can be used to develop operating system. He also said that C had been proved to be able to develop a stable operating system, while C++ has not. At this point he mentioned that Unix was developed with C, and it is the most stable operating system all over the world. He also said that there is no operating system developed with C++ by now. Is that true? If it's true, why can't C++ be used to develop operating system? Is it because C++ is less efficient than C? If what he said is wrong, could you please tell me which operating system was developed with C++? Thank you very much!

    I’m learning C++ now. I had learnt C before I learn C++, and I know that C++ can do anything that C can. But why can’t C++ be used to develop operating system? It’s really hard for me to understand. C is a procedural programming language, while C++ is a multiparadigm language providing support for procedural, object-based and also object-oriented programming. Since C++ supports procedural programming just like C, why can’t C++ be used to develop operating system. I really can’t understand.

    Looking forward to hearing from you.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    In a word: Google


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    YOu could in theory create an operating system in any language once you have the lowest level compoents written in assembly language. Windows was written in c and assembler, some new componants would seam to have been written using c++ such as those exposing COM interfaces like explorer.

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Cause C++ sucks duh. All the l33t programmers make OS's in VB.
    Woop?

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    BeOS~~
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  6. #6
    Registered User
    Join Date
    Aug 2003
    Posts
    127
    Nana C++ Library is a GUI framework that designed to be C++ style, cross-platform and easy-to-use.

  7. #7
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    It's a "chicken and egg" thing.

    If you want to write an OS for the PC today, you can use any language of your choice. No matter what language you choose, you would likely need to use some assembly (or machine) language also.

    If you wanted to create an operating system for some brand-new microprocessor with a brand-new machine language instruction set, you would start by writing a cross-compiler... A compiler that runs on your PC, but generates machine-code that runs on the new target system. Again, you could you any language. It just has to spit-out machine-code for the target machine. (You might have to burn that code into a flash-chip if the target machine doesn't have a BIOS.)

    Unix existed before C. It was first written in assembly. I believe the first C compiler was written in assembly too. That means they had to write an assembler first (in machine language, I assume)! But, both C and unix evolved together. Dennis Ritchie (and probably others) worked on both projects at Bell Labs.

    Linux was the other way 'round. Linus used the already-existing GCC compiler to create Linux.
    Last edited by DougDbug; 05-26-2005 at 03:19 PM.

  8. #8
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    And since a C compiler is far easier to write than a C++ compiler, that's one of the reasons why C++ isn't used to develop the core of an OS.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Operating System
    By Houssen in forum C Programming
    Replies: 18
    Last Post: 04-22-2008, 12:51 PM
  2. Operating System Project
    By Pete in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 07-15-2004, 09:33 AM
  3. What is a Microsoft Operating System Like?
    By Troll_King in forum A Brief History of Cprogramming.com
    Replies: 35
    Last Post: 10-21-2002, 07:36 AM
  4. Operating system
    By sopranosomega in forum C Programming
    Replies: 6
    Last Post: 10-07-2002, 06:12 AM
  5. Microsoft = The Best Operating System
    By Troll_King in forum A Brief History of Cprogramming.com
    Replies: 92
    Last Post: 02-08-2002, 01:32 PM