GCC/Binutils, I want to help

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
User avatar
joniwalker
Posts:7
Joined:Sat Nov 21, 2009 1:09 pm
GCC/Binutils, I want to help

Post by joniwalker » Mon Feb 15, 2010 12:35 pm

I want to help with the tutorial for GCC/Binutils.
Sorry for my bad english.

I have an working VS 2008 Solution configured for cygwin GCC/Binutils using an simple Makefile.
With you want I can write an tutorial for this, or send the code to you.
Its launch bochs and I plan to atach to it with GDB 7.0.
Last edited by joniwalker on Sun Feb 21, 2010 1:02 pm, edited 1 time in total.
Current developing:
  • Jupitel OS - A Win32/Linux Hybrid System
  • Line Dark The Secret of Knight a 2d/3d MMORPG game
Email: jonathan_2097@hotmail.com

gedd
Posts:12
Joined:Mon Jun 08, 2009 7:08 am

Re: GCC/Binutils, I want to help

Post by gedd » Tue Feb 16, 2010 2:30 pm

If you want help on gcc/binutils you can visit wiki.osdev.org, there you will have all the answers.

Fanael
Posts:8
Joined:Sat Feb 20, 2010 12:55 am
Location:Poland

Re: GCC/Binutils, I want to help

Post by Fanael » Sat Feb 20, 2010 1:00 am

He doesn't want help, he wants to help, presumably with writing a chapter about configuring Cygwin for operating systems' development. Did I understand correctly?

User avatar
joniwalker
Posts:7
Joined:Sat Nov 21, 2009 1:09 pm

Re: GCC/Binutils, I want to help

Post by joniwalker » Sat Feb 20, 2010 3:34 pm

Fanael wrote:He doesn't want help, he wants to help, presumably with writing a chapter about configuring Cygwin for operating systems' development. Did I understand correctly?
Yes, is this that I want.
Current developing:
  • Jupitel OS - A Win32/Linux Hybrid System
  • Line Dark The Secret of Knight a 2d/3d MMORPG game
Email: jonathan_2097@hotmail.com

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: GCC/Binutils, I want to help

Post by Mike » Sun Feb 21, 2010 12:32 am

Hello,

It is great that you would like to contribute :D If you wish, please feel free to do so - it can be uploaded as-is so all credit goes to the original author.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

User avatar
joniwalker
Posts:7
Joined:Sat Nov 21, 2009 1:09 pm

The final tutorial

Post by joniwalker » Sun Feb 21, 2010 2:08 pm

Mike, you must write the final tutorial for the web site. Changing the design of the tutorial.

Download the base files on the attachment.

First, create the subdirs:
  • vcproj
  • src
Next, you need create a Makefile C/C++ project on the vcproj subdir.
Then, on the main dir, copy the *.bat files and the dobuild.sh file from the base files.

On the src dir, put the Makefile, the Makerules and the kernel.ld from the src dir from base files.

On each code subdir, put a Makefile with the next code:

Code: Select all

LIBNAME=The name of the current dir

include $(ROOT)/Makerules

# This not work yet
export-lib-dir:
	@shell export CURLIBDIR=`pwd`
$(ROOT) is set on domake.bat
For this you need to set the CYGPATH variable to the path of cygwin.
You need to change the compilers in Makerules file
You can use the i586-elf-gcc, for this, see wiki.osdev.org/GCC_Cross-Compiler
You need to put these files on the $(CYGPATH)/usr/cross/

Then add the name of the code dirs on the main Makefile:

Code: Select all

DIRS = Name of the code dirs with the makefile above.
Back to VS 2008 or VC Express.
Go to properties of the project, in Debugging, type the command line of the emulator.
On the NMake, type:
Build command line: cd $(SolutionDir) <NewLine> build.bat
Rebuild command line: cd $(SolutionDir) <NewLine> rebuild.bat
Clean command line: cd $(SolutionDir) <NewLine> clean.bat
Output: The final executable.
Common language runtime: No support
Preprocessor definition: X86;__ELF__;_DEBUG and anymore that you want, splited by ;.
Include search path: $(SolutionDir)\src\include\

If you change the preprocessor definitions, go to the makerules and edit the DEFINES to some like this:

Code: Select all

DEFINES=-DX86 -DDEBUG -DMULTIBOOT_KERNEL -DWhat you want
The DEFINESASM is only for asm code.

With these Makefiles, you can use:
  • C code with .c extension.
  • C++ code with .cpp extension.
  • NASM code with .asm extension.
  • GNU ASM code with .S extension.
And press Ok.
On the main makefile:
Edit to change the cp command to copy to the correct dir.
Attachments
basefiles.zip
The base files.
(2.91KiB)Downloaded 1493 times
Current developing:
  • Jupitel OS - A Win32/Linux Hybrid System
  • Line Dark The Secret of Knight a 2d/3d MMORPG game
Email: jonathan_2097@hotmail.com

Post Reply