Problems wrinting OS using Haskell

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Pepijno
Posts: 2
Joined: Mon Oct 22, 2012 9:14 am

Problems wrinting OS using Haskell

Post 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
User avatar
Combuster
Member
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: Problems wrinting OS using Haskell

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Pepijno
Posts: 2
Joined: Mon Oct 22, 2012 9:14 am

Re: Problems wrinting OS using Haskell

Post 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
Post Reply