History log of /freebsd-9.3-release/sys/boot/ofw/libofw/ofw_copy.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 215438 17-Nov-2010 andreast

Check the real-mode? OF property to find out whether we operate in real or
virtual mode. In virtual mode we have to do memory mapping. On PowerMacs it is
usually false while on pSeries we have found that it is true. The real-mode?
property is not available on sparc64.

Approved by: nwhitehorn (mentor)


# 212165 02-Sep-2010 nwhitehorn

In the case of non-sequential mappings, ofw_mapmem() could ask Open
Firmware to map a memory region with negative length, causing crashes
and Undefined Behavior. Add the appropriate check to make the behavior
defined.


# 148319 22-Jul-2005 grehan

Make code match comment: make the smallest unit of page allocation
from OpenFirmware be 16 pages to avoid fragmentation in the list
of mappings returned when the kernel requests it in pmap_bootstrap.

This allows a static buffer to be used when obtaining the existing
mappings - very useful on the G5 when random physical pages can't
be grabbed because they can't be BAT-mapped.

MFC after: 3 days


# 146368 19-May-2005 grehan

Change ofw_readin/ofw_copyin to map the entire region before
copying, rather than a page at a time. This was creating far
too many single-page mappings, and eventually OFW overflowed
some internal data structure and refused to map any more.
The new algorithm creates far less mappings and fixed a bug
where multiple mappings for the same page would be created.

'Twas known this was a problem, but only became urgent when the
install CD's mfs_root grew large enough to cause the overflow.


# 131782 08-Jul-2004 grehan

Correctly calculate size of memory to be mapped when copying. Removal
of the 256Mb 1:1 BAT mapping exposed this as copying into memory that
hadn't been claimed from OpenFirmware.

compiled-tested on: panther (sparc64). Code built, but not used, on sparc64


# 124140 04-Jan-2004 obrien

Convert to __FBSDID.


# 123701 21-Dec-2003 grehan

Only print out an error if returned data size is < 0. A value of 0
happens almost every time at the end of a file when using NFS.

No objection by: sparc64


# 100318 18-Jul-2002 benno

Major rework of how we copy data into kernel space.

We now talk to the memory and mmu instances directly rather than using the
OpenFirmware "claim" method.


# 84620 07-Oct-2001 benno

Whitespace fixes.


# 84617 07-Oct-2001 benno

Mega-patch for OpenFirmware loader support.

- Flesh out ofw_readin routine.
- Add OpenFirmware load and exec routines.
- Make sure memory allocation for the kernel is done correctly.
- Change the way the heap is allocated so as to make it easier to deallocate
when we hand over.
- Add a command to print memory maps similar to the one for ia64.

With this patch, I can now load and hand over to a kernel on my iMac. There
are some problems with OpenFirmware routines failing after the hand over that
still need to be addressed.


# 67228 16-Oct-2000 obrien

The PowerPC conversion was

Submitted by: Benno Rice <benno@jeamland.net>


# 67227 16-Oct-2000 obrien

Convert from the Alpha compontents to PowerPC ones.


# 67226 16-Oct-2000 obrien

Repo copied from src/sys/boot/alpha/libalpha/alpha_module.c,v


# 64188 03-Aug-2000 jhb

Fix the more obvious warnings to deal with my earlier warning cleanups.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 39530 20-Sep-1998 dfr

Make the alpha bootstrap build again, fix some warning and change sdboot to daboot.


# 38764 03-Sep-1998 msmith

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()


# 38712 31-Aug-1998 msmith

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>