[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: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Jun 2012 22:28:04 +0200

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.

CU, Ingo

Other related posts: