Creating your own OS

As I have read before, Visual Basic can make apps, but is limited by the fact that it can't create an OS. I heard that C could do that. Well, after a long week of searching for the software, I decided to ask for some advice. In all your opinions, what is the best programming languge to use to make an OS? And what version, or type of that language? Because I asked for C, and they asked what type of compiler. Thanks for your responses!
- S. Tranton

Comments

  • : As I have read before, Visual Basic can make apps, but is limited by the fact that it can't create an OS. I heard that C could do that. Well, after a long week of searching for the software, I decided to ask for some advice. In all your opinions, what is the best programming languge to use to make an OS? And what version, or type of that language? Because I asked for C, and they asked what type of compiler. Thanks for your responses!
    : - S. Tranton
    :

    Well I have no experience in writing operating systems but as far as I am aware C and C++ with assembler in parts are usually the preferred options. There are a couple of open source OSs out on the net if you browse around. Try sourceforge.
  • Java will help you get to grips with some of the concepts...
    OSes are indeed programmed in C & Assembly... Tho I'm not sure about C++ It would make a certain amount of sense to use C++, but C is supposed to be faster.

    Java is a simpler language, and takes a lot of the intricacies out of C/C++ (eg pointers) and so, is a much easier language to learn stuff in.
    /*

    Those of you who believe in
    psychokenesis, raise my hand.

    */


  • Creating an OS isn't that easy.. I'm currenty trying to develop one...
    I'm programming in c/c++ and assembly using compilers:
    GCC/DJGPP - for c/c++ (DJGPP are the DOS/Win-version)
    NASM - for assembly

    Lots of information:
    www.osdev.net
    http://www.mega-tokyo.com/os/os-faq.html

    Download compilers (free)
    http://osdev.neopages.net/downloads.php
  • : As I have read before, Visual Basic can make apps, but is limited by the fact that it can't create an OS. I heard that C could do that. Well, after a long week of searching for the software, I decided to ask for some advice. In all your opinions, what is the best programming languge to use to make an OS? And what version, or type of that language? Because I asked for C, and they asked what type of compiler. Thanks for your responses!
    : - S. Tranton
    :

    The best language for writing an OS is, imo, assembler. Especially when you are making a small OS for a microcontroller. If you are using C you will need a compiler that adds things out of the ANSI standard. You will need to access the stack, condition code register etc. You probably want a compiler that supports inline assembler.

    It is possible to write it in C++, but then you must be more carefull what you do. Things like abstract base classes, templates etc tend to eat memory.

    My opinion is that you should avoid Java in anything hardware-related or time critical.
  • :
    : My opinion is that you should avoid Java in anything hardware-related or time critical.
    :

    As far as i know it is not possible to create an OS with Java anyway for the same reason you can't create an OS with Visual Basic.

    Both Java and Visual Basic are actually scripting languages rather than programming languages because they require a runtime component in order to be executed. In effect the programs created in Java and Visual Basic consist of a program which loads the runtime component and a script which is passed to the runtime component for execution.
  • : :
    : : My opinion is that you should avoid Java in anything hardware-related or time critical.
    : :
    :
    : As far as i know it is not possible to create an OS with Java anyway for the same reason you can't create an OS with Visual Basic.
    :
    : Both Java and Visual Basic are actually scripting languages rather than programming languages because they require a runtime component in order to be executed. In effect the programs created in Java and Visual Basic consist of a program which loads the runtime component and a script which is passed to the runtime component for execution.
    :

    I'm no expert on this, but if the Java compiler translated the source to op-code, it could theoretically work. But then you would have to abandon things like Java VM, platform independance and all that. And then there wouldn't be much left of the advantage that Java has on C++, except some nicer syntax maybe.
  • Sorry for any misleading stuff I put down...

    My reason behind mentioning Java was purely to get to grips with certain concepts... Eg, Threading is WAAAYYYY easier in Java than in C++!!!
    /*

    Those of you who believe in
    psychokenesis, raise my hand.

    */

  • [b][red]This message was edited by dwgebler at 2004-1-27 5:21:23[/red][/b][hr]
    Java is not scripted, though. It has its own byte-code specification that requires the Java VM to execute it (hence 'virtual machine' rather than 'interpreter'). I know of a few compilers that translate Java byte-code to native x86 if you badly need speed and you are targeting only this platform.
    Visual Basic is kind of scripted, but not because it requires a runtime component. All C++ programs I make require a runtime component, just its usually statically binded to the exe. I don't think static binding exists in VB6 for the runtime component at least.

    I think one of the main issues with writing an OS in Java wouldbe the lack of direct memory access and inline assembler, but Java applications can do almost anything as far as I know.


    : Sorry for any misleading stuff I put down...
    :
    : My reason behind mentioning Java was purely to get to grips with certain concepts... Eg, Threading is WAAAYYYY easier in Java than in C++!!!
    : /*
    :
    : Those of you who believe in
    : psychokenesis, raise my hand.
    :
    : */
    :
    :



  • Virtual Machine is just a fancy name for a runtime intepreter. Java programs require the VM to be installed in order to run (unless of course the programs are compiled into machine code rather than code that requires the VM). Just like Visual Basic programs require the Visual Basic runtimes to be installed in order to run.

    All programs that have use other components require those to be installed somewhere aswell in order for the program to access them and load them. For example winsock, a program cannot use winsock if it isn't installed.

    The difference with the Java and VB runtimes(or Virtual Machine for Java if you like) is that the program actually requires them to be executed.

  • : As I have read before, Visual Basic can make apps, but is limited by the fact that it can't create an OS. I heard that C could do that. Well, after a long week of searching for the software, I decided to ask for some advice. In all your opinions, what is the best programming languge to use to make an OS? And what version, or type of that language? Because I asked for C, and they asked what type of compiler. Thanks for your responses!
    : - S. Tranton
    :

    [blue]
    Depending on how you go about building your OS, you can't build your bootsector (bootloader) code in C, you have to resort to using someone else's code, or write your own code in assembler, be that in x86 Intel style or AT&T GNU style assembly language.

    There is also a few CPU specific operations you cannot write in C, those being Interrupt Service Routines that return with IRET (on i386 machines) opcodes and other functions such as commands to load the GDT (i386) can be inlined but still require using assembly.

    I got the above info from this web site
    http://www.mega-tokyo.com/os/os-faq.html
    [/blue]
  • : : As I have read before, Visual Basic can make apps, but is limited by the fact that it can't create an OS. I heard that C could do that. Well, after a long week of searching for the software, I decided to ask for some advice. In all your opinions, what is the best programming languge to use to make an OS? And what version, or type of that language? Because I asked for C, and they asked what type of compiler. Thanks for your responses!
    : : - S. Tranton
    : :
    :
    : [blue]
    : Depending on how you go about building your OS, you can't build your bootsector (bootloader) code in C, you have to resort to using someone else's code, or write your own code in assembler, be that in x86 Intel style or AT&T GNU style assembly language.
    :
    : There is also a few CPU specific operations you cannot write in C, those being Interrupt Service Routines that return with IRET (on i386 machines) opcodes and other functions such as commands to load the GDT (i386) can be inlined but still require using assembly.
    :
    : I got the above info from this web site
    : http://www.mega-tokyo.com/os/os-faq.html
    : [/blue]
    :

    That's true enough for a PC. On microcontrollers you will often have the bootloader commands in the hardware. You will need to access those commands from the outside, where the language doesn't matter as long as the microcontroller gets the right commands.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories