[haiku-commits] Re: BRANCH xyzzy-github.x86_64 - in src/system: boot/loader kernel/fs boot/platform/bios_ia32 boot/platform/pxe_ia32 kernel/vm

  • From: Alex Smith <alex@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 21 Jun 2012 11:33:47 +0100

On 20 June 2012 21:28, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:

> On 2012-06-20 at 15:48:55 [+0200], xyzzy-github.x86_64
> <community@xxxxxxxxxxxx> wrote:
> [...]
> > diff --git a/src/system/kernel/fs/vfs_boot.cpp
> > b/src/system/kernel/fs/vfs_boot.cpp
> > index 0c0aba4..b8240d7 100644
> > --- a/src/system/kernel/fs/vfs_boot.cpp
> > +++ b/src/system/kernel/fs/vfs_boot.cpp
> > @@ -54,6 +54,8 @@ static struct {
> >      {NULL}
> >  };
> >
> > +static int32 sBootMethodType;
> > +
>
> It's not so nice to have static variables for stuff that is only needed
> during kernel initialization. AFAIK Linux puts those in a special segment
> which is freed after initialization, but we don't (yet), so they waste
> memory. In this case it looks like it is easy to avoid by either passing
> the
> boot method type back from get_boot_partitions() (e.g. via reference
> parameter) or already recreate the boot volume KMessage in
> vfs_mount_boot_file_system() and pass it to get_boot_partitions() instead
> of
> the kernel_args which don't seem to be used for any other purpose.
>
> [...]
> > diff --git a/headers/private/kernel/boot/addr_range.h
> > b/headers/private/kernel/boot/addr_range.h
> > index 1aa80e7..67129eb 100644
> > --- a/headers/private/kernel/boot/addr_range.h
> > +++ b/headers/private/kernel/boot/addr_range.h
> > @@ -11,8 +11,8 @@
> >
> >
> >  typedef struct addr_range {
> > -    addr_t start;
> > -    size_t size;
> > +    uint64 start;
> > +    uint64 size;
> >  } addr_range;
>
> I think phys_addr_range should be dropped completely now, using addr_range
> instead. This would simplify the address range code, requiring only half of
> the functions. If you feel like changing it, go ahead, otherwise please
> add a
> TODO to that effect.
>

OK, I'll change both of those.

I noticed while changing pointers that there appears to be 2 redundant
members in kernel_args - the ioapic pointer in arch_kernel_args never gets
used (only ioapic_phys does), nor does the drives pointer in
platform_kernel_args. Should I remove these?

Thanks,
Alex

Other related posts: