Commit Graph

15 Commits

Author SHA1 Message Date
John Baldwin
0322b80600 Add a device driver for the BIOS device for CD-ROM's booted via El Torito
no emulation mode.  Unlike other BIOS devices, this device uses 2048 byte
sectors.  Also, the bioscd driver does not have to worry about slices
or partitions.
2001-11-05 18:58:33 +00:00
Mike Smith
ad41f9a8f7 Teach the loader how to find the system ACPI information, and autoload
the ACPI module if the system apperars to be ACPI compliant.

This is an initial cut; the load should really be done by Forth support
code, and we should check both the BIOS build date and a blacklist.
2001-08-30 00:42:12 +00:00
John Baldwin
4ae4202e70 Cleanup warnings. Most of these are signed/unsigned warnings, as well as
some added const's.
2000-08-03 09:14:02 +00:00
John Baldwin
48a0c4ea04 Mega i386 loader commit.
- Don't hard code 0x10000 as the entry point for the loader.  Instead add
  src/sys/boot/i386/Makefile.inc which defines a make variable with the
  entry point for the loader.  Move the loader's entry point up to
  0x20000, which makes PXE happy.
- Don't try to use cpp to parse btxldr for the optional BTXLDR_VERBOSE,
  instead use m4 to achieve this.  Also, add a BTXLDR_VERBOSE knob in the
  btxldr Makefile to turn this option on.
- Redo parts of cdldr's Makefile so that it now builds and installs cdboot
  instead of having i386/loader/Makefile do that.  Also, add in some more
  variables to make the pxeldr Makefile almost identical and thus to ease
  maintainability.
- Teach cdldr about the a.out format.  Cdldr now parsers the a.out header
  of the loader binary and relocates it based on that.  The entry point of
  the loader no longer has to be hardcoded into cdldr.  Also, the boot
  info table from mkisofs is no longer required to get a useful cdboot.
- Update the lsdev function for BIOS disks to parse other file systems
  (such as DOS FAT) that we currently support.  This is still buggy as
  it assumes that a floppy with a DOS boot sector actually has a MBR and
  parses it as such.  I'll be fixing this in the future.
- The biggie:  Add in support for booting off of PXE-enabled network
  adapters.  Currently, we use the TFTP API provided by the PXE BIOS.
  Eventually we will switch to using the low-level NIC driver thus
  allowing both TFTP and NFS to be used, but for now it's just TFTP.

Submitted by:	ps, alfred
Testing by:	Benno Rice <benno@netizen.com.au>
2000-03-28 01:19:53 +00:00
Mike Smith
627249c7b1 Substantially revamp the way that we determine the amount of memory available
for our use.  Use the same search order for BIOS memory size functions
as the kernel will later use.

Allow the loader to use all of the detected physical memory (this will
greatly help people trying to load enormous memory disk images).

More correctly handle running out of memory when loading an object.

Use the end of base memory for the top of the heap, rather than
blindly hoping that there is 384k left.

Add copyrights to a couple of files I forgot.
1999-12-29 09:54:46 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Robert Nordier
f841485278 Fill in bi_bios_geom[] in the bootinfo structure passed to the kernel.
This should resolve the problem raised in PR 12315, and incidentally
makes it easier to determine what geometry the BIOS is actually using
(by way of boot -v and dmesg).
1999-06-21 18:27:02 +00:00
Mike Smith
bf72f68088 Consolidate the bootinfo-loading code, greatly simplifying the _exec
functions.
1998-10-02 20:53:17 +00:00
Mike Smith
6b15efd961 aout_freebsd.c
Use bd_getdev() to work out a dev_t for the root device.
	Allow $rootdev to override $currdev as the root device.

biosdisk.c
	Save the slice table and disklabel when opening a disk.
	Add bd_getdev(), which attempts to return a dev_t corresponding
	to a given device.  Cases which it still doesn't get right:
	 - The inevitable da-when-wd-also-exists
	 - Disks with no slice table (the slice number is not set correctly)
	The first is difficult to get right, the second will be
	fixed in an upcoming commit.

comconsole.c
vidconsole.c
	getchar() should return an 8-bit value; some BIOSsen pack extra
	information in %eax.

libi386.h
	Remove some stale prototypes, add new ones.
1998-10-02 16:32:45 +00:00
Doug Rabson
e24168e6c3 * Add old UFS compatibility code to alpha/boot1.
* 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).
1998-09-26 10:51:38 +00:00
Mike Smith
948486abe3 Initial integration of the i386 bootloader and BTX.
- Discard large amounts of BIOS-related code in favour of the more compact
   BTX vm86 interface.
 - Build the loader module as ELF, although the resulting object is a.out,
   make gensetdefs 32/64-bit sensitive and use a single copy of it.
 - Throw away installboot, as it's no longer required.
 - Use direct bcopy operations in the i386_copy module, as BTX
   maps the first 16M of memory.  Check operations against the
   detected size of actual memory.
1998-09-17 23:52:16 +00:00
Mike Smith
0d5d0b20dc Resynch with working sources before BTX integration.
- 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.
1998-09-14 18:27:06 +00:00
Mike Smith
06b57b0e09 Bootstrap updates.
- 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()
1998-09-03 02:10:09 +00:00
Mike Smith
c73b70eec4 Bootloader update.
- 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>
1998-08-31 21:10:43 +00:00
Mike Smith
c2f9d95de5 This is the new unified bootstrap, sometimes known previously as the
'three-stage' bootstrap.
There are a number of caveats with the code in its current state:
 - The i386 bootstrap only supports booting from a floppy.
 - The kernel and kld do not yet know how to deal with the extended
   information and module summary passed in.
 - PnP-based autodetection and demand loading of modules is not implemented.
 - i386 ELF kernel loading is not ready yet.
 - The i386 bootstrap is loaded via an ugly blockmap.

On the alpha, both net- and disk-booting (SRM console machines only) is
supported.  No blockmaps are used by this code.

Obtained from:	Parts from the NetBSD/i386 standalone bootstrap.
1998-08-21 03:17:42 +00:00