Subject: Re: Adding Multiboot support (or not)
To: None <tech-kern@netbsd.org, port-i386@netbsd.org>
From: Pavel Cahyna <pavel@netbsd.org>
List: tech-kern
Date: 05/16/2006 09:59:56
--eHhjakXzOLJAF9wJ
Content-Type: multipart/mixed; boundary="mojUlQ0s9EVzWg2t"
Content-Disposition: inline


--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 13, 2006 at 08:20:45AM -0700, Jason Thorpe wrote:
>=20
> On May 3, 2006, at 6:30 AM, Pavel Cahyna wrote:
>=20
> >Is it appropriate to commit it? I see that the current ldscript for i386
> >is very different, it has many things which apparently make sense only f=
or
> >userland.
>=20
> Looks good.

I have now noticed that the current script does not contain any absolute
address at all, so I have modified the proposed script to respect this.

I also made a new kern.ldiscript.4MB in the same spirit.

OK?

BTW in arch/xen/conf there is an identical ldscript, should this one be
changed, too? Could anybody test if the new one works for the NetBSD/Xen
kernel?

Pavel

--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="kern.ldscript"

ENTRY(_start)
SECTIONS
{
/*   KERNEL_BASE_phys = 0x00100000; */
/*   KERNEL_BASE_virt = 0xc0100000; */

   /* Read-only sections, merged into text segment: */
   .text :
   AT (ADDR(.text) & 0x0fffffff)
   {
     *(.text)
     *(.text.*)
     *(.stub)
     *(.rodata)
   } =0
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);

   /* Align the data segment to start on a page boundary. */
   . = ALIGN(0x1000);
   .data :
   AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
   {
     __data_start = . ;
     *(.data)
     *(.data.*)
   }
   PROVIDE (_edata = .);
   PROVIDE (edata = .);
   __bss_start = . ;
   .bss :
   AT (LOADADDR(.text) + (ADDR(.bss) - ADDR(.text)))
   {
     *(.bss)
     *(.bss.*)
     *(COMMON)
     . = ALIGN(32 / 8);
   }
   . = ALIGN(32 / 8);
  PROVIDE (_end = .) ;
  PROVIDE (end = .) ;
}

--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="kern.ldscript.4MB"

ENTRY(_start)
SECTIONS
{
   /* KERNEL_BASE_phys = 0x00100000; */
   /* KERNEL_BASE_virt = 0xc0100000; */

   /* Read-only sections, merged into text segment: */
   .text :
   AT (ADDR(.text) & 0x0fffffff)
   {
     *(.text)
     *(.text.*)
     *(.stub)
     *(.rodata)
   } =0
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);

   /* Adjust the address for the data segment.  We push the data segment
      up to the next 4MB boundary so that we can map the text with large
      pages. */
   . = ALIGN(0x400000);
   .data :
   AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
   {
     __data_start = . ;
     *(.data)
     *(.data.*)
   }
   PROVIDE (_edata = .);
   PROVIDE (edata = .);
   __bss_start = . ;
   .bss :
   AT (LOADADDR(.text) + (ADDR(.bss) - ADDR(.text)))
   {
     *(.bss)
     *(.bss.*)
     *(COMMON)
     . = ALIGN(32 / 8);
   }
   . = ALIGN(32 / 8);
  PROVIDE (_end = .) ;
  PROVIDE (end = .) ;
}

--mojUlQ0s9EVzWg2t--

--eHhjakXzOLJAF9wJ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iQEVAwUBRGmGfISBBSZgBA5OAQIvXwf/R5Gpb1Jk8Vt6F0wqF5q9yr6HwSaDg3zO
94tbV92Geo5UHo19YzIYIl+7KbYMOZ/Te0scSkvLVN+B/4j0WB57FvamVDNvrbYD
sg9bny02XM20j0cjRD1qTIcmk38n0KFp+ZUEADUXKsHvPFilwBhQS/vmf7NM2ccK
PUS+3gVWu/1BPqYyyA0Xt6S1dM36RxiGk/l2A1ukdY/OFwDM50t5tLxpbpIFqqbm
QA+SEYtyzN+h0qrUf3l+1KdGTc9V7VVP9HpwtQHsyz9btu7lnxqB3NHpw4xMBHYa
pI1rAl5/LuAPLqoJbIXHu/AhSnOQfOKU0xK2drW8jyqkRd/QODu+MA==
=1+16
-----END PGP SIGNATURE-----

--eHhjakXzOLJAF9wJ--