Using C the entire way?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Gros

Using C the entire way?

Post by Gros »

Is it possible to create an OS only using C? (and inline assembler of course). For instance, the bootloader. It?s hard to find a C compiler that generates 16-bits code(that?s needed in the loader), but if I find one, would it(technically) be possible to write a boot loader in C?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Using C the entire way?

Post by Brendan »

Hi,
Gros wrote: Is it possible to create an OS only using C? (and inline assembler of course). For instance, the bootloader. It?s hard to find a C compiler that generates 16-bits code(that?s needed in the loader), but if I find one, would it(technically) be possible to write a boot loader in C?
Yes. Relatively large numbers of OS's are written in C (with inline assembler). For the boot loader, there are C compilers capable of generating 16 bit real mode code (some are free/GPL). For example:

http://www.devdaily.com/unix/man/man1/bcc.1.shtml


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.
Post Reply