summaryrefslogtreecommitdiffstats
path: root/sys/boot
Commit message (Collapse)AuthorAgeFilesLines
* Fix some more issues with the real mode BTX.jhb2009-02-241-35/+60
| | | | | | | | | | | | | | | | | | | | | | | | | The old BTX passed the general purpose registers from the 32-bit client to the routines called via virtual 86 mode. The new BTX did the same thing. However, it turns out that some instructions behave differently in virtual 86 mode and real mode (even though this is under-documented). For example, the LEAVE instruction will cause an exception in real mode if any of the upper 16-bits of %ebp are non-zero after it executes. In virtual 8086 mode the upper 16-bits are simply ignored. This could cause faults in hardware interrupt handlers that inherited an %ebp larger than 0xffff from the 32-bit client (loader, boot2, etc.) while running in real mode. To fix, when executing hardware interrupt handlers provide an explicit clean state where all the general purpose and segment registers are zero upon entry to the interrupt handler. While here, I attempted to simplify the control flow in the 'intusr' code that sets up the various stack frames and exits protected mode to invoke the requested routine via real mode. A huge thanks to Tor Egge (tegge@) for debugging this issue. Submitted by: tegge Reviewed by: tegge Tested by: bz MFC after: 1 week
* Fix build when WITH_SSP is set explicitly.ru2009-02-218-13/+8
| | | | Submitted by: Jeremie Le Hen
* Enable building of ficl on MIPS. It compiles, but needs more testing.imp2009-02-191-4/+0
|
* Add basic mips support. This has been compile tested only.imp2009-02-192-0/+533
|
* Add a helper function for loading geli keys from the loader.thompsa2009-02-162-1/+50
|
* - Use the generally more appropriate PROM base rather than themarius2009-02-101-4/+4
| | | | | | | | | kernel one as the non-faulting flush address in the loader so we can can change KERNBASE and VM_MIN_KERNEL_ADDRESS if we ever want to without needing to worry about using a compatible loader. - Correctly check for LOADER_DEBUG. - Add a missing const for page_sizes[].
* - Remove superfluous commentgabor2009-01-301-2/+0
| | | | | PR: docs/129400 Submitted by: Gavin Atkinson <gavin@freebsd.org>
* Add an entry for the urtw(4) module.weongyo2009-01-231-0/+1
|
* remove a file which is, as far as I can tell, totally unused.luigi2009-01-131-101/+0
|
* comment out some debugging messages that slipped in by mistake.luigi2009-01-131-4/+3
| | | | MFC after: 3 days
* Allow VIA Nano processors to boot FreeBSD/amd64.jkim2009-01-121-2/+3
| | | | | PR: amd64/130303 MFC after: 1 week
* This patch introduces a number of simplifications to the Forthluigi2009-01-053-511/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions used in the bootloader. The goal is to make the code more readable and smaller (especially because we have size issues in the loader's environment). High level description of the changes: + define some string manipulation functions to improve readability; + create functions to manipulate module descriptors, removing some duplicated code; + rename the error codes to ESOMETHING; + consistently use set_environment_variable (which evaluates $variables) when interpreting variable=value assignments; I have tested the code, but there might be code paths that I have not traversed so please let me know of any issues. Details of this change: --- loader.4th --- + add some module operators, to remove duplicated code while parsing module-related commands: set-module-flag enable-module disable-module toggle-module show-module --- pnp.4th --- + move here the definition related to the pnp devices list, e.g. STAILQ_* , pnpident, pnpinfo --- support.4th --- + rename error codes to capital e.g. ENOMEM EFREE ... and do obvious changes related to the renaming; + remove unused structures (those relevant to pnp are moved to pnp.4th) + various string functions - strlen removed (it is an internal function) - strchr, defined as the C function - strtype -- type a string to output - strref -- assign a reference to the string on the stack - unquote -- remove quotes from a string + remove reset_line_buffer + move up the 'set_environment_variable' function (which now uses the interpreter, so $variables are evaluated). Use the function in various places + add a 'test_file function' for debugging purposes MFC after: 4 weeks
* A number of small changes to make the 'save choice to disk' safer,luigi2008-12-302-28/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and re-enable it as default. In particular: + re-enable the 'update' flag in the Makefile (of course!); + commit Warner's patch "orb $NOUPDATE,_FLAGS(%bp)" to avoid writing to disk in case of a timeout/default choice; + fix an off-by-one count in the partition scan code that would print the wrong name for unknown partitions; + unconditionally change the boot prompt to 'Boot:' instead of 'Default:' to make room for the extra code/checks/messages. Some of the changes listed below are also made to save space; + rearrange and fix comments for known partition types. Right now we explicitly recognise *BSD, Linux, FAT16 (type 6, used on many USB keys), NTFS (type 7), FAT32 (type 11). Depending on other options we also recognise Extended (type 5), FAT12 (type 1) and FAT16 < 32MB (type 4). + Add an entry "F6 PXE" when the code is built with -DPXE (which is a default now). Technically, F6 boots through INT18, so the prompt 'PXE' is a bit misleading. Unfortunately the name INT18 is too long and does not fit in - we could use ROM perhaps. The reason I picked 'PXE' is that on many (I believe) new systems INT18 calls PXE. Apart from the choice of the name for PXE/ROM/INT18, this should close pending issues on the 1-sector boot0 code and we should be able to move the code to RELENG_7 when it reopens. No boot0cfg changes are necessary. MFC after: 3 weeks
* MFH @ 186335sam2008-12-207-24/+21
|\
| * Use full 64bit arithmetic when converting file offsets to block numbers - fixesdfr2008-12-173-11/+6
| | | | | | | | | | | | booting on filesystems with inode numbers with values above 4194304. Submitted by: ps
| * Improve style(9) in PowerPC U-Boot support lib.raj2008-12-173-12/+14
| |
| * Disconnect the efi from pc98. It's not needed.nyan2008-12-141-1/+1
| |
* | add delays around 16-bit enable/disable a la the driver; w/o thissam2008-12-191-0/+2
| | | | | | | | operation on my ixp435 Cambria board is unreliable
* | merge WIP multi-board support; tested on Avila and Cambria, stillsam2008-12-134-75/+154
|/ | | | needs Proghorn testing
* Fix a leak introduced in r185902. We should free the devspec ifps2008-12-111-0/+1
| | | | we've successfully found a zfs pool.
* Avoid a double free in devopen by not freeing the device structureps2008-12-111-1/+0
| | | | | in zfs_dev_open. This stops a panic in the loader when trying to read from a zfs device and no zfs devices exist.
* Don't get confused if we encounter a device which is part of a raidz or raidz2dfr2008-12-101-2/+4
| | | | | | | pool while probing for vdevs. PR: 129539 Submitted by: Paul Wootton (paul at fletchermoorland dot co dot uk)
* Remove now unused label.sobomax2008-12-091-1/+1
| | | | | | Submitted by: Christoph Mallon MFC after: 4 weeks (along with r185779 and r185780)
* Optimiza assembly in the previous r185779, to save whooping 16 bytes.sobomax2008-12-081-9/+5
| | | | | | Submitted by: Christoph Mallon MFC after: 4 weeks (including r185779)
* Respect RBX_MUTE flag from boot[012].sobomax2008-12-081-1/+18
| | | | MFC after: 4 weeks
* Fix typo in the comment %is -> %si.sobomax2008-12-081-1/+1
|
* PROBLEM: putting in a loader config file a line of the formluigi2008-12-071-26/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loader_conf_files="foo bar baz" should cause loading the files listed, and then resume with the remaining config files (from previous values of the variable). Unfortunately, sometimes the line was ignored -- actually even modifying the line in /boot/default/loader.conf sometimes doesn't work. ANALYSIS: After much investigation, turned out to be a bug in the logic. The existing code detected a new assignment by looking at the address of the the variable containing the string. This only worked by pure chance, i.e. if the new string is longer than the previous value then the memory allocator may return a different address to store the string hence triggering the detection. SOLUTION: This commit contains a minimal change to fix the problem, without altering too much the existing structure of the code. However, as a step towards improving the quality and reliability of this code, I have introduced a handful of one-line functions (strget, strset, strfree, string= ) that could be used in dozens of places in the existing code. HOWEVER: There is a much bigger problem here. Even though I am no Forth expert (as most fellow src committers) I can tell that much of the forth code (in support.4th at least) is in severe need of a review/refactoring: + pieces of code are replicated multiple times instead of writing functions (see e.g. set_module_*); + a lot of stale code (e.g. "structure" definitions for preloaded_files, kernel_module, pnp stuff) which is not used or at least belongs elsewhere. The code bload is extremely bad as the loader runs with very small memory constraints, and we already hit the limit once (see http://svn.freebsd.org/viewvc/base?view=revision&revision=185132 Reducing the footprint of the forth files is critical. + two different styles of coding, one using pure stack functions (maybe beautiful but surely highly unreadable), one using high level mechanisms to give names to arguments and local variables (which leads to readable code). Note that this code is used by default by all FreeBSD installations, so the fragility and the code bloat are extremely damaging. I will try to work fixing the three items above, but if others have time, please have a look at these issues. MFC after: 4 weeks
* Correct include path for i386 specific includes. This allows zfsps2008-12-061-1/+1
| | | | to boot on systems where the loader is built on amd64 systems.
* - correct variable namedanger2008-12-061-1/+1
| | | | | | PR: docs/129448 Submitted by: Kenyon Ralph <kralph@gmail.com> MFC after: Revision 1.91 is merged
* Another, hopefully final set of changes to boot0 and boot0cfg.luigi2008-12-032-61/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boot0.S changes: + import a patch from Christoph Mallon to rearrange the various print functions and save another couple of bytes; + implement the suggestion in PR 70531 to enable booting from any valid partition because even the extended partitions that were previously in our kill list may contain a valid boot loader. This simplifies the code and saves some bytes; + followwing up PR 127764, implement conditional code to preserve the 'Volume ID' which might be used by other OS (NT, XP, Vista) and is located at offset 0x1b8. This requires a relocation of the parameter block within the boot sector -- there is no other possible workaround. To address this, boot0cfg has been updated to handle both versions of the boot code; + slightly rearrange the strings printed in the menus to make the code buildable with all options. Given the tight memory budget, this means that with certain options we need to shrink or remove certain labels. and especially: make -DVOLUME_LABEL -DPXE the default options. This means that the newly built boot0 block will preserve the Volume ID, and has the (hidden) option F6 to boot from INT18/PXE. I think the extra functionality is well worth the change. The most visible difference here is that the 'Default: ' string now becomes 'Boot: ' (it can be reverted to the old value but then we need to nuke 1/2 partition name or entries to make up for the extra room). boot0cfg changes: + modify the code to recognise the new boot0 structure (with the relocated options block to make room for the Volume id). + add two options, '-i xxxx-xxxx' to set the volume ID, -e c to modify the character printed in case of bad input PR: 127764 70531 Submitted by: Christoph Mallon (portions) MFC after: 4 weeks
* This commits brings in a lot of documentation and some enhancementluigi2008-12-022-248/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the boot0.S code, with a number of compile-time selectable options, the most interesting one being the ability to select PXE booting. The code is completely compatible with the previous one, and with the boot0cfg program. Even the actual code is largely unmodified, with only minor rearrangements or fixes to make room for the new features. The behaviour of the standard build differs from the previous version in the following, minor things: + 'noupdate' is the default, which means the code does not write back the selection to disk. You can enable the feature at runtime with boot0cfg, or changing the flags in the Makefile. + a drive number of 0x00 (floppy, or USB in floppy emulation) is now accepted as valid. Previously, it was overridden with 0x80, meaning that the partition table coming from the media was used to access sectors on a possibly different media. You can revert to the previous mode building with -DCHECK_DRIVE, and you can always use the 'setdrv' option in boot0cfg + certain FAT or NTFS partitions are listed as WIN instead of DOS. + the 'bel' character on a bad selection is replaced by a '#' to make it clear that the system is not hang even if the machine does not have a speaker. This can be reverted back at compile time, or at runtime with an upcoming boot0cfg option. Additional features are available as compile time options, and may be become the default if deemed useful. In particular: + INT18/PXE boot (make -DPXE) This option enables booting through INT 18h (which on certain BIOSes can be hooked to PXE) by pressing F6. There is unfortunately no room to print the additional menu option. Also, to make room for the code, the 'Default: ' string is changed to 'Boot: ' + print current drive number (make -DTEST) Prints a line indicating the current drive number. This is useful to figure out what is going on for machines/bioses which remap drives in sometimes surprising ways. + disable numeric keys in console mode (make -DONLY_F_KEYS) Not really a significant option, but it is needed to make room for the -DTEST mode. + disable floppy support (make -DCHECK_DRIVE) Revert to the old behaviour of only accepting 0x80 and above as valid drive numbers. MFC after: 6 weeks
* Let ARM loader(8) build with the man page.raj2008-11-271-4/+3
|
* Fix a typo in previous commit: must call "putn" to print a crlf,luigi2008-11-261-1/+1
| | | | | | | | | | instead of "puts" which prints whatever is at %si, followed by a CRLF. It was not noticed during tests because at that point %si points to a partition entry whose first byte is 0x80, which is both a terminator for the string and a non printable character. Submitted by: Christoph Mallon
* Pass the pointer to the selected partition in %si to the next stageluigi2008-11-261-2/+3
| | | | | | | | | | | | | | | boot code. The bug was introduced in rev.1.13, and went unnoticed because FreeBSD's boot1 does not use it, but other systems might. (I have been struggling for almost a full day trying to figure out why a syslinux'ed partition would not boot when started with the FreeBSD /boot/boot0, only to realize that the bug was ours!) The space for the two extra bytes (push %si and pop %si) is reclaimed by removing an extra CRLF that is printed before booting. The bug is not a major one but if there is time it might be a good thing to merge it into the upcoming releases.
* Fix amd64 build and re-enable gptzfsboot.dfr2008-11-223-6/+16
|
* Disconnect gptzfsboot from the build until dfr@ gets his act together.des2008-11-211-1/+1
|
* As reported in kern/118222, pxeboot in RELENG7 (and presumablyluigi2008-11-201-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | above) exhibits some misbehaviours on machines with AMD64 CPUs, which at least in some cases I have tracked down to a heap overflow. It is unclear whether it depends on the CPU or on the pxe bios itself which may use more memory on AMD machines. Noticeably a pxeboot compiled from 6.x sources works fine on all machines I have tried so far, while a pxeboot compiled from 7.x sources does not. This patch is a first step in reducing the amount of memory used while processing the configuration files read by the loader at boot (some of them are quite large, 1700+ lines), and it does so by: + moving a buffer to static memory instead of allocating in the heap; + skipping empty lines; + reducing the amount of memory used for line descriptors; Unfortunately there are several changes between 6.x and above, affecting the compiler, the loader code itself, and libstand, and it is not so straightforward to These changes fix the behaviour on one motherboard with a single-core AMD cpu, but are still not enough e.g on an Asus M2N-VM (with a dual-core CPU). I need to investigate the problem a bit more before figuring out what should be committed to RELENG_7 PR: kern/118222
* Initial storage functionality for U-Boot support library.raj2008-11-199-90/+428
| | | | | | | | - Only non-sliced bsdlabel style partitioning is currently supported (but provisions are made towards GPT support, which should follow soon) - Enable storage support in loader on ARM Obtained from: Semihalf
* Some zfsboot fixes from Norikatsu Shigemura:dfr2008-11-191-2/+3
| | | | | | | | 1. zfsboot2 (boot2) doesn't %d (printf), so change %d to %u. 2. chase new zpool versioning as SPA_VERSION. Obtained from: sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Submitted by: nork
* Add a GPT-aware variant of zfsboot which should be used in a similar mannerdfr2008-11-194-5/+188
| | | | | | | | to gptboot, i.e. installed in a freebsd-boot partition using /sbin/gpart or /sbin/gpt. Tweak the /boot/loader ZFS support so that it can find ZFS pools that are contained in GPT partitions.
* If we free the GPT partition list in bd_open_gpt() because of an error, don'tdfr2008-11-191-2/+4
| | | | try to free it again in bd_closedisk(). While I'm here, fix a DEBUG print.
* Fix building without ZFS (can't find library)ache2008-11-181-0/+2
|
* Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.pjd2008-11-1714-15/+3512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris
* Add ale(4), a driver for Atheros AR8121/AR8113/AR8114 PCIe ethernetyongari2008-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | controller. The controller is also known as L1E(AR8121) and L2E(AR8113/AR8114). Unlike its predecessor Attansic L1, AR8121/AR8113/AR8114 uses completely different Rx logic such that it requires separate driver. Datasheet for AR81xx is not available to open source driver writers but it shares large part of Tx and PHY logic of L1. I still don't understand some part of register meaning and some MAC statistics counters but the driver seems to have no critical issues for performance and stability. The AR81xx requires copy operation to pass received frames to upper stack such that ale(4) consumes a lot of CPU cycles than that of other controller. A couple of silicon bugs also adds more CPU cycles to address the known hardware bug. However, if you have fast CPU you can still saturate the link. Currently ale(4) supports the following hardware features. - MSI. - TCP Segmentation offload. - Hardware VLAN tag insertion/stripping with checksum offload. - Tx TCP/UDP checksum offload and Rx IP/TCP/UDP checksum offload. - Tx/Rx interrupt moderation. - Hardware statistics counters. - Jumbo frame. - WOL. AR81xx PCIe ethernet controllers are mainly found on ASUS EeePC or P5Q series of ASUS motherboards. Special thanks to Jeremy Chadwick who sent the hardware to me. Without his donation writing a driver for AR81xx would never have been possible. Big thanks to all people who reported feedback or tested patches. HW donated by: koitsu Tested by: bsam, Joao Barros <joao.barros <> gmail DOT com > Jan Henrik Sylvester <me <> janh DOT de > Ivan Brawley < ivan <> brawley DOT id DOT au >, CURRENT ML
* Modify our boot block to pick an output device, without which boot1 will failnwhitehorn2008-10-312-0/+5
| | | | | | on G4 machines. On the assumption that most people using FreeBSD on Apple hardware are not using serial consoles, set boot1's output to screen. This should be revisited. While here, reduce verbosity of boot1.
* Initial support of loader(8) for ARM machines running U-Boot.raj2008-10-1412-6/+436
| | | | | | | | | | This uses the common U-Boot support lib (sys/boot/uboot, already used on FreeBSD/powerpc), and assumes the underlying firmware has the modern API for stand-alone apps enabled in the config (CONFIG_API). Only netbooting is supported at the moment. Obtained from: Marvell, Semihalf
* Add a simple HFS boot block implementation for booting PowerPC macs. It createsnwhitehorn2008-10-147-1/+906
| | | | | | | a small HFS filesystem with a CHRP boot script and an early-stage bootloader derived from the sparc64 boot block. Obtained from: sparc64
* Don't close OF disk devices on PowerPC. This fixes loader when booting fromnwhitehorn2008-10-131-0/+2
| | | | disk on my Blue & White G3 system.
* More diff reductions against ixp425/boot2/boot2.c. This time, weimp2008-10-071-0/+87
| | | | | | | | | | | | bring in FIXUP_BOOT_DRV functionality as an #ifdef. This is not enabled at this time, and the md5 remains constant with this change. Apart from the 'accept any partitioning scheme on the device' changes, this was the biggest delta... # and yes, we'll merge these into one source file if we can do that in a # way that makes sense. Obtained from: sys/boot/arm/ixp425/boot2/boot2.c
* Diff reduction with boot/arm/at91/boot2/boot2.c: indent this statementimp2008-10-071-1/+1
| | | | correctly.
OpenPOWER on IntegriCloud