Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EgAd7-00051Q-Ke for mharc-grub-devel@gnu.org; Sat, 26 Nov 2005 19:42:57 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EgAcv-0004y3-B5 for grub-devel@gnu.org; Sat, 26 Nov 2005 19:42:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EgAcr-0004wD-KG for grub-devel@gnu.org; Sat, 26 Nov 2005 19:42:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgAcp-0004vL-Ia for grub-devel@gnu.org; Sat, 26 Nov 2005 19:42:39 -0500 Received: from [64.233.162.200] (helo=zproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EgAcp-0006RX-OE for grub-devel@gnu.org; Sat, 26 Nov 2005 19:42:39 -0500 Received: by zproxy.gmail.com with SMTP id x3so2128109nzd for ; Sat, 26 Nov 2005 16:42:38 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:x-gpgmail-state:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=Avk+4rIaJnd3pGCDHEGNGlziafycRTPrk1m3i8v/mRF/8Lkxpj2SDccsC59DFtpxOS0nMhpE9kiHahUh1eaeDmZrjOKQBb7u3gLL1Tq/iuHRKsFEczkBfVPiNLv5jw45EkXJh7lw7BBW0cy2Oco6SZJH4qJoY7H3oFViQhcFQtU= Received: by 10.36.25.8 with SMTP id 8mr2119131nzy; Sat, 26 Nov 2005 16:42:38 -0800 (PST) Received: from ?192.168.1.101? ( [64.135.199.23]) by mx.gmail.com with ESMTP id e1sm2408409nzd.2005.11.26.16.42.38; Sat, 26 Nov 2005 16:42:38 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v746.2) X-Gpgmail-State: !signed Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Andrei Warkentin Date: Sat, 26 Nov 2005 18:42:36 -0600 To: The development of GRUB 2 X-Mailer: Apple Mail (2.746.2) Subject: PowerPC C++ kernel woes. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2005 00:42:46 -0000 Hello, I've been trying to get some C++ running (now that I can print "Hello World" from OF, I'd like to move my "Hello World" C++ kernel to PowerPC), but it has been without much success. I've finally figured out that there are these small data sections which I was not taking care of in my ld script (sdata, sbss, sdata2, sbss2). Prior to me figuring this out, I would get a crash. After I added these sections, I've noticed several globals appear in .sbss (using powerpc-linux-nm to see all syms), but now I get CLAIM failed while loading my kernel in OF. Odd. So I guess I have several questions: Am I doing something wrong w.r.t sdata, sbss, sbss2, and sdata2 in my ld script? I am also not sure as to how these should be aligned, if at all. What about _SDA_BASE_ and _SDA_BASE2_? AFAIK, these should point in the middle of the sdata+sbss and sdata2+sbss2. Should I load r13 and r14 with these values? So far my code doesn't appear to use either register. I 've been doing this for SDA_BASE and SDA2_BASE PROVIDE (_SDA_BASE_ = ld_sdata + ((ld_sbss_end - ld_sdata) / 2)); PROVIDE (_SDA2_BASE_ = ld_sdata2 + ((ld_sbss2_end - ld_sdata2) / 2)); ... but the linker seems to ignore my values and gives 0020f000 G _SDA_BASE_ 00210000 G _SDA2_BASE_ ( kernel linked @ 2MB, same way as I linked my C hello world example, which works just fine). Thanks and have a great day. /* The sdata section. */ .sdata ALIGN(0x1000): { ld_sdata = .; /* SData. */ *(.sdata) *(.gnu.linkonce.s.*) ld_sdata_end = .; } .sbss : { ld_sbss = .; /* BSS. */ *(.sbss) *(.scommon) ld_sbss_end = .; } /* The sdata2 section. */ .sdata2 ALIGN(0x1000): { ld_sdata2 = .; /* SData2. */ *(.sdata2) *(.gnu.linkonce.s2.*) ld_sdata2_end = .; } /* The SBSS2 section. */ .sbss2 : { ld_sbss2 = .; /* SBSS2. */ *(.sbss2) *(.gnu.linkonce.sb2.*) ld_sbss2_end = .; }