[okl4-developer] Starting with graphic output
Geoffrey Lee
glee at ok-labs.com
Tue May 6 14:19:19 EST 2008
On Mon, May 05, 2008 at 03:43:51PM +0000, Remy Gottschalk wrote:
> Hi Geoffrey
>
> On Thu, 2008-05-01 at 18:11 +1000, Geoffrey Lee wrote:
> > On Tue, Apr 29, 2008 at 04:05:54PM +0000, Remy Gottschalk wrote:
> > > Hi Nelson,
> > >
> > > To come back to the initial problem, any news concerning the invalid
> > > memory dereference at 0x18 ?
> >
> > Hi Remy
> >
> > This occurs during a deference of the ms pointer in eas_map() in
> > iguana/server/src/eas.c
> >
> > ms = objtable_lookup((void *)base);
> >
> > /*
> > * XXX: we need to check the attribs and rights
> > */
> > attrib &= ms->attributes;
> >
> > it should return failure (-1) if the object does not exist. Fixing this
> > alone does not help you entirely because when you mmap() it calls eas_map(),
> > the physical memory location has to be first made known to Iguana.
> > These regions must be made known in the machines.py file with
> > appropriate setup support by the build system. If you just want to fix
> > this quickly you can add the appropriate range check for your
> > framebuffer there.
> >
>
> So if I understand well I got two solutions :
>
> The quick'n dirty is to force the mapping by hard checking values in
> eas_map().
> And the proper one is to add the right memory region in the
> configuration files.
>
> For the quick one I must admit that I am a little lost and need a little
> more help about how to do.
I do something like this, but of course we'd rather you do it properly:
+ if (!ms) {
+ if ((base >= 0xf0000000)) /* fb phys */
+ badfb = 1;
+ else {
+ printf("%s: base 0x%lx end 0x%lx\n", __func__, base, end);
+ return -1;
+ }
+ }
/*
* XXX: we need to check the attribs and rights
*/
- attrib &= ms->attributes;
+ if (ms)
+ attrib &= ms->attributes;
rwx = L4_Rights(src_fpage);
/*
* XXX: we map 4k fpages even when bigger mappings are possible
*/
for (virt = base; virt < end; virt += BASE_PAGESIZE) {
- if (!memsection_lookup_phys(ms, virt, &phys, &size,
&iguana_pd))
- continue;
+ if (!badfb) {
+ if (!memsection_lookup_phys(ms, virt, &phys, &size,
&iguana_pd))
+ continue;
+ } else {
+ phys = base;
+ size = L4_Size(src_fpage);
+ }
>
> Concerning the proper, is it something similar to what is done for the
> vga memory ? ie adding something like :
> memory['fb'] = [Region(0xF0000000L, 0xF0400000L, "dedicated")]
> to the class ia32_pc99_fb in platform/pc99/tools/machines.py
> and/or a linux_fb flag with the right stuff
> in ./projects/iguana/SConstruct to add a memsection to Linux.
Yes, that's right. This would be the preferred solution.
>
> Regards,
-gl
>
> --
> Remy Gottschalk - rgottschalk at linagora.com
> Ingénieur informatique embarquée
> Groupe LINAGORA - http://www.linagora.com
> Tél.: +33(0)1 58 18 68 28 - Fax : +33(0)1 58 18 68 29
>
>
--
More information about the Developer
mailing list