summaryrefslogtreecommitdiffstats
path: root/sys/boot
Commit message (Collapse)AuthorAgeFilesLines
* Add command-line option -dev to set the default value of the currdevmarcel2010-01-182-14/+58
| | | | | | | 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.
* Add gmountver, disk mount verification GEOM class.trasz2010-01-161-0/+1
| | | | | | | | 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)
* Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamicbrooks2010-01-121-0/+1
| | | | | | | | 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
* Remove debugging printf(). There's no need to print the imagemarcel2010-01-101-2/+0
| | | | base address anymore.
* Remove file system support based on the simple file system protocolmarcel2010-01-097-449/+276
| | | | | | | | | | | | | | | | | | | | | | | 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
* - Add code allowing a network device to only be open and closed oncemarius2010-01-092-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNFmarius2010-01-091-10/+1
| | | | | | license FreeBSD had in sys/boot). Obtained from: NetBSD
* Space cleanup for revision 201689 committed separately for easier review.delphij2010-01-061-35/+35
| | | | | | | | This commit is purely space changes. Submitted by: Matt Reimer Sponsored by: VPOP Technologies, Inc. MFC after: 2 weeks
* Instead of assuming all vdevs are healthy, check the newest vdev labeldelphij2010-01-061-22/+66
| | | | | | | | | 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. MFC after: 2 weeks
* Fix typo: s/partion/partition/mbr2010-01-021-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 3 days
* Reimplement the boot2 for pc98 completely.nyan2009-12-3122-4590/+1335
| | | | | | | | | | | | | | | | 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. Tested by: SATOU Tomokazu ( tomo1770 _ maple _ ocn _ ne _ jp ), WATANABE Kazuhiro ( CQG00620 _ nifty _ ne _ jp ) and nyan MFC after: 2 week Happy New Year in Japan!!
* Don't use 15M-16M area on pc98. It's reserved for some devices.nyan2009-12-312-1/+20
| | | | MFC after: 2 week
* Add setting machine type support to the loader.nyan2009-12-314-1/+112
| | | | MFC after: 2 week
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.antoine2009-12-281-1/+1
| | | | | | | | | 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) MFC after: 1 month
* Execute the cleanup handlers before jumping to the kernel justmarius2009-12-241-0/+2
| | | | like the other architectures do.
* - Consistently wrap debugging in NETIF_DEBUG. This basically mergesmarius2009-12-241-6/+22
| | | | | NetBSD rev 1.19. - Make the functions match their prototypes regarding static.
* Revert r183628 as with the current ata(4) ATAPI DMA with AcerLabsmarius2009-12-241-1/+0
| | | | | | 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.
* Don't build zfsboot, gptzfsboot, and zfsloader if WITHOUT_ZFS is enabled.jhb2009-12-221-2/+8
| | | | MFC after: 1 week
* Move cursor position after putting a character.nyan2009-12-211-0/+10
| | | | MFC after: 1 week
* Fix ub_env_enum(): syscall() returns 0 when properly invoked.marcel2009-12-181-4/+3
|
* Fix debug messages of bd_io().nyan2009-12-172-8/+8
| | | | MFC after: 1 week
* Add support for memory disk (md). The size of the memory diskmarcel2009-12-132-0/+156
| | | | | | is determined by MD_IMAGE_SIZE. A file system can be embedded into the loader with /sys/tools/embed_mfs.sh. Note that md.c is not included when MD_IMAGE_SIZE is not set.
* Cleanups the boot2 for pc98. There is no functional change.nyan2009-12-118-164/+18
| | | | | | | | | - Make setting machine type and getting geom conditional for future. - Remove unused RAWBOOT and CDBOOT supports. - Remove unneeded include. - Fix warnings. MFC after: 1 week
* Don't warn about an RSDP with a corrupt checksum. The kernel does a betterjhb2009-12-101-3/+1
| | | | | | | | job about warning about these things later and this message can be confusing. Submitted by: infofarmer MFC after: 1 week
* Fix a confusing typo in the EDD packet structure used in gptboot andjhb2009-12-092-6/+6
| | | | | | | | 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. MFC after: 1 week
* - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it tojhb2009-12-092-21/+112
| | | | | | | | | | 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. Submitted by: Matt Reimer mattjreimer of gmail MFC after: 1 week
* MFi386: revision 200219nyan2009-12-082-8/+25
| | | | | | | Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. MFC after: 1 week
* MFi386: Use real mode instead of v86 mode.nyan2009-12-081-410/+361
| | | | MFC after: 1 week
* MFi386: revision 200216nyan2009-12-082-3/+2
| | | | Various small whitespace and style fixes.
* Improve the algorithm the loader uses to choose a memory range for itsjhb2009-12-073-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | heap when using a range above 1MB. Previously the loader would always use the last 3MB in the first memory range above 1MB for the heap. However, this memory range is also where the kernel and any modules are loaded. If this memory range is "small", then using the high 3MB for the heap may not leave enough room for the kernel and modules. Now the loader will use any range below 4GB for the heap, and the logic to choose the "high" heap region has moved into biosmem.c. It sets two variables that the loader can use for a high heap if it desires. When a high heap is enabled (BZIP2, FireWire, GPT, or ZFS), then the following memory ranges are preferred for the heap in order from best to worst: - The largest memory region in the SMAP with a start address greater than 1MB. The memory region must be at least 3MB in length. This leaves the region starting at 1MB purely for use by the kernel and modules. - The last 3MB of the memory region starting at 1MB if it is at least 3MB in size. This matches the current behavior except that the current loader would break horribly if the first region was not at least 3MB in size. - The memory range from the end of the loader up to the 640k window. This is the range the loader uses when none of the high-heap-requesting options are enabled. Tested by: hrs MFC after: 1 week
* Various small whitespace and style fixes.jhb2009-12-073-10/+11
|
* Remove spinconsole from pc98, some parts seem to be missed and it'ssobomax2009-11-271-2/+0
| | | | | | too late (early?) to figure out what exactly. Reported by: TAKAHASHI Yoshihiro
* Whitespace-only: another instance of identation with spaces.sobomax2009-11-271-1/+1
|
* Whitespace on: use tabs for identation consistently.sobomax2009-11-271-4/+4
|
* Add new loader console type: "spinconsole". This console selects thesobomax2009-11-276-20/+135
| | | | | | | | video console which doesn't take any input from keyboard and hides all output replacing it with ``spinning'' character (useful for embedded products and custom installations). Sponsored by: Sippy Software, Inc.
* Be nice, don't use the f-word.trasz2009-11-252-2/+2
|
* Create a seperate ZFS enabled loader.rnoland2009-11-235-15/+33
| | | | | | | | | | | | | | | | | | | 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. Based on a previous patch from jhb@ Reviewed by: jhb@ MFC after: 2 weeks
* Always use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot tojhb2009-11-202-14/+14
| | | | | | | | fully support booting from large volumes. Tested by: Emil Smolenski ambsd of raisa.eu.org Submitted by: Matt Reimer mattjreimer of gmail (most of the C bits) MFC after: 1 week
* Provide an effective (relocated) address when building modules metadata.raj2009-11-191-1/+3
| | | | | | | This lets modules loaded dynamically in loader(8) work for U-Boot-based platforms. MFC after: 1 week
* Introduce a new option (BOOT_PROMPT_123) that lets enter the boot promptattilio2009-11-122-0/+22
| | | | | | | | | | | | only when typing the sequence "123" (opposite to the standard 'push any button' approach). That results useful when using serial lines sending garbage and leading to unwilling boot prompt appearence. Obtained from: Sandvine Incorporated Reviewed by: emaste, jhb Sponsored by: Sandvine Incorporated MFC: 1 week
* - Remove trailing ";" after if statementantoine2009-11-111-6/+1
| | | | | | | - Remove #if 0 section that was never needed/used Reviewed by: raj@ MFC after: 1 month
* Close a file descriptor leak in an error case.brueffer2009-10-281-0/+1
| | | | | | PR: 138374 Submitted by: Patroklos Argyroudis <argp@census-labs.com> MFC after: 1 week
* Correct some issues with zfs boot.rnoland2009-10-233-23/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 Reviewed by: dfr, jhb MFC after: 2 weeks
* Use zfs_read() instead of xfsread() to read /boot.config. xfsread() failsjhb2009-10-141-1/+1
| | | | | | | | | | 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. Submitted by: Johny Mattsson johny-freebsd of earthmagic org Reviewed by: dfr MFC after: 3 days
* lindev(4) [1] is supposed to be a collection of linux-specific pseudobz2009-09-261-0/+1
| | | | | | | | | | | | | | | | | | | 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 MFC after: 6 weeks
* MFi386:nyan2009-09-131-1/+1
| | | | | | | Move the loader's entry point to 0x200000. This change is also needed for pc98. MFC after: 3 days
* If the pxe client is told to use / as the root path, honour that ratheremaste2009-09-101-1/+1
| | | | | | | | of trying to mount /pxeroot instead. PR: i386/106493 Submitted by: Andrey Russev MFC after: 1 month
* Fix parse() so that the partition to boot (load /boot/loader) from canjhay2009-08-171-8/+5
| | | | | | | be set. The syntax as printed in main() is used: 0:ad(0p3)/boot/loader Reviewed by: jhb Approved by: re (kib)
* Update epair(4) to the new netisr implementation and polishbz2009-07-261-0/+1
| | | | | | | | | | | | | | | | 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)
* On special systems where the MBR and the GPT are in sync (up to the 4thrpaulo2009-06-261-1/+1
| | | | | | | | | | | | | 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)
OpenPOWER on IntegriCloud