Re: Kernel running XIP or from RAM?
- From: Gary Metalle <GaryMetalle@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Jul 2005 19:33:02 -0700
Ok cheers, that is helpful. I like the idea of reading the structure from the
flash even though it sounds like more of a pain. If have some more details
about that idea, that would be cool. I have complete (well, ok almost)
control of the kernel which may make things easier.
You mentioned the struct might be in flash even if the kernel has been
downloaded into RAM. Does this imply eboot writes some this struct into flash?
Yes I know NOR flash is slow! We've recently introduced a hard disk onto the
hardware and that has slowed the app too, but that's another story. I like
the idea of making some parts of the kernel XIP and some RAM, but when I get
some more time I'll post that on the appropriate group :-)
"remco" wrote:
> "Gary Metalle" <GaryMetalle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:D20E52B2-A4E5-4719-99DF-9DF61F9FA740@xxxxxxxxxxxxxxxx
> > Is there a way for an application to determine if the kernel is running
> XIP
> > or RAM?
> > I would like to print some memory stats showing how the physical chip
> memory
> > is being used.
> > GetStoreInformation() is good for working out the amount of memory used
> for
> > the object store.
> > GlobalMemoryStatus() is good for working out the amount of memory used for
> > the system heap.
> > If the kernel is running XIP then this information is enough to get within
> > about 90% of the physical device RAM (the remaining must be things like
> > display frame store and other bits-and-bobs?).
> > If the image is running from RAM then there will be a loss of about 12MB
> or
> > so because eboot has loaded the kernel into RAM, but it would be nice to
> know
> > this and then make some crude estimates (looking at the \Windows folder)
> as
> > to size of the RAM-resident kernel.
> >
> > I only want to do this for debug, but it is a good exercise to learn how
> the
> > memory management works for CE
>
>
> Never thought about this until now, because the kernel's image has always
> been under my control so never had to worry about it -- but it is an
> interesting question..
>
> There is a structure within the NK.bin that determines first and last
> location exe and regular ram location. I suspect that your platform has it
> stored in flash somewhere so there's a way to find it but that might be a
> little tricky. Let me know if you need to do that.
>
> An easier way may be to do this:
> It is a little hackish, but you could get a pointer to any benign not
> normally called API function and see where it is located.
> If you don't know where ram is located on your platform, test whether that
> pointer is RAM or flash by reading (you'll have to do a
> virtualAlloc/VirtualCopy first to get to it) out what's under the pointer
> and store it in a temp, scribble something to that location, see if it
> changed successfully, if so - you're running from ram else rom. If ram,
> scribble your temp back and the image is good as new.
>
> Just remember that XIP tends to be a lot slower in flash than when it is
> running out of DRAM because of increased wait states.
>
> Hope that helps.
> Remco
>
>
>
.
- Follow-Ups:
- Re: Kernel running XIP or from RAM?
- From: whybcuz
- Re: Kernel running XIP or from RAM?
- References:
- Kernel running XIP or from RAM?
- From: Gary Metalle
- Re: Kernel running XIP or from RAM?
- From: remco
- Kernel running XIP or from RAM?
- Prev by Date: Re: Kernel running XIP or from RAM?
- Next by Date: Re: Using the Cable Connector From IPAQ H2200 as Com Port.
- Previous by thread: Re: Kernel running XIP or from RAM?
- Next by thread: Re: Kernel running XIP or from RAM?
- Index(es):
Relevant Pages
|
Loading