Reputation: 10686
I am looking to build an OS. I know the amount of work it entails, and am not approaching it as some kind of joke, as the beginner sections of most sites dedicated to this topic assume. I am just wondering, what languages do I need to know, because all the wikis and websites differed in their info. Some said just C or C++, some said a combination of C, Pascal, and others. All that is certain is that assembly is needed. What languages does one need?
Upvotes: 0
Views: 306
Reputation: 7353
Full on assembly being a must is fading fast actually. For most systems it will be a must, but with the development of UEFI it is possible to get rid of straight assembly and you could do some minor inline assembly instead and it would work fine. Also if you are not writing your own bootloader you can also get away with a lot less assembly.
All that aside, C or some other low level language will be needed. Particularly that manipulates pointers. C++ is possible but due to language features may require you to do some detailed work, i.e. exceptions. See here for details. A great resource for this type of question is osdev.org. This link gives you the best answer in my opinion.
Upvotes: 2
Reputation: 11341
You can use any language that compiles to a sufficiently low level binary, surely. Java and other interpreted languages are out, but other than that, it's designer's choice...
Upvotes: 1
Reputation: 3417
I think it's really just a matter of preference. You obviously need assembly, but beyond that, you just need a low level language that compiles to native code. C is probably the best for this, but depending on how you structure your code you might find C++ to be helpful as well. As for Pascal, I'm sure it's technically possible, but you might find your options severely limited, since Pascal hasn't been in common use for quite a while (compare 420 questions on SO tagged with Pascal, versus over 50,000 for C).
Upvotes: 1
Reputation: 5251
Assembly is practically needed when dealing with CPU-specific features, for instance when switching privilege levels or installing a page table.
The rest may be written in any reasonably low-level language, able to manipulate pointers. C itself is sufficient for instance. Linux is written in C, with a little assembly (no C++). I guess Pascal would do the trick too, though it may be a little less convenient than C.
Upvotes: 2