Commit Graph

2099 Commits

Author SHA1 Message Date
Ulrich Spörlein
c0da74038d mdoc: make sure to pass at least one argument to quotation macros 2010-08-02 13:11:35 +00:00
Doug Rabson
1df9a68303 A simple test harness to help debug problems with the ZFS boot code. 2010-07-30 13:54:15 +00:00
Yoshihiro Takahashi
502074f0cf MFi386: revision 210387
Correctly setup LDADD with regards to libstand.
2010-07-25 02:22:32 +00:00
Andriy Gapon
676799a00d completely ignore zero-sized elf sections in modules of elf object type (amd64)
Current code doesn't check size of elf sections and may perform needless
actions of zero-sized memory allocation and similar.
The bigger issue is that alignment requirement of a zero-sized section
gets effectively applied to the next section if it has smaller alignment
requirement.  But other tools, like gdb and consequently kgdb,
completely ignore zero-sized sections and thus may map symbols to
addresses differently.

Zero-sized sections are not typical in general.
Their typical (only, even) cause in FreeBSD modules is inline assembly that
creates custom sections which is found in pcpu.h and vnet.h.  Mere inclusion
of one of those header files produces a custom section in elf output.
If there is no actual use for the section in a given module, then the
section remains empty.

Better solution is to avoid creating zero-sized sections altogether,
which is in plans.

Preloaded modules are handled in boot code (load_elf_obj.c), while
dynamically loaded modules are handled by kernel (link_elf_obj.c).

Based on code by:	np
MFC after:		3 weeks
2010-07-23 17:07:51 +00:00
Rui Paulo
7d54a05ac8 Correctly setup LDADD with regards to libstand. The submitter points
out that "on amd64, libstand.a is compiled for i386, but is still installed
under ${WORLDTMP}/usr/lib instead of ${WORLDTMP}/usr/lib32.  Even if it
would be installed there, ld on amd64 is set up incorrectly with a
${TOOLS_PREFIX}/usr/lib/i386 default path, so it wouldn't link.  The reason
it does link under gcc is that gcc passes -L${WORLDTMP}/usr/lib twice,
even for -m32 builds, which is also incorrect, but accidentally works in
this case."

Submitted by:	Dimitry Andric <dimitry at andric.com>
2010-07-22 18:57:47 +00:00
Nathan Whitehorn
67167531f0 Provide support in loader for booting 64-bit PowerPC kernels. Like amd64,
64-bit PowerPC kernels are loaded by a 32-bit loader, since nearly all
powerpc64 firmwares execute in 32-bit mode.
2010-07-12 00:49:22 +00:00
Rafal Jaworowski
6031d0b167 Get rid of bootinfo for good in loader (U-Boot-based) and ARM.
For FDT-enabled platforms the device tree is a modern replacement for bootinfo
config data.
2010-07-11 21:11:23 +00:00
Rafal Jaworowski
b0ddbe8776 Provide a missing interrupt-parent for the CPM / QUICC node in the DTS. 2010-07-11 20:29:34 +00:00
Marcel Moolenaar
58bf34c327 Use the kernel's start address to determine what to map. This allows
us to link the kernel at different addresses without needing to build
a corresponding loader.
2010-07-07 19:06:53 +00:00
Rebecca Cran
10eee561f4 Add some more modules to loader.conf. Remove if_awi since support for it
was removed 2 years ago.

PR: conf/147126
PR: conf/116071
Approved by: rrs (mentor)
2010-06-23 14:06:05 +00:00
Brian Somers
7100efb738 Add a missing prototype
PR:		145232
Submitted by:	gcooper
MFC after:	1 week
2010-06-20 08:03:06 +00:00
Roman Divacky
867610d08a Pass the -N flag to linked via -Wl.
Approved by:	ed (mentor)
2010-06-14 17:02:19 +00:00
Rafal Jaworowski
29d268b567 Fix conditional FDT support in loader(8). 2010-06-13 12:46:32 +00:00
Ed Schouten
d05becf2b6 Use -Wl,-N instead of the undocumented -N option for GCC.
GCC forwards the -N flag directly to ld. This flag is not documented and
not supported by (for example) Clang. Just use -Wl,-N.

Submitted by:	Pawel Worach
2010-06-03 17:42:32 +00:00
Andriy Gapon
4b0562e63c zfs boot: fix error handling in zfs_readdir
Found by:	clang static analyzer
MFC after:	4 days
2010-05-31 09:06:03 +00:00
Andriy Gapon
7bdc66dab8 boot/zfs: fix gang block reading code
- use correct size (512) while reading a gang block
- skip holes while reading child blocks
- advance buffer pointer while reading child blocks

PR:		144214
MFC after:	10 days
2010-05-28 07:34:20 +00:00
Rafal Jaworowski
13ced1d6a0 Initial device tree source (DTS) files for Marvell ARM systems:
o DB-88F5182
  o DB-88F5281
  o DB-88F6281
  o DB-78100
  o SheevaPlug

This also includes device tree bindings definitions for some newly introduced
nodes (mpp, gpio).

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-05-26 09:50:09 +00:00
Rafal Jaworowski
103de39de5 Import device tree source (DTS) files for PowerPC MPC8555CDS and MPC8572DS
development systems.

Special thanks to Phil Brownfield for help with BSD-style relicensing of
these files.

Obtained from:	Freescale
2010-05-26 09:34:02 +00:00
Rafal Jaworowski
0505cb3325 Bring a missing FDT piece (omitted in the previous commit). 2010-05-25 15:32:07 +00:00
Rafal Jaworowski
04cb90189b Initial loader(8) support for Flattened Device Tree.
o This is disabled by default for now, and can be enabled using WITH_FDT at
  build time.

o Tested with ARM and PowerPC.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2010-05-25 15:21:39 +00:00
Rafal Jaworowski
a0e34aa0ab Mostly revert r200691. U-Boot syscall() entry point returns 1 on success. 2010-05-25 10:15:30 +00:00
Rafal Jaworowski
75770ded45 Use loader devices only when they initialized properly. 2010-05-25 09:59:53 +00:00
John Baldwin
14765ad2e0 - Set 'dmadat' earlier so that we properly setup the heap if we fail to
locate a high memory area for the heap using the SMAP.
- Read the number of hard drive devices from the BIOS instead of hardcoding
  a limit of 128.  Some BIOSes duplicate disk devices once you get beyond
  the maximum drive number.

MFC after:	1 month
2010-05-21 16:58:52 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Warner Losh
950449cc28 Formatting nit 2010-05-10 18:23:00 +00:00
Xin LI
54934285c7 Remove if_ar, if_ray, if_sr, if_ppp, if_sl to reflect the current modules
available, they were removed due to NEEDSGIANT.

While I'm there, add if_et which was missed quite a while ago.

MFC after:	2 weeks
2010-05-04 19:58:55 +00:00
Marius Strobl
5a8336816e Add support for SPARC64 V (and where it already makes sense for other
HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the
MMU and cache handling, it doesn't add pmap optimizations possible with
these CPU, yet, though.
With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250
and likely also other models based on SPARC64 V like 450, 650 and 850.
Thanks go to Michael Moll for providing access to a PRIMEPOWER 250.
2010-05-02 19:38:17 +00:00
Pyun YongHyeon
d193ed0bed Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet.
This driver was written by Alexander Pohoyda and greatly enhanced
by Nikolay Denev. I don't have these hardwares but this driver was
tested by Nikolay Denev and xclin.

Because SiS didn't release data sheet for this controller, programming
information came from Linux driver and OpenSolaris. Unlike other open
source driver for SiS190/191, sge(4) takes full advantage of TX/RX
checksum offloading and does not require additional copy operation in
RX handler.
The controller seems to have advanced offloading features like VLAN
hardware tag insertion/stripping, TCP segmentation offload(TSO) as
well as jumbo frame support but these features are not available
yet. Special thanks to xclin <xclin<> cs dot nctu dot edu dot tw>
who sent fix for receiving VLAN oversized frames.
2010-04-14 20:45:33 +00:00
Rui Paulo
61e9274069 Add a copyright. 2010-04-07 18:24:38 +00:00
Rui Paulo
8df7a05edd EFI boot loader for FreeBSD/i386.
Doesn't boot a kernel yet, but it can read an ELF file from the EFI FAT
partition.
2010-04-07 18:16:05 +00:00
Xin LI
2561854d2b Our boot loader is capable of booting both i386 and amd64 kernels so
call it "x86" instead of "i386".

Suggested by:	jhb in response to Alexander Best's loader proposal
MFC after:	1 month
2010-03-26 01:30:53 +00:00
Bernd Walter
45c6af8938 BWCT boards can have 128MB SDRAM. 2010-03-09 00:50:58 +00:00
Bernd Walter
1dca0648c7 fix signed warning 2010-03-09 00:48:06 +00:00
Weongyo Jeong
4f0c2fae8d Add bwn(4) driver. 2010-02-25 19:47:47 +00:00
Rafal Jaworowski
3d5ffb0eb6 Minor style correction. 2010-02-25 15:30:26 +00:00
Rafal Jaworowski
04bfe19a09 Fix handling of GPT disk partition index.
Obtained from:	Semihalf
MFC after:	1 week
2010-02-25 15:29:41 +00:00
Rafal Jaworowski
f5b6b801e6 Let loader(8) for U-Boot use default storage more flexibly.
Obtained from:	Semihalf
MFC after:	1 week
2010-02-25 15:27:13 +00:00
Rafal Jaworowski
981c345ce7 Enable U-Boot storage for PowerPC. While there fix loader(8) help file name.
MFC after:	1 week
2010-02-25 15:21:37 +00:00
Marius Strobl
9b824f84d5 Some machines can not only consist of CPUs running at different speeds
but also of different types, f.e. Sun Fire V890 can be equipped with a
mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization
and different workarounds for model specific errata. Therefore move the
CPU implementation number from a global variable to the per-CPU data.
Functions which are called before the latter is available are passed the
implementation number as a parameter now.
2010-02-20 23:24:19 +00:00
Nathan Whitehorn
d91c59ee1e 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
MFC after:	1 week
2010-02-20 16:28:37 +00:00
Pawel Jakub Dawidek
736c8a338c Update comment. We also look for GPT partitions. 2010-02-18 22:23:30 +00:00
Marius Strobl
8c56bcac75 Correct the panic strings introduced in r203830 to match their arguments. 2010-02-13 15:12:46 +00:00
Marius Strobl
606e071c41 Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like
OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves.
Unlike direct access the firmware methods don't automatically use the
next free (?) TLB slot, instead the slot to be used has to be specified.
We allocate the TLB slots for the kernel top-down as OpenSolaris suggests
that the firmware will always allocate the ones for its own use bottom-up.
Besides being simpler, according to OpenBSD using the firmware methods is
required to allow booting on Sun Fire E10K with multi-systemboard domains.
2010-02-13 14:40:42 +00:00
Marius Strobl
4f607e8ef2 - Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
of Sun Fire V1280 doesn't round up the size itself but instead lets
  claiming of non page-sized amounts of memory fail.
- Change parameters and variables related to the TLB slots to unsigned
  which is more appropriate.
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the BSP as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
- Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Check the return value of init_heap(). This requires moving it after
  cons_probe() so we can panic when appropriate. This should be fine as
  the PowerPC OFW loader uses that order for quite some time now.
2010-02-13 14:13:39 +00:00
Marcel Moolenaar
fec3038524 Add command-line option -dev to set the default value of the currdev
variable. This is to be used by the EFI boot manager.

While here, re-factor the code a little bit and bump the version to
2.1.
2010-01-18 06:48:24 +00:00
Edward Tomasz Napierala
b3f9d8c804 Add gmountver, disk mount verification GEOM class.
Note that due to e.g. write throttling ('wdrain'), it can stall all the disk
I/O instead of just the device it's configured for.  Using it for removable
media is therefore not a good idea.

Reviewed by:	pjd (earlier version)
2010-01-16 09:52:49 +00:00
Brooks Davis
412f9500e2 Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic
kern.ngroups+1.  kern.ngroups can range from NGROUPS_MAX=1023 to
INT_MAX-1.  Given that the Windows group limit is 1024, this range
should be sufficient for most applications.

MFC after:	1 month
2010-01-12 07:49:34 +00:00
Marcel Moolenaar
592daa5d9b Remove debugging printf(). There's no need to print the image
base address anymore.
2010-01-10 00:14:04 +00:00
Marcel Moolenaar
716f79c093 Remove file system support based on the simple file system protocol
as this only allows us to access file systems that EFI knows about.
With a loader that can only use EFI-supported file systems, we're
forced to put /boot on the EFI system partition. This is suboptimal
in the following ways:
1.  With /boot a symlink to /efi/boot, mergemaster complains about
    the mismatch and there's no quick solution.
2.  The EFI loader can only boot a single version of FreeBSD. There's
    no way to install multiple versions of FreeBSD and select one
    at the loader prompt.
3.  ZFS maintains /boot/zfs/zpool.cache and with /boot a symlink we
    end up with the file on a MSDOS file system. ZFS does not have
    proper handling of file systems that are under Giant.

Implement a disk device based on the block I/O protocol instead and
pull in file system code from libstand. The disk devices are really
the partitions that EFI knows about.

This change is backward compatible.

MFC after:	1 week
2010-01-09 22:54:29 +00:00
Marius Strobl
ccb1921ee0 - 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-09 21:23:39 +00:00