Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    best language for an OS?

    Hello, I don't have much to do, and I want to know what would be the best language to use to make an OS?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Assembler.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, some things related to the OS (the OS loader, for instance) must be either written in assembly or machine code (which may be generated by a program written in any language, though). Almost all operative system kernels are written in C. Not assembly (too long development procedure), not C++ (too bad performance) and certainly not Java, Pascal, Objective C, D, LISP, ML, Visual Basic, SmallTalk or whichever - they are written in C. However, the kernel itself can be very basic, only handling security, access rights, processes and threads, and I/O at the lowest. You can of course move much more into the kernel if you wish. On top of the kernel you build an application level system. Here you have all various kinds of interfaces and core facilities (UI, GUI, memory handling, application handling, networking, I/O interfacing etc.), and here a memory managed language might be better.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #4
    New Coder
    Join Date
    Jul 2004
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So C would be the best?

  • #5
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    yes C would be the best, but do you have time to write a OS?
    Windows XP is written in combination of C and C++ (I think)

  • #6
    New Coder
    Join Date
    Jul 2004
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks every one!
    btw, I have too much time on my hands...

  • #7
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    glad you have, i'm bogged down with GCSE Coursework!

  • #8
    New Coder
    Join Date
    Jul 2004
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just have one last question, how would I make it bootable?

  • #9
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    that im not sure about, but you would need some implementation of boot.ini or something like that. Anyhow, it would have to be a pile of code to make it bootable....

  • #10
    New Coder
    Join Date
    Mar 2004
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you would need to write instructions to load your os in the boot sector, may be worth seeing how to setup a duel boot the way linux does
    Try this
    http://kos.enix.org/pub/bootwrit.html

  • #11
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    You must realise this won't be a walk in the park. I made my own, extremely basic, OS.. Well, you can probably take the operating part out of it's name lol, it was just a black screen really. and getting that to work required much bashing of my head on the desk for a few months.

    I would suggest reading, reading, and lots more reading before you decide to implement your idea. And don't think you'll be writing the next windows within 20 years, you'll find that out pretty quickly..

    I think the best advice I've seen given out to people who ask this question is- "If you don't know already."

    A bit cryptic, but you can see the point it makes. An OS is a massive task, if you knew what you were doing you wouldn't be asking the question.. If you are ready to move onto this sorta thing you'd already know much of what you need to do, or at the very least where to find the information yourself.

    I'm not saying don't try, just saying, don't get your hopes up too high and be pleased with whatever ground you make on a project like this.
    Omnis mico antequam dominus Spookster!

  • #12
    New Coder
    Join Date
    Mar 2004
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Mhtml
    I think the best advice I've seen given out to people who ask this question is- "If you don't know already."

    would you say this applies to 3d graphics engines aswell, cause i want to get into game programming nd ive done a fair but but im not sure if its best to concentrate on coding an engine or coding for an already existing engine such as renderware, crystal space etc

  • #13
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well I would not say that myself. An OS can be as simple or as complex as you want but it's always going to be more complex than a game engine as I see it.

    You can write a functioning game engine in less than 100 lines of code. It won't do much. Maybe just display a texture on the screen if that. But it can be done.

    I think writing a game engine, especially a 3d one, is a great project (having been working on my first good one for most of this year). The key to a good start with a game engine is a plan, and sticking to that plan. Avoid feature creep when you are just starting out, and don't expect to be making anything spectacular very soon. I find that with a game engine, you have more fun because you always see results on the screen after the main kernel is done. And you can knock a kernel out in a few days if you know what you're doing, from then on it's just adding features like you would plugins.. I suggest C++ for this very reason, classes. If you go for an object oriented design on an engine you can just add and remove different features in a snap. Generally I do all my feature design in a new project with a console window printing out the data that it's handling untill I am satisfied it's working and then I just clean up the code and copy and paste it into my engine.

    You do get headaches, but they aren't nearly as bad as if you are doing low level stuff as you would for an OS. I would recommend starting with a game engine, if you have already beaten Hello World.
    Omnis mico antequam dominus Spookster!

  • #14
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    It's hard enough to code for an existing engine. To write one (at least if you want it to be competitive...), you really need to understand what you are doing. Those are severely optimised to take advantage of not only the APIs at hand (OpenGL, DirectX etc.) but also often fine tuned for certain GPUs and CPUs. You need as much of a realisation of how the hardware and physical interactions work as you need programming skills. An OS is different. In many areas, the OS does not have as many critical performance and optimisation issues. On the other hand, the OS can't make compromises. You can't reasonably sacrifice graphics handling to improve memory handling. Some programs will want to do one, some the other, some a little of both. You can't reasonably sacrifice a good process handling and multitasking for optimising I/O. An OS designer may have to make four areas small bottle necks to avoid a single huge bottle neck. Or sacrifice the single feature for the benfit of the four others, thus effectively making the OS unsuited for doing that type of tasks. OSes are typically optimised for being generic. That means that you have to weigh carefully what optimisations you do as to prevent being too unoptimised in other areas.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #15
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well it's only hard if you are going to be competetive like you said. I know that from experience. You are constantly optimizing for a platform of choice (in my case it's ATI because they give me heaps of resources and discounts on cards as a developer and Windows XP because that's my system so I know it works best on it. But really, as an API it'll work on any Win32 system). But I think that such an engine here isn't an issue, being realistic I don't think that Stowelly could produce or even comprehend an engine like that of Doom III, I doubt many of us here could, Carmack is a genius.. We are talking about a much smaller engine that has lots of memory leaks and runs the same on pretty much any card and of course, OpenGL... Like you'd use DirectX lol.. I'm sure eventuall Stowelly would get into extensions and it'd become specific to a series of cards if he wanted to take it further and make a good little opensource engine out of it. But you'll have a few thousand builds of a couple of engines before you make something decent.

    And as for GPUs and CPUs, the former is the real worry for the developers these days. Anything over 1Ghz generally is more than sufficient for a game engine. It's the GPU that does all the hard work really. But soon that'll be a thing of the past as well..

    [OT] Did you know that in longhorn they're planning to sync redrawing of windows with the refresh rate of your screen? Flicker free drawing, yay!
    Last edited by Mhtml; 11-10-2004 at 03:48 AM.
    Omnis mico antequam dominus Spookster!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •