NetCore2K.net - Brought to you by Napalm and Typhoon
HOME PROJECTS ARTICLES FORUM LINKS
Username: Password:



"Software suppliers are trying to make their software packages more 'user-friendly' ....
Their best approach, so far, has been to take all the old brochures, and stamp the words, 'user-friendly' on the cover."

 Welcome

 Napalm's Blog

> Napalm's Blog
> Typhoon's Blog
> Ecks' Blog
> EvilFourZero's Blog

GNU LD the linker from hell

30th July 2008

A fellow OS developer got in contact with me because he was having issues with his first OS.

So, this is a small setup just the basic multiboot structure and some simple C code that would call a C version of memset to fill the video memory with some letters. So a simple functionality and boot test.

I know your thinking, hmm not much that can go wrong. Wrong
But this just reinstates the quote

"Exercise caution in your programming;
for the OS is full of weirdness"

It took about an hours worth of debugging to find out that all the code was correct all the build files such as linker script and makefile are all pretty much correct, nothing wrong that would cause this problem. Analysis of the GCC output object files for the C code shows the compliation was perfect. Analysis of the final binary showed that LD just seemed to want to add 0x18 to every call displacement for no apparent reason.. It turn's out that the problem was conflicting packages downloaded from the DJGPP FTP site.

So please people, if you decide to start OS development please use a preprepared install of DJGPP. For those of you who want one you can find it: http://www.blackcore.co.uk/resources/djgpp.zip.


Napalm

Comments: (0) View All

No comments found!


Copyright © Netcore2K.net.
All rights reserved.
Contact Us