Page 1 of 1

Problems wrinting OS using Haskell

Posted: Mon Oct 22, 2012 9:36 am
by Pepijno
Hi everyone,

After I made a basic OS using C, I wanted to write an os using haskell. I had already written a lot of haskell programs, but never an os. However, I encounterd some problems. At my first simple try I got undefined references to a variety of ghc libraries which all depended on some c libraries. After I was finally able to include the libraries in the kernel I got a lot of the following error when linking:

Code: Select all

/usr/lib64/ghc-7.0.4//libHSrts.a(Storage.o): In function `initStorage':
(.text+0x193): relocation truncated to fit: R_X86_64_32 against `.rodata.str1.1'
/usr/lib64/ghc-7.0.4//libHSrts.a(Storage.o): In function `initStorage':
(.text+0x2ac): relocation truncated to fit: R_X86_64_32 against `.rodata.str1.1'
Is there anyone who has experience building a kernel using haskell who can help me out, or does anyone know how to solve the error above?
Cheers

Re: Problems wrinting OS using Haskell

Posted: Mon Oct 22, 2012 10:38 am
by Combuster
The haskell runtime got compiled as 64-bits with 32-bit offsets - an optimisation that's typically default, yet you're linking it at an 64 bit address that doesn't fit signed 32-bits. Check your linker script.

Re: Problems wrinting OS using Haskell

Posted: Thu Oct 25, 2012 2:59 pm
by Pepijno
Ah, you were right, I made this hughe error in my linker script #-o . Now it is working and I can start coding yay! Thanks