Subject: Re: booting from solaris
To: Eduardo Horvath <eeh@turbolinux.com>
From: Andrei Petrov <and@genesyslab.com>
List: port-sparc64
Date: 07/11/2000 13:09:24
On Tue, 11 Jul 2000, Eduardo Horvath wrote:

> On Tue, 11 Jul 2000, Andrei Petrov wrote:
> 
> > On Tue, 11 Jul 2000, John Hay wrote:
> > 
> > > > 
> > > > > I strongly recommend generating an /ofwboot and using that to load the
> > > > > kernel.  However, even with that there may be filesystem issues on newer
> > > > > versions of solaris.
> > > > I think it may destroy my solaris. What do you think?
> > > > 
> > > > I saw the guy was able to netboot, so I'm trying to built ofwboot for
> > > > that purpose,
> > > > currently I lack crt0.o what kind of surprise me.
> > > > 
> > > > Should standalone program have crt0? Is my environment screwd?
> > > 
> > > Hehehe, I also had that problem and thought it was because of my cross
> > > build environment so I didn't even mention it. (I'm building on a PC
> > > running FreeBSD.) What I did was to add:
> > > 
> > > LIBCRT0=        ${CURDIR}/srt0.o
> > > 
> > 
> > I found that including bsd.prog.mk pulls dependancies from LIBCRT..
> > for (PROG). So I need to add:
> > 
> > LIBCRT0=
> > LIBCRTBEGIN=
> > LIBCRTEND=
> > 
> > > to the Makefile. Maybe also for the record, I build ofwboot as a 64bit
> > > elf binary.
> > 
> > Also, I tried 32bit ofwboot and it said '15400 unaligned memory access'.
> 
> Make sure your definition of _LP64 is correct.  srt0.o uses this to
> determine whether it is calling 32-bit C code or 64-bit C code.  If there
> is a mismatch then the C code will get unaligned accesses when accessing
> data on the stack.
> 

Oh, yes, they mismatch, it happens because of CEXTFLAGS=-D_LP64. you
can leave it to compiler, I think both gcc and sun's native compilers
provide proper _LP64 definition depending on target. So having that
flag is misleading( I thought it made on purpose:-); I'd have that commented
in Makefile or in FAQ.

But now I'm happy with my 64bit ofwboot; if you want to check 32bit
ofwboot - let me know. 

Thank you,
	Andre