l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: booting l4-Hurd, memory unaligned


From: Andreas B. Mundt
Subject: Re: booting l4-Hurd, memory unaligned
Date: Wed, 20 Apr 2005 22:50:24 +0200
User-agent: Mutt/1.5.6+20040907i

On Wed, Apr 20, 2005 at 03:11:11AM -0700, Jun Inoue wrote:
> 
> Andreas, could you spare some time to try this patch?
> 
> 

Hi Jun, Derek and everybody else,

I tried the patch and got (a bit?) further.

The output is very fast so I can't follow the first page (How can I stop it?),
but then (in yellow):

L4Ka::Pistachio - built by ...............

after that, there are some wortel messages. Finally the last 4 lines are:

wortel: loader_add_region: Protected Region: physmem-server (0x400000-0x417864) 
wortel: start_physmem: Mapping fpage: 0x410000/15
wortel: start_physmem: Mapping fpage: 0x400000/16
wortel: error: sigma0_get_fpage: sigma0 rejected mapping
>

I get a prompt (>) after that and can give some commands (?) (i.e. 'q' gives
some kind of map and so on, I just played a bit but have to learn more to
understand what is going on).

So, thanks a lot so far, if you need more information, I can write all the
output down of course. 

Regards
        Andi 

> 
> Index: ia32-cmain.c
> ===================================================================
> RCS file: /cvsroot/hurd/hurd-l4/laden/ia32-cmain.c,v
> retrieving revision 1.14
> diff -u -r1.14 ia32-cmain.c
> --- ia32-cmain.c      17 Nov 2004 16:21:39 -0000      1.14
> +++ ia32-cmain.c      20 Apr 2005 09:07:42 -0000
> @@ -250,10 +250,25 @@
>         if (end >> 32)
>           panic ("L4 does not support more than 4 GB on ia32");
>  
> -       if (mmap->base_addr & ((1 << 10) - 1)
> -           || mmap->length & ((1 << 10) - 1))
> -         panic ("Memory region (0x%llx - 0x%llx) is unaligned",
> -                mmap->base_addr, end);
> +       if (mmap->type == 2)
> +         {
> +           int aligned_base = mmap->base_addr & (~((1 << 10) - 1));
> +           /* Round down to multiple of 1 << 10, minus 1. */
> +           int aligned_end = ((end + 1) & (~((1 << 10) - 1))) - 1;
> +           int aligned_length = (aligned_end - aligned_base) + 1;
> +
> +           /* Region is too small. */
> +           if (aligned_base >= aligned_end)
> +             continue;
> +           end = aligned_end;
> +           mmap->base_addr = aligned_base;
> +           mmap->length = aligned_length;
> +         }
> +       else
> +         if (mmap->base_addr & ((1 << 10) - 1)
> +             || mmap->length & ((1 << 10) - 1))
> +             panic ("Memory region (0x%llx - 0x%llx) is unaligned",
> +                    mmap->base_addr, end);
>  
>         add_memory_map ((uint32_t) mmap->base_addr, (uint32_t) end,
>                         mmap->type == 1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]