I have made a 16 bit os(in c).Right now i am planning to write the
entire thing in assembly....I am always confused which language
is the best choice 1)c 2) Asm 3)C++.......?Please advise...
Language of choice??
Both C and Assembly.
C can do a lot of things, but not everything.
If you're not writing your own bootloader, you still will need to write some assembly code (usually some startup stuff and for setting up IDT/GDT and protected mode.)
C is generally whats used for the rest, due to it's portability. Assembly is NOT portable, since most architectures have their own different syntax/registers/memory/IO/methods of doing everything. Add to that the fact that theres (at least) 2 wholly different syntaxes for assembly (AT&T and Intel) and you complicate assembly even more.
In my opinion, C should be used wherever possible to maintain portability.
Of course, you dont have to touch C at all. A lot of OS' have been coded in straight assembly.
C++ is used occasionally, but I personally don't like it for OS programming.
I figure C++ should be used for applications, it's too high level for OS programming.
C can do a lot of things, but not everything.
If you're not writing your own bootloader, you still will need to write some assembly code (usually some startup stuff and for setting up IDT/GDT and protected mode.)
C is generally whats used for the rest, due to it's portability. Assembly is NOT portable, since most architectures have their own different syntax/registers/memory/IO/methods of doing everything. Add to that the fact that theres (at least) 2 wholly different syntaxes for assembly (AT&T and Intel) and you complicate assembly even more.
In my opinion, C should be used wherever possible to maintain portability.
Of course, you dont have to touch C at all. A lot of OS' have been coded in straight assembly.
C++ is used occasionally, but I personally don't like it for OS programming.
I figure C++ should be used for applications, it's too high level for OS programming.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am