Wich programing language are you using for your os
Wich programing language are you using for your os
Im just wondering wich language is the favorit and also if you are starting from scratch or from an existing base (open source os)
im at my second attempt to build my own os, doing it for the fun. My first attempt was about 8 or 9 years ago doing it all in ASM
booting it from a floopy on a old 486 pc. i ended up with a simple command prompt, my own file system and a cdrom support.
finaly recently i started a new project, still doing it in ASM but this time in protected mode using paging and graphic... while researching for information google often pointed me to this website and i want to say a big thanks to those that posted all those usefull informations!!
So to awnser my own question:
language : ASM using nasm compiler
started from scratch
p.s. dont mind the bad english
im at my second attempt to build my own os, doing it for the fun. My first attempt was about 8 or 9 years ago doing it all in ASM
booting it from a floopy on a old 486 pc. i ended up with a simple command prompt, my own file system and a cdrom support.
finaly recently i started a new project, still doing it in ASM but this time in protected mode using paging and graphic... while researching for information google often pointed me to this website and i want to say a big thanks to those that posted all those usefull informations!!
So to awnser my own question:
language : ASM using nasm compiler
started from scratch
p.s. dont mind the bad english
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Wich programing language are you using for your os
It's not the bad english, it's statements like this:
that set off alarms.language : ASM using nasm compiler
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: Wich programing language are you using for your os
He could be writing a real mode OS (like I am), in which case your options are limited.Tosi wrote:It's not the bad english, it's statements like this:that set off alarms.language : ASM using nasm compiler
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Wich programing language are you using for your os
Calling NASM a "compiler" is setting off the alarms, anyway.Blacklight wrote:He could be writing a real mode OS (like I am), in which case your options are limited.Tosi wrote:It's not the bad english, it's statements like this:that set off alarms.language : ASM using nasm compiler
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: Wich programing language are you using for your os
I missed /that/.Griwes wrote:Calling NASM a "compiler" is setting off the alarms, anyway.
Eek.
Re: Wich programing language are you using for your os
IMHO, I'm well aware that NASM is an assembler, but as long as he knows what it is and what it does, does it really matter if he refers to it as a compiler, assembler, or Derek, so long as he can use it?
Re: Wich programing language are you using for your os
Using Forth (own compiler) and x86 assembly (own assembler).
Using 700MHz Pentium III machine with 64MB of RAM because I feel like it.
ed implementation in C: main(a){for(;;;){read(0,&a,1);if(a=='\n')write(1,"?\n",2);}}
ed implementation in C: main(a){for(;;;){read(0,&a,1);if(a=='\n')write(1,"?\n",2);}}
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Wich programing language are you using for your os
Compiler is something that generates code in output language from code in input language (like, C -> assembly is compiler).CWood wrote:IMHO, I'm well aware that NASM is an assembler, but as long as he knows what it is and what it does, does it really matter if he refers to it as a compiler, assembler, or Derek, so long as he can use it?
Assembler is something that assembles code from assembly language to machine language (which has 1:1 mapping in most cases, so it's plain translation, not rewriting sentences, if you let me to compare it with natural languages).
It's quite clear (and quite basic) distinction; and using proper terms allows people to determine (or assess) level of person in question.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: Wich programing language are you using for your os
...and also quite wrong. Well, strictly speakingGriwes wrote:It's quite clear (and quite basic) distinction;
1. there are high language assemblers with "for" and "while", so even an assembler could "rewrite sentences" as compilers
2. gcc does not generate code in output language (by default), but machine language binary, so according to your definition, it's not a compiler?
3. from user's point of view, the plain text source goes in, the binary executable comes out in both assembler and compiler case
I understand the effort to tell apart assemblers and compilers, and fundamentally there's nothing wrong with it. It's just you have to create better definitions.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Wich programing language are you using for your os
Sigh. A compiler, or translator, is a program that translates from one language to another. Machine code is a language, too; they can target it. An assembler is a type of compiler. Can we move on?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Wich programing language are you using for your os
Hi,
There are 2 ways to achieve this:
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
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:
- 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Wich programing language are you using for your os
Programming language theory, language design, and compiler theory have always been of interest to me. However, I've unfortunately decided that designing a better (tm) language has more disadvantages than advantages:
- It doubles the amount of work that has to be put into the project.
- It will become much harder to get other developers on your project.
- Difficult to get any feedback for the language because people don't know it.
- Difficult to test the new toolchain because there's no existing code for it.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Wich programing language are you using for your os
This is the way to go for you and I encourage you to do this. It is the next level after doing things with using the existing knowledge and tools in the operating system field.Brendan wrote: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.
I think that you waste your time if you do not do this. It even sounds depressing if you end up being "a POSIX-C-NASM-Linux-ELF developer" (not the best definition). There is nothing wrong with that but I think that is not suitable for you. For most of us, including me, the traditional way is more suitable.
It goes without saying that a lot of specifications need to be written. These documents are quite important when looking the project as a whole. Your excellent formal writing skills will have a great importance when it comes to that.
When looking the previously mentioned aspect and your contributions to the OS developer community, it would be easy to get more people involved in the project if desired. It is not always the techical things that matter when it comes to that. Unfortunately, those other developers will probably ruin the project so keep it under your control. In fact, keep it strictly under your control.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Wich programing language are you using for your os
Well, if you write your tools using only the standard components of ISO C, then there's no double code to be written since a correct implementation will make any such code portable without modifications.
Of course, new languages typically have a share of other languages. You can write a compiler in the semantically shared subset so you don't need a rewrite either. (you can write a C++ compiler in C and it'll still be able to compile itself. Similarly, Freebasic was originally bootstrapped from Quickbasic)
Of course, neither of this works for Brendan where libc would be the most visible symbolication of all those *cough* "bad legacy designs" *cough*, but for most people, it works
Of course, new languages typically have a share of other languages. You can write a compiler in the semantically shared subset so you don't need a rewrite either. (you can write a C++ compiler in C and it'll still be able to compile itself. Similarly, Freebasic was originally bootstrapped from Quickbasic)
Of course, neither of this works for Brendan where libc would be the most visible symbolication of all those *cough* "bad legacy designs" *cough*, but for most people, it works
Re: Wich programing language are you using for your os
Hi,
Part of the idea for my OS is that (as far as applications know) all files are in a specific "native" format. For example, instead of having to deal with BMP, JPG, TIFF, PCI, GIF, PNG, etc, an application would only have to care about my native graphics file format. To make this work the OS has "file format converters". If an application tries to open a BMP picture, the VFS is responsible for finding a suitable "BMP to native file format converter" and transparently converts the BMP file into the native format. Multiple file format converters might be involved - e.g. an application might open "foo.bmp" as a sound file, and the VFS might convert BMP into native graphics format, then native graphics into native text (via. OCR), then convert native text into speech/sound (via. speech synthesiser). Of course the VFS may store the results of these conversions in the file system; so that if "foo.bmp" is opened as a sound file again later then the VFS just gets the pre-converted version from the file system instead of doing all the conversions again.
Now think about compiling, assembling and linking - the tools would use the same "file format converter" idea. If the OS opens "foo.c" as an executable; then the VFS might use a "C to byte-code converter", then a "byte code to assembly converter" then an "assembly to executable" converter (and then cache/store the resulting executable file).
Obviously, for the normal "bunch of separate plain text files" source code this would be a major problem. However...
The way programming is normally done is mostly crap - it was convenient (for compiler developers) in the 1970's and (for most of us) hasn't changed much since. What I'd like to do is build a graphical design tool, where (for a hypothetical example) a programmer drags boxes, etc onto a worksheet to create something like a UML class diagram, and can then click on methods, etc in the class diagram to add code to that method. An entire project's source code (including class diagram, resources, methods, etc) would exist in a "pre-tokenised" form within a single project file; and it's this single project file that file format converters would convert into executable form.
Of course I'm not saying this is exactly what I'm planning - to be honest I haven't really decided how software should be designed and written (or how the IDE will actually work). I am interested in getting rid of typing - e.g. rather than typing "while(foo < 6) { foo++; }" into a text box a programmer might drag an "while box" onto the page and then drag other things (an icon representing "foo", a "const integer" icon, an "increment" icon, etc) into appropriate places in the middle of the "while box". Also, it won't be OOP; but would be something vaguely similar intended for the actor model (e.g. "actor" instead of "class", "message handler" instead of "method", etc; where one or more actors are mapped to each thread).
Cheers,
Brendan
That's just the start - the way tools work and the way people write software also needs to change.Combuster wrote:Of course, neither of this works for Brendan where libc would be the most visible symbolication of all those *cough* "bad legacy designs" *cough*, but for most people, it works
Part of the idea for my OS is that (as far as applications know) all files are in a specific "native" format. For example, instead of having to deal with BMP, JPG, TIFF, PCI, GIF, PNG, etc, an application would only have to care about my native graphics file format. To make this work the OS has "file format converters". If an application tries to open a BMP picture, the VFS is responsible for finding a suitable "BMP to native file format converter" and transparently converts the BMP file into the native format. Multiple file format converters might be involved - e.g. an application might open "foo.bmp" as a sound file, and the VFS might convert BMP into native graphics format, then native graphics into native text (via. OCR), then convert native text into speech/sound (via. speech synthesiser). Of course the VFS may store the results of these conversions in the file system; so that if "foo.bmp" is opened as a sound file again later then the VFS just gets the pre-converted version from the file system instead of doing all the conversions again.
Now think about compiling, assembling and linking - the tools would use the same "file format converter" idea. If the OS opens "foo.c" as an executable; then the VFS might use a "C to byte-code converter", then a "byte code to assembly converter" then an "assembly to executable" converter (and then cache/store the resulting executable file).
Obviously, for the normal "bunch of separate plain text files" source code this would be a major problem. However...
The way programming is normally done is mostly crap - it was convenient (for compiler developers) in the 1970's and (for most of us) hasn't changed much since. What I'd like to do is build a graphical design tool, where (for a hypothetical example) a programmer drags boxes, etc onto a worksheet to create something like a UML class diagram, and can then click on methods, etc in the class diagram to add code to that method. An entire project's source code (including class diagram, resources, methods, etc) would exist in a "pre-tokenised" form within a single project file; and it's this single project file that file format converters would convert into executable form.
Of course I'm not saying this is exactly what I'm planning - to be honest I haven't really decided how software should be designed and written (or how the IDE will actually work). I am interested in getting rid of typing - e.g. rather than typing "while(foo < 6) { foo++; }" into a text box a programmer might drag an "while box" onto the page and then drag other things (an icon representing "foo", a "const integer" icon, an "increment" icon, etc) into appropriate places in the middle of the "while box". Also, it won't be OOP; but would be something vaguely similar intended for the actor model (e.g. "actor" instead of "class", "message handler" instead of "method", etc; where one or more actors are mapped to each thread).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.