Re: Wich programing language are you using for your os
Posted: Thu Sep 06, 2012 2:16 am
Well, do you want an obfuscated but actual implementation of the problem instead of a reduced version?A human would not optimize it either.
The Place to Start for Operating System Developers
http://f.osdev.org/
Well, do you want an obfuscated but actual implementation of the problem instead of a reduced version?A human would not optimize it either.
it's something i ponder as well, there is some hint toward this somewhere in the wiki with the language approach, i'd clearly like to implement a powerfull scripting language for application, why not using lua, something close to flash AS3 actuallyBrendan wrote:Hi,
This has been a constant problem for me. My goal is to write a radically different OS in an entirely new language, with no compatibility with existing OSs, languages, file formats, tools, etc.pikasoo wrote:Im just wondering wich language is the favorit and also if you are starting from scratch or from an existing base (open source os)
There are 2 ways to achieve this:At the moment, my current plan is to write the least amount of OS code I need to start developing native tools, and do this initial code in assembly (NASM); then write native tools starting with an assembler and a "legacy text file to assembly source" file format converter.
- write my own language/toolchain and then write the OS in that new language. In this case I'd need to write the toolchain twice (e.g. once as a set of tools for Linux that I can use to write the OS, then again as native tools for my OS).
- write the OS in an existing language, and then create a native toolchain for the OS. This ends up being worse as I'd need to write parts of the OS twice (e.g. once in an existing language so I can start developing the tool chain, and then a second time in the new language) and also write parts of the toolchain twice (once in assembly and again in a native language).
I keep having second thoughts though. Every now and then I decide I should be doing the opposite and start writing tools (for Linux) in C.
Cheers,
Brendan
Actually, the word compiler used to mean linker up until about the mid 1950s. See the quote that introduces the first chapter of "Modern Compiler Implementation in C/ML/Java" by Andrew Appel. The word is an example of quite strange coinage, I mean, in the modern sense a compiler doesn't really compile, it generates code that specifies a language's evaluation function to a given input program.chrissacchi wrote:Hey pikasoo,
I appreciate that you are using NASM as your assembler. NASM stands for "Netwide Assembler". With this name it is obvious to point out that NASM is not a compiler. NASM is an assembler, and it can be used with macros converted to flat binary machine code. A good example of a compiler would be GCC (GNU Compiler Collection) or DJGPP.
Firstly, kernels in C/C++ almost always end up using assembly language, they cannot do the whole job on their own on most processors. How do you disable interrupts in C on an x86 machine?chrissacchi wrote: Also, not very many languages can be used for OSDev, because of some (if not all) high-level language abstractions that can't interface with an unmade kernel. Languages besides these low-level languages, such as C, C++, and Assembly can be used when you have a stable, working userspace running. These languages can include, and are not limited to Python, Perl, LISP, Ruby, etc.