aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/common/bootstrap.h
Commit message (Collapse)AuthorAgeFilesLines
* MFC r241299: boot/console: handle consoles that fail to probeAndriy Gapon2012-11-041-4/+4
| | | | Notes: svn path=/stable/8/; revision=242558
* MFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessingAndriy Gapon2012-06-291-0/+3
| | | | | | | filesystems within a pool Notes: svn path=/stable/8/; revision=237765
* MFC r235153: sys/boot: add common CTASSERT definitionAndriy Gapon2012-06-291-0/+6
| | | | Notes: svn path=/stable/8/; revision=237754
* MFC: r234789Marius Strobl2012-05-251-0/+5
| | | | | | | | | | Add multiple inclusion protection. PR: 165025 Submitted by: Gavin Mu Notes: svn path=/stable/8/; revision=235996
* MFC rev 201941:Marcel Moolenaar2010-01-161-0/+1
| | | | | | | | | | Remove file system support based on the simple file system protocol. MFC rev 201966: Remove debugging printf(). Notes: svn path=/stable/8/; revision=202430
* Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.Pawel Jakub Dawidek2008-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=185029
* Add __elfN(relocation_offset). It holds the offset between the virtualMarcel Moolenaar2008-02-231-1/+3
| | | | | | | | | | | | | (link) address and the physical (load) address. Ideally, the mapping between link and load addresses should be abstracted by the copyin(), copyout() and readin() functions, so that we don't have to add kluges in __elfN(loadimage)(). Then, we could also have paged virtual memory for the kernel. This can be important under EFI, where you need to allocate physical memory form the firmware if you want to work in all scenarios. Notes: svn path=/head/; revision=176484
* add an interface for passing the entire kernel size up front to theKip Macy2006-12-181-0/+2
| | | | | | | | loader so that it can memory can be allocated aligned at the beginning of the desired large page Notes: svn path=/head/; revision=165325
* Extend struct devdesc with a unit field, called d_unit. Promote theMarcel Moolenaar2006-11-021-0/+1
| | | | | | | | | | | | device (kind) specific unit field to the common field. This change allows a future version of libefi to work without requiring anything more than what is defined in struct devdesc and as such makes it possible to compile said version of libefi for different platforms without requiring that those platforms have identical derivatives of struct devdesc. Notes: svn path=/head/; revision=163897
* Make our ELF64 type definitions match standards. In particular thisMarcel Moolenaar2005-12-181-1/+1
| | | | | | | | | | | | | | | | means: o Remove Elf64_Quarter, o Redefine Elf64_Half to be 16-bit, o Redefine Elf64_Word to be 32-bit, o Add Elf64_Xword and Elf64_Sxword for 64-bit entities, o Use Elf_Size in MI code to abstract the difference between Elf32_Word and Elf64_Word. o Add Elf_Ssize as the signed counterpart of Elf_Size. MFC after: 2 weeks Notes: svn path=/head/; revision=153504
* Add the loader side of support for preloading ELF relocatable objectIan Dowse2004-08-291-0/+2
| | | | | | | | | | | | | format modules, which are currently only used on the amd64 platform. This initial implementation just parses enough of the module to allow it to extract dependencies and load all the bits into the right place in memory, so the kernel must still do the full relocation and linking. The details of the loaded sections are passed to the kernel by supplying a copy of the ELF section header table as module metadata with the MODINFOMD_SHDR tag. Notes: svn path=/head/; revision=134459
* Separate out the ELF relocation code from the ELF loader, and addIan Dowse2004-08-281-0/+10
| | | | | | | | | | | | better relocation support for the amd64 and i386 platforms. This should not result in any change in functionality, but moves a step towards supporting the relocatable object file modules on amd64. The same hack/trick as load_elf*.c uses is used here to simultaneously support both elf32 and elf64 on amd64 and i386. Notes: svn path=/head/; revision=134458
* Add a few helper functions for zeroing kernel space and readingIan Dowse2004-08-281-0/+3
| | | | | | | from specified file offsets. Make use of these in load_elf.c. Notes: svn path=/head/; revision=134441
* Enable the i386 loader to load and run an amd64 kernel. If this putsPeter Wemm2003-05-011-2/+4
| | | | | | | | | | | | | | | | | | things over floppy size limits, I can exclude it for release builds or something like that. Most of the changes are to get the load_elf.c file into a seperate elf32_ or elf64_ namespace so that you can have two ELF loaders present at once. Note that for 64 bit kernels, it actually starts up the kernel already in 64 bit mode with paging enabled. This is really easy because we have a known minimum feature set. Of note is that for amd64, we have to pass in the bios int 15 0xe821 memory map because once in long mode, you absolutely cannot make VM86 calls. amd64 does not use 'struct bootinfo' at all. It is a pure loader metadata startup, just like sparc64 and powerpc. Much of the infrastructure to support this was adapted from sparc64. Notes: svn path=/head/; revision=114379
* Zap some a.out leftoversPeter Wemm2003-04-061-3/+0
| | | | Notes: svn path=/head/; revision=113161
* CG superfluous prototype.Maxim Sobolev2002-03-101-1/+0
| | | | Notes: svn path=/head/; revision=92030
* Declare time(not3) instead of depending on namespace pollution 3 layersBruce Evans2002-02-251-0/+2
| | | | | | | | | | | | | | | | deep in <stand.h> to eventually include <time.h> to declare the user version. This is not quite the right place to declare it, but <stand.h> would be worse because time() is very MD so it isn't in libstand. Many places in the boot sources still get the user version using only 1 layer of pollution (#include <sys/time.h>. Some pollute themselves directly (#include <time.h>). But the boot Makefiles are too broken to enable warnings for redeclarations. Notes: svn path=/head/; revision=91219
* Add a DEVT_CD type for CD drivers.John Baldwin2001-11-051-0/+1
| | | | Notes: svn path=/head/; revision=86090
* Implement the long-awaited module->file cache database. A userlandPeter Wemm2001-09-111-2/+5
| | | | | | | | | | tool (kldxref(8)) keeps a cache of what modules and versions are inside what .ko files. I have tested this on both Alpha and i386. Submitted by: bp Notes: svn path=/head/; revision=83321
* Nuke old gensetdefs based linker sets with extreme prejudicePeter Wemm2001-06-141-45/+2
| | | | Notes: svn path=/head/; revision=78195
* Make the pnp structure a global variable, so it can be used elsewhere.Daniel C. Sobral2000-09-081-0/+4
| | | | Notes: svn path=/head/; revision=65614
* Cleanup warnings. Most of these are signed/unsigned warnings, as well asJohn Baldwin2000-08-031-44/+48
| | | | | | | some added const's. Notes: svn path=/head/; revision=64187
* Delay calling the device cleanup routines until the absolute lastPaul Saab2000-06-141-0/+2
| | | | | | | | | moment. We were cleaning up after PXE too early and the module dependancy code would not be able to load any files if it needed too. Notes: svn path=/head/; revision=61659
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-3/+3
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-3/+3
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Update loader logic to distinguish modules vs. files.Boris Popov2000-05-011-27/+44
| | | | | | | | | | Add support for module metadata. The old way of dependancy handling will be supported for a while. Reviewed by: peter Notes: svn path=/head/; revision=59854
* bcache_strategy() now receives an unit number, and keep track of whatDaniel C. Sobral2000-03-151-0/+1
| | | | | | | | | | | | | was the last unit number received. If it changes, it flushes the cache. Add bcache_flash(). The actual fix is sligthly different from the one in the PR. PR: 17098 Submitted by: John Hood <jhood@sitaranetworks.com> Notes: svn path=/head/; revision=58080
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Walk around the end of all the silly guessing of device types and unitMike Smith1999-07-211-1/+2
| | | | | | | | | | numbers that we have been doing in the past, and read /etc/fstab off the proposed root filesystem to determine the actual device name and vfs type for the root filesystem. These are then exported to the kernel via the environment variable vfs.root.mountfrom. Notes: svn path=/head/; revision=48952
* ABS_SET() and BSS_SET() are no longer used. The sole remaining user ofPeter Wemm1999-06-261-4/+1
| | | | | | | TEXT_SET() is DDB's command tables. Notes: svn path=/head/; revision=48243
* Bring the 'new-bus' to the i386. This extensively changes the way thePeter Wemm1999-04-161-3/+3
| | | | | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core Notes: svn path=/head/; revision=45720
* Make use of prototypes to silence warnings.Daniel C. Sobral1999-02-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | Change include() so it will be able to load files with forth code, instead of just builtins. Remove #@- from the include section of the help file, since they don't work in the new version of include, unless BOOT_FORTH is not defined. Change bf_run() so it will return the result returned by ficlExec(). Also, make bf_run() push "interpret" to be executed by ficlExec(), since ficlExec() doesn't do it by itself. (Things worked previously because nothing recursed through ficlExec() by the way of bf_run()). Change/extend comments on builtin behavior. Search for "interpret" at the end of bf_init(), so /boot/boot.4th can provide it's own version. Remove dead code. Notes: svn path=/head/; revision=43614
* bootstrap.hMike Smith1999-01-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | help.common interp.c Rename the 'source' command to 'include' in order to avoid conflict with the ANS Forth command of the same name. (kern/9473) interp_forth.c: Changes from kern/9412 (EXCEPTION word), kern/9442 (TIB buffer sizing) and an improved version of kern/9460 (set version numbers). load_aout.c: Trim some obsolete #if 0'ed cruft. pnp.c: Tidy the pnpscan output, turn off the module scanning until we sort out how to do it right. PR: kern/9412 kern/9442 kern/9460 kern/9473 Submitted by: PRs from Daniel Sobral <dcs@newsguy.com> Notes: svn path=/head/; revision=43077
* Replace duplicated "old" linker set definitions with an include ofJohn Polstra1999-01-161-52/+2
| | | | | | | <sys/linker_set.h>. Note, this isn't used on the i386. Notes: svn path=/head/; revision=42713
* Fall back to /boot/boot.conf, if /boot/loader.rc was not fount. This isAndrzej Bialecki1999-01-151-2/+2
| | | | | | | | | to cover the transition period. Suggested by: msmith Notes: svn path=/head/; revision=42682
* Implement a simple LRU block cache. By default this is initialised to 16k,Mike Smith1998-11-021-1/+10
| | | | | | | | | | | | | | | | | and will bypass transfers for more than 8k. Blocks are invalidated after 2 seconds, so removable media should not confuse the cache. The 8k threshold is a compromise; all UFS transfers performed by libstand are 8k or less, so large file reads thrash the cache. However many filesystem metadata operations are also performed using 8k blocks, so using a lower threshold gives poor performance. Those of you with an eye for cache algorithms are welcome to tell me how badly this one sucks; you can start with the 'bcachestats' command which will print the contents of the cache and access statistics. Notes: svn path=/head/; revision=40834
* Export an interface for presetting the ISA PnP read port address.Mike Smith1998-10-221-1/+9
| | | | | | | Make the EISA ID formatter generally available Notes: svn path=/head/; revision=40597
* Make ISA PnP work. This successfully enumerates as many ISA devices as IMike Smith1998-10-211-16/+65
| | | | | | | | | | | | | | | can fit into my test machine. - Move to using STAILQs rather than ad-hoc singly-linked lists. - Use a mostly procedural interface to the PnP information. This improves data-hiding. Implement a new linker-set technique (currently on i386 only but should work on Alpha as well). This is a good candidate for replacing the current gensetdefs cruft completely. Notes: svn path=/head/; revision=40553
* loader <-> kernel preload module interface constants moved to common file.Peter Wemm1998-10-091-53/+1
| | | | | | | | | Remove Mike's explicit data structures for dependency info. This is done via DT_NEEDED etc in the dynamic section for now. This may need to be revisited later on. Notes: svn path=/head/; revision=40140
* Sync the MODINFO constants with <sys/linker.h>Mike Smith1998-10-091-5/+6
| | | | | | | | | Remove debugging in command_read(). Correctly strip leading controls on script commands. Make 'ls' more DWIM in regard to pathnames. We can still do better. Notes: svn path=/head/; revision=40106
* - VERBOSE_LS is obsolete, as the heap is much better behaved now.Mike Smith1998-10-071-1/+2
| | | | | | | | | | | | | | | | | | - Don't whine about nodes we can't stat(); these are usually symlinks that lead out of the filesystem. - Autoboot is now controlled by $autoboot_delay, which is a value in seconds or NO to disable autoboot. - Don't autoboot at the end of boot.conf if we have already tried. - Add a 'read' command to complement 'echo'. Both are still hidden. - Improve the 'source' command/function so that it is possible to source scripts off removable media. The entire script is read and saved before beginning execution. Script lines beginning with '@' will not be echoed when being executed. Script execution will normally terminate at the first error, however if the script line begins with '-' this behaviour is overriden for that command. Notes: svn path=/head/; revision=40015
* First shot at loading elf symbols. Things are a bit strange becausePeter Wemm1998-10-021-1/+3
| | | | | | | | | | | | | | | of the ..umm.. "wierd" way binutils lays out the file. The section headers are nearly at the end of the file and this is a problem when loading from a .gz file which can't seek backwards (or has a limited reverse seek, ~2K from memory). This is intended to be compatable with the ddb/db_elf.c code and the alpha/libalpha/elf_freebsd.c layout. I've studied these (which are NetBSD derived) but did it a bit differently. Naturally the process is similar since it's supposed to end up with the same result. Notes: svn path=/head/; revision=39887
* Uncomment prototype for elf_loadmodulePeter Wemm1998-09-301-2/+2
| | | | Notes: svn path=/head/; revision=39827
* * Add old UFS compatibility code to alpha/boot1.Doug Rabson1998-09-261-2/+3
| | | | | | | | | * Fix a raft of warnings, printf and otherwise. * Allocate the correct amount in mod_searchmodule to prevent an overflow. * Fix the makefiles so they work outside my home directory (oops). Notes: svn path=/head/; revision=39673
* Make the alpha bootstrap build again, fix some warning and change sdboot to ↵Doug Rabson1998-09-201-1/+2
| | | | | | | daboot. Notes: svn path=/head/; revision=39530
* Add a generic hexdump tool for debugging purposes.Mike Smith1998-09-191-1/+2
| | | | Notes: svn path=/head/; revision=39472
* Resynch with working sources before BTX integration.Mike Smith1998-09-141-15/+38
| | | | | | | | | | | | | | - Use format-independant module allocator. - Conditionalise ISA PnP support. - Simplify PnP enumerator interface. - Improve module/object searching. - Add missing depend/install targets in BTX makefiles. - Pass the kernel environment and module data in extended bootinfo fields. - Add a pointer to the end of the kernel + modules in bootinfo. - Fix parsing of old-style kernel arguments. Notes: svn path=/head/; revision=39178
* Generic plug-and-play enumerator infrastructure. Query suppliedMike Smith1998-09-041-1/+24
| | | | | | | | enumerators, crossreference returned identifiers with a text-format database and automatically load corresponding modules and dependancies. Notes: svn path=/head/; revision=38789
* Bootstrap updates.Mike Smith1998-09-031-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move some startup code from MD to MI sections - Add a 'copyout' and some copyout-related functions. These will be obsoleted when BTX is available for the 386 and the kernel load area becomes directly addressable. - Add the ability load an arbitrary file as a module, associating and arbitrary type string with it. This can be used eg. for loading splash-screen images etc. - Add KLD module dependancy infrastructure. We know how to look for dependancies inside KLD modules, how to resolve these dependancies and what to do if things go wrong. Only works for a.out at the moment, due to lack of an MI ELF loader. Attach KLD module information to loaded modules as metadata, but don't pass it to the kernel (it can find it itself). - Load a.out KLD modules on a page boundary. Only pad the a.out BSS for the kernel, as it may want to throw symbols away. (We might want to do this for KLD modules too.) - Allow commands to be hidden from the '?' display, to avoid cluttering it with things like 'echo'. Add 'echo'. - Bring the 'prompt' command into line with the parser syntax. - Fix the verbose 'ls'; it was using an uninitialised stack variable. - Add a '-v' flag to 'lsmod' to have it display module metadata as well (not terribly useful for the average user) - Support a 'module searchpath' for required modules. - The bootstrap file on i386 is now called 'loader' to permit the /boot directory to use that name. - Discard the old i386 pread() function, as it's replaced by arch_readin() Notes: svn path=/head/; revision=38764
* Bootloader update.Mike Smith1998-08-311-15/+27
| | | | | | | | | | | | | | | - Implement a new copyin/readin interface for loading modules. This allows the module loaders to become MI, reducing code duplication. - Simplify the search for an image activator for the loaded kernel. - Use the common module management code for all module metadata. - Add an 'unload' command that throws everything away. - Move the a.out module loader to MI code, add support for a.out kld modules. Submitted by: Alpha changes fixed by Doug Rabson <dfr@freebsd.org> Notes: svn path=/head/; revision=38712