Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Sep 2007 14:28:31 +0200
From:      Olivier Houchard <mlfbsd@ci0.org>
To:        Marius Nuennerich <marius.nuennerich@gmx.de>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: FreeBSD and qemu-neo1973 (was: Re: Comment bug in locore.S?)
Message-ID:  <20070928122831.GA24359@ci0.org>
In-Reply-To: <20070928121720.22823a58@sol.hackerzberg.local>
References:  <20070928011740.01026dcd@sol.hackerzberg.local> <200709272351.l8RNp0pn066924@casselton.net> <20070928113044.4a2dcdac@sol.hackerzberg.local> <20070928102332.GA23400@ci0.org> <20070928121720.22823a58@sol.hackerzberg.local>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 28, 2007 at 12:17:20PM +0200, Marius Nuennerich wrote:
> On Fri, 28 Sep 2007 12:23:32 +0200
> Olivier Houchard <mlfbsd@ci0.org> wrote:
> 
> > On Fri, Sep 28, 2007 at 11:30:44AM +0200, Marius Nuennerich wrote:
> > > On Thu, 27 Sep 2007 18:51:00 -0500 (CDT)
> > > Mark Tinguely <tinguely@casselton.net> wrote:
> > > 
> > > > 
> > > > How about saving the jump address in another register also before the jump:
> > > > 
> > > > 	ldr	r10, .Lvirt_done
> > > > 	ldr	pc, .Lvirt_done
> > > 
> > > I tried this but used r9, anyway the register isn't used otherwise and
> > > it's contents is R09=c00002a4 after qemu crashes. Is it possible that
> > > this would be the right address if the kernel would start at 0x30000000
> > > and not on 0x30008000 physical address? 
> > 
> > Ah good point. KERNVIRTADDR should be 0xc0008000, not 0xc0000000.
> > As we're mapping it with sections, we don't have enough granularity to map it
> > to 0xc0000000.
> 
> OK, I changed KERNVIRTADDR in the kernel config. qemu still crashes with
> qemu: fatal: Trying to execute code outside RAM or ROM at 0xc00082ac
> 
> which should be mapped. But now it doesn't print an A as the last
> letter over serial line, it's an f. What I don't understand is the the
> jump to 0xc00082a4 seems to be OK now but a few instructions later it
> goes boom. Maybe this is the strb instruction for printing chars. Could
> it be that this won't work after jumping to 0xc... ?
> Why does the printing of f still work before the ldr?
> 
> Is there a description available what KERNVIRTADDR, KERNPHYSADDR,
> PHYSADDR, KERNBASE, et al. mean?

No there's not, and you're right it should be documented.
KERNVIRTADDR is the virtual address at which the kernel is loaded (and
linked).
KERNPHYSADDR is the physical address at which the kernel is loaded.
PHYSADDR is the physical address of the RAM.
KERNBASE is the virtual address of the beginning of the KVA.
STARTUP_PAGETABLE_ADDR is a physical address, suitable for the very early
pagetable we build in locore.S.
FLASHADDR is the address of the flash, virtual or physical depending on
what the loader does. That, and LOADERRAMADDR (the address at which the
loader maps the RAM if we're running with the MMU enabled, and the physical
address if not), are used to detect if we're running from flash, and if so
copying the kernel to memory.

Regards,

Olivier




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070928122831.GA24359>