Page 1 of 1
Questions about C (or C++?)
Posted: Sat Jul 01, 2006 11:45 am
by ComputerPsi
Hello. I'm an assembly programmer. I got curious and decided to make a simple code that runs without an operating system with C. Does anybody know the appropriate compiler for this? A compiler that takes up little space and runs quickly (one that runs on Windows). Also, how would you configure or program it to work without an OS?
Posted: Sun Jul 02, 2006 5:19 am
by gaf
Hi ComputerPsi
on a windows platform you should probably use
cygwin as a compiler. As its a port of the gcc compiler, which is used in the linux world, almost all tutorials that can be found on the internet should work just fine with it.
For a quick introduction to kernel development in C you might have a look at the bare-bones series from mega-tokyo (
Bare Bones,
C++,
Higer Half). Apart from that there are two more tutorial on bonafide that might help you developing your kernel (
Kernel in C++,
Bran's Tutorial).
regards,
gaf
Posted: Sun Jul 02, 2006 10:51 am
by SpooK
I prefer MinGW. You might even want to try DJGPP.
Posted: Mon Jul 03, 2006 10:51 am
by ComputerPsi
I got cywin. It's running fine - except it doesn't have gcc. How do you put it on there?
Posted: Mon Jul 03, 2006 11:51 am
by gaf
Interesting, I thought it was included in the standard installation..
Fortunately you don't have to have to reinstall everything as setup.exe allows you to simply add packages. Just run it once more and make sure that the following are selected:
Code: Select all
devel/binutils
/gcc-core
/gcc-g++
/make
/nasm
You can select the packages right after the download-location dialogue. Not installed packages are marked with a 'skip' on their left. Just click on it to download the package.
regards,
gaf
Posted: Tue Jul 04, 2006 10:32 am
by JAAman
though most people use some form of GCC (cygwin is best for windows systems), i want to be sure you are aware that this isnt your only option:
almost any c compiler will work (and many are availible free -- i make a habit of only mentioning free tools) -- some people prefer using the MS toolschain (the latest version is availible free on the MS website), or the older borland compilers (last i checked, they were giving all their old tools away free), and ive seen some people using watcom
if you are familier with a particular toolset (from app development) use it -- it will prob work fine, but if your not, cygwin has the most people familier with it in the OSdev comunity (and most tuts are designed to work with it), giving it an advantage
many assembers are also availible:
by far the most popular is nasm (availible both natively and in cygwin) but many people prefer fasm (which (iirc) also has the advantage of supporting 64bit code) -- gas and masm are both less popular (but equally valid) choices
as an asm programmer i assume you already have the latest manuals (intel hard copies just updated in june) from either Intel or AMD (there almost identical, though they are orginized a little differently)
(intel manuals can be downloaded and ordered in hardcopy from the link in my sig -- if you dont have them already)
Posted: Fri Jul 07, 2006 5:54 pm
by earlz
use codeblocks!(an ide) get the one that has the compiler included@
http://codeblocks.org
it is the best ide I have ever seen(of course its free and even opensource)
you can use my codeblocks file as a template if you want just download my release of JouleOS 0.0.4 at
http://jouleos.galekus.com
(look under releases)
and well yea use codeblocks