I´m looking for a good (better the best) 16bit C compiler for writing a bootloader (2nd stage). I have somewhere an old version of turbo c++, but I think there are newer ones, maybe also free? I also thought about writing it in pascal. I still didn´t manage to look at fpc, is it possible to produce 16bit code and how good does it optimize.
A nice features would be good optimizing. At the moment I´m writing the bootloader in asm, but as I have a 3rd stage which I would like to get into the 2nd stage I like to change the language to C.
best 16bit C compiler
Re: best 16bit C compiler
I think borland C++ does it and GCC can do it with some researching. I have a few experimental C bootloaders written in GCC C.
Website: https://joscor.com
Re: best 16bit C compiler
Ok, but maybe you can tell where to look what I have to do, to get gcc to outbut 16bit code.
Re: best 16bit C compiler
I'm really short on time right now, I'll post more help links later, but here's a thread that I started about it a while ago:
http://forum.osdev.org/viewtopic.php?f=1&t=17618
http://forum.osdev.org/viewtopic.php?f=1&t=17618
Website: https://joscor.com
- 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: best 16bit C compiler
I would use GCC+binutils, because I know how it can be done. I don't know how (or even if) it can be done with Turbo C.
If you really want a 16 bit compiler, use bcc (famous for being used for bochs' bios)
If you really want a 16 bit compiler, use bcc (famous for being used for bochs' bios)
Re: best 16bit C compiler
Umm... bcc == borland c compiler. Which was the best C compiler of it's time (16-bit dos) and can be used for real-mode programming. It even gives you different memory modes to work with depending on how you're OS is setup, one may be better than another (or worse, if it relies on things like extended memory managers). Just do some reading, and you'll be fine. I have not used gcc for 16-bit, my OS stays in 16-bit just long enough to enable a20, get memory map, and load my kernel image, then switches to 32-bit (no need for c code, since code to load disk image is pretty simplistic in my boot loader). Anyways, I used Turbo C/C++ a lot when Dos was in (I even still use it today to make things like disk management tools that I can run under dos, for example, I used it to write my master bootsector writing program, so I could write my MBR out to disk under Dos, formating drives, etc). Pretty neat, mostly featured, and a nice text based UI. There are free versions available, I think Turbo C 2.0 is free, I used Turbo C/C++ 3.0, I think the latest version was 3.1.
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: best 16bit C compiler
I'm sure GCC could do it aswell, since GCC targets many exotic architectures. I don't know if 16-bit would be an extension of x86 or it's own architecture entirely.
My OS is Perception.
Re: best 16bit C compiler
bcc can also refer to Bruce Evans' C Compiler, another 16-bit C compiler. Part of the Dev86 package