Commit Graph

2042 Commits

Author SHA1 Message Date
Nathan Whitehorn
a0b72790e4 MFC r204129:
Enable NETIF_OPEN_CLOSE_ONCE on PowerPC OFW. This fixes netbooting on
PowerPC Book-S hardware, which had been broken for a very long time.

Submitted by:	Andreas Tobler
2010-03-01 00:35:30 +00:00
Brooks Davis
3c48c0897f MFC r202143,202163,202341,202342,204278
Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic
  kern.ngroups+1.  kern.ngroups can range from NGROUPS_MAX=1023 to
  somewhere in the neighborhood of INT_MAX/4 one a system with sufficent
  RAM and memory bandwidth.  Given that the Windows group limit is
  1024, this range should be sufficient for most applications

r202342:
  Only allocate the space we need before calling kern_getgroups instead
  of allocating what ever the user asks for up to "ngroups_max + 1".  On
  systems with large values of kern.ngroups this will be more efficient.

  The now redundant check that the array is large enough in
  kern_getgroups() is deliberate to allow this change to be merged to
  stable/8 without breaking potential third party consumers of the API.
2010-02-24 22:16:16 +00:00
Antoine Brodin
e2b36efde5 MFC r201145 to stable/8:
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
  Fix some wrong usages.
  Note: this does not affect generated binaries as this argument is not used.

  PR:		137213
  Submitted by:	Eygene Ryabinkin (initial version)
2010-01-30 12:11:21 +00:00
Marcel Moolenaar
5a183eb8e4 MFC rev 202552:
Add command-line option -dev to set the default value of the currdev
variable.
2010-01-23 06:29:34 +00:00
Xin LI
b1ebb318cb MFC r201690:
Space cleanup for revision 202669 committed separately for easier review.
This commit is purely space changes.

Submitted by:	Matt Reimer
Sponsored by:	VPOP Technologies, Inc.
2010-01-20 01:14:54 +00:00
Xin LI
ac07939f0e MFC r201689:
Instead of assuming all vdevs are healthy, check the newest vdev label
for each vdev's status.  Booting from a degraded vdev should now be
more robust.

Submitted by:	Matt Reimer <mattjreimer at gmail.com>
Sponsored by:	VPOP Technologies, Inc.
2010-01-20 01:13:52 +00:00
Marcel Moolenaar
fdc6e8a301 MFC rev 201941:
Remove file system support based on the simple file system protocol.

MFC rev 201966:
Remove debugging printf().
2010-01-16 04:34:03 +00:00
Marius Strobl
455564ab5c MFC: r201932
- Add code allowing a network device to only be open and closed once
  by keeping it opened after the first open and closing it via the
  cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to
  avoid the open-close-dance on every file access which with firmware
  that for example performs an auto-negotiation on every open causes
  netbooting to take horribly long. Basically the behavior with this
  knob enabled resembles the one employed between r60506 and r177108
  (and for sparc64 also again since r182919) with the addition that
  the network device now is closed eventually before entering the
  kernel and before rebooting. Actually I think this should be the
  desired MI behavior, however the U-Boot loader actually requires
  net_close() to be called after every transaction in order for some
  local shutdown operations to be performed (and which I think thus
  will break on concurrent opens, i.e. when netdev_opens is > 1, like
  the loader does at least for disks when LOADER_GZIP_SUPPORT is
  enabled).
- Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially
  increased netdev_opens for sparc64 in order to keep the network
  device opened forever, as at least some firmware versions require
  the network device to be closed eventually before entering the
  kernel or otherwise will DMA received packets to stale memory.
  The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be
  set as well for the same reasons.
2010-01-15 19:06:33 +00:00
Marius Strobl
1a6cae7f37 MFC: r201901
Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF
license FreeBSD had in sys/boot).

Obtained from:	NetBSD
2010-01-15 16:57:49 +00:00
Marius Strobl
95915f9fa6 MFC: r200946
Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.
2010-01-15 15:28:57 +00:00
Marius Strobl
e6af3b7bb8 MFC: r200945
- Consistently wrap debugging in NETIF_DEBUG. This basically merges
  NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.
2010-01-15 15:27:17 +00:00
Yoshihiro Takahashi
b304370214 MFC: revision 201342
Reimplement the boot2 for pc98 completely.
  It's based on the newest i386's one and has the advantage of:

   - ELF binary support.
   - UFS2 filesystem support.
   - Many FreeBSD slices support on a disk.
2010-01-15 12:27:46 +00:00
Marius Strobl
854f8af819 MFC: r200944
Revert r183628 as with the current ata(4) ATAPI DMA with AcerLabs
M5229 appears to be once again fixed. If this happens to return
we probably should disable ATAPI DMA in ataacerlabs(4) instead
just like the Linux libATA does.
2010-01-15 12:07:30 +00:00
Yoshihiro Takahashi
cf83985263 MFC: revision 201339 and 201340
- Add setting machine type support to the loader.
  - Don't use 15M-16M area on pc98.  It's reserved for some devices.
2010-01-15 11:26:20 +00:00
John Baldwin
58f48e4ba6 MFC 200872:
Don't build zfsboot, gptzfsboot, and zfsloader if WITHOUT_ZFS is enabled.
2009-12-30 17:42:41 +00:00
Yoshihiro Takahashi
eaf52f2239 MFC: revision 200776
Move cursor position after putting a character.
2009-12-29 04:23:46 +00:00
Yoshihiro Takahashi
2fce833cd1 MFC: revision 200631
Fix debug messages of bd_io().
2009-12-24 12:19:52 +00:00
Yoshihiro Takahashi
a3ff6f1def MFC: r200254
MFi386: Use real mode instead of v86 mode.
2009-12-19 04:43:25 +00:00
Yoshihiro Takahashi
abe32331b6 MFC: r200253 and r200255
Reduce diffs against i386.
2009-12-19 04:25:19 +00:00
John Baldwin
823e5012b0 MFC 200357:
Don't warn about an RSDP with a corrupt checksum.  The kernel does a better
job about warning about these things later and this message can be
confusing.
2009-12-18 22:23:27 +00:00
John Baldwin
f70478c04d MFC 200310:
Fix a confusing typo in the EDD packet structure used in gptboot and
gptzfsboot.  I got the segment and offset fields reversed in the structure,
but I also succeeded in crossing the assignments so the actual EDD packet
ended up correct.
2009-12-18 21:21:14 +00:00
John Baldwin
5e05dbe9bd MFC 200309:
- Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to
  safely allocate a heap region above 1MB.  This enables {gpt,}zfsboot()
  to allocate much larger buffers than before.
- Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers.  This
  allows more reliable reading of compressed files in a raidz/raidz2 pool.
2009-12-18 21:01:56 +00:00
John Baldwin
5f0cb0c9cd MFC 200216,200219:
- Various small whitespace and style fixes.
- Improve the algorithm the loader uses to choose a memory range for its
  heap when using a range above 1MB.
2009-12-18 20:28:04 +00:00
Antoine Brodin
59cdac432f MFC r199193 to stable/8:
- Remove trailing ";" after if statement
  - Remove #if 0 section that was never needed/used
  Reviewed by:	raj@
2009-12-12 12:36:41 +00:00
Robert Noland
c9ab55149b MFC 199714
Create a seperate ZFS enabled loader.

This adds zfsloader which will be called by zfsboot/gptzfsboot code rather
than the tradional loader.  This eliminates the need to set the
LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader.

Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot)
in order for the boot process to use the new loader.

New installations will no longer be required to build a ZFS enabled
loader for a working ZFS boot system.  Installing zfsboot/gptzfsboot is
sufficient for acknowledging the use of CDDL code and therefore the ZFS
enabled loader.
2009-12-07 16:37:02 +00:00
Bjoern A. Zeeb
a1778929b7 MFC r197518:
lindev(4) [1] is supposed to be a collection of linux-specific pseudo
  devices that we also support, just not by default (thus only LINT or
  module builds by default).

  While currently there is only "/dev/full" [2], we are planning to see more
  in the future.  We may decide to change the module/dependency logic in the
  future should the list grow too long.

  This is not part of linux.ko as also non-linux binaries like kFreeBSD
  userland or ports can make use of this as well.

Suggested by:	rwatson [1] (name)
Submitted by:	ed [2]
Discussed with:	markm, ed, rwatson, kib (weeks ago)
Reviewed by:	rwatson, brueffer (prev. version)
PR:		kern/68961
2009-12-05 20:37:46 +00:00
John Baldwin
fa860bed4e MFC 199579:
Always use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot to
fully support booting from large volumes.
2009-12-01 22:38:17 +00:00
Rafal Jaworowski
5e54294468 MFC r199534:
Provide an effective (relocated) address when building modules metadata.

This lets modules loaded dynamically in loader(8) work for U-Boot-based
platforms.
2009-11-26 22:35:26 +00:00
Attilio Rao
ea46ba3475 MFC r199210:
Introduce the new loader compile-time option BOOT_PROMPT_123 which allows
to enter the loader prompt just after entering the sequence "123".

Sponsored by:	Sandvine Incorporated
2009-11-22 15:57:08 +00:00
Robert Noland
262b2ce076 MFC 198420
Correct some issues with zfs boot.

   - Teach it to read gang blocks. (essentially untested)
     If you see "ZFS: gang block detected!", please let
     me know, so we can either remove the printf if it
     works, or fix it if it doesn't.

   - If multiple partitions exist on a disk, probe them all.
     We also need to reset dsk->start to 0 to read the right
     sector here.

   - With GPT, we can have 128 partitions.

   - If the bootfs property has ever been set on a pool
     it seems that it never goes away.  zpool won't allow
     you to add to the pool with the bootfs property set.
     However, if you clear the property back to default
     we end up getting 0 for the object number and read
     a bogus block pointer and fail to boot.

   - Fix some error printfs. The printf in the loader is
     only capable of c,s and u formats.

   - Teach printf how to display %llu
2009-11-21 15:02:35 +00:00
Christian Brueffer
e4e76802b8 MFC: r198537
Close a file descriptor leak in an error case.
2009-11-04 13:06:09 +00:00
Ed Maste
f94d7478f3 MFC r197082:
If the pxe client is told to use / as the root path, honour that rather
of trying to mount /pxeroot instead.

PR:		i386/106493
Submitted by:	Andrey Russev
2009-11-02 16:46:06 +00:00
John Baldwin
a9266569b7 MFC 198079:
Use zfs_read() instead of xfsread() to read /boot.config.  xfsread() fails
short read requests, so the result was that a /boot.config smaller than 512
bytes was ignored.  boot2 uses fsread() instead of xfsread() to read
/boot.config already, so this makes zfsboot more like boot2.

Approved by:	re (kib)
2009-10-19 18:31:39 +00:00
Yoshihiro Takahashi
9febd63ce1 MFC: r197156
MFi386:

  Move the loader's entry point to 0x200000.  This change is also needed
  for pc98.

Approved by:	re (kensmith)
2009-09-17 14:12:21 +00:00
John Hay
c49b5baa65 MFC: 196326
Fix parse() so that the partition to boot (load /boot/loader) from can
be set. The syntax as printed in main() is used: 0:ad(0p3)/boot/loader

Reviewed by:	jhb
Approved by:	re (kib)
2009-08-17 15:39:47 +00:00
Bjoern A. Zeeb
d0ea47437a Update epair(4) to the new netisr implementation and polish
things a bit:
- use dpcpu data to track the ifps with packets queued up,
- per-cpu locking and driver flags
- along with .nh_drainedcpu and NETISR_POLICY_CPU.
- Put the mbufs in flight reference count, preventing interfaces
  from going away, under INVARIANTS as this is a general problem
  of the stack and should be solved in if.c/netisr but still good
  to verify the internal queuing logic.
- Permit changing the MTU to virtually everythinkg like we do for loopback.

Hook epair(4) up to the build.

Approved by:	re (kib)
2009-07-26 12:20:07 +00:00
Rui Paulo
1e5fd3f467 On special systems where the MBR and the GPT are in sync (up to the 4th
slicei, Apple EFI hardware), the bootloader will fail to recognize the GPT
if it finds anything else but the EFI partition. Change the check to continue
detecting the GPT by looking at the EFI partition on the MBR but
stopping successfuly after finding it.

PR:		kern/134590
Submitted by:	Christoph Langguth <christoph at rosenkeller.org>
Reviewed by:	jhb
MFC after:	2 weeks
Approved by:	re (kib)
2009-06-26 09:32:31 +00:00
Rafal Jaworowski
400b1bbfe8 Bump PowerPC loader(8) version to reflect extensions it has recently grown. 2009-06-22 15:57:12 +00:00
Marius Strobl
119051cbf9 Add cas(4), a driver for Sun Cassini/Cassini+ and National Semiconductor
DP83065 Saturn Gigabit Ethernet controllers. These are the successors
of the Sun GEM controllers and still have a similar but extended transmit
logic. As such this driver is based on gem(4).
Thanks to marcel@ for providing a Sun Quad GigaSwift Ethernet UTP (QGE)
card which was vital for getting this driver to work on architectures
not using Open Firmware.

Approved by:	re (kib)
MFC after:	2 weeks
2009-06-15 18:22:41 +00:00
Pyun YongHyeon
d68875eb7e Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet
controller. These controllers are also known as L1C(AR8131) and
L2C(AR8132) respectively. These controllers resembles the first
generation controller L1 but usage of different descriptor format
and new register mappings over L1 register space requires a new
driver. There are a couple of registers I still don't understand
but the driver seems to have no critical issues for performance and
stability. Currently alc(4) supports the following hardware
features.
  o MSI
  o TCP Segmentation offload
  o Hardware VLAN tag insertion/stripping
  o Tx/Rx interrupt moderation
  o Hardware statistics counters(dev.alc.%d.stats)
  o Jumbo frame
  o WOL
AR8131/AR8132 also supports Tx checksum offloading but I disabled
it due to stability issues. I'm not sure this comes from broken
sample boards or hardware bugs. If you know your controller works
without problems you can still enable it. The controller has a
silicon bug for Rx checksum offloading, so the feature was not
implemented.
I'd like to say big thanks to Atheros. Atheros kindly sent sample
boards to me and answered several questions I had.

HW donated by:	Atheros Communications, Inc.
2009-06-10 02:07:58 +00:00
John Baldwin
0cf7495c65 Instead of packing the individual fields in the PnP structures, pack the
entire structures.  This trims some warnings.

Verified by:	md5(1)
MFC after:	1 week
2009-06-08 15:09:22 +00:00
John Baldwin
2a4eff4703 Don't attempt to free the GPT partition list for a disk with an empty GPT.
Submitted by:	Yuri Pankov  yuri.pankov of gmail
MFC after:	3 days
2009-06-08 15:07:35 +00:00
Jung-uk Kim
129d3046ef Import ACPICA 20090521. 2009-06-05 18:44:36 +00:00
Rafal Jaworowski
f439325342 Make GPT style partitiong endian-safe in U-Boot support library.
Submitted by:	Piotr Ziecik
Obtained from:	Semihalf
2009-06-03 16:28:29 +00:00
John Baldwin
4fdf20550c Add a missing parameter when displaying GPT partitions with an unknown
UUID.

Submitted by:	Pawel Worach  pawel.worach | gmail
MFC after:	1 week
2009-06-01 14:20:13 +00:00
Craig Rodrigues
0c349f0856 sys/boot/common.c
=================
Extend the loader to parse the root file system mount options in /etc/fstab,
and set a new loader variable vfs.root.mountfrom.options with these options.
The root mount options must be a comma-delimited string, as specified in
/etc/fstab.
Only set the vfs.root.mountfrom.options variable if it has not been
set in the environment.

sys/kern/vfs_mount.c
====================
When mounting the root file system, pass the mount options
specified in vfs.root.mountfrom.options, but filter out "rw" and "noro",
since the initial mount of the root file system must be done as "ro".
While we are here, try to add a few hints to the mountroot prompt
to give users and idea what might of gone wrong during mounting
of the root file system.

Reviewed by:	jhb (an earlier patch)
2009-06-01 01:02:30 +00:00
Marcel Moolenaar
7a6c5e0bb1 Fix NETIF_DEBUG compilation. 2009-05-30 19:28:38 +00:00
Doug Rabson
cc4757ddef Some of the boot loader code only works on a ufs file system, but it
uses the generic struct dirent, which happens to look identical to UFS's
struct direct.  If BSD ever changes dirent then this will be a problem.

Submitted by:	matthew dot fleming at isilon dot com
2009-05-28 08:22:36 +00:00
Christian Brueffer
395ad99417 Improve the accf_dns_load description. 2009-05-17 10:58:50 +00:00
Doug Rabson
e1899ef6c8 Add support for booting from raidz1 and raidz2 pools. 2009-05-16 10:48:20 +00:00