Commit Graph

53 Commits

Author SHA1 Message Date
Rafal Jaworowski
845a6f19d2 Improve style(9) in PowerPC U-Boot support lib. 2008-12-17 15:58:07 +00:00
Nathan Whitehorn
4d3800847a Modify our boot block to pick an output device, without which boot1 will fail
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.
2008-10-31 00:52:31 +00:00
Nathan Whitehorn
5f7ec695e9 Add a simple HFS boot block implementation for booting PowerPC macs. It creates
a small HFS filesystem with a CHRP boot script and an early-stage bootloader
derived from the sparc64 boot block.

Obtained from:  sparc64
2008-10-14 03:32:41 +00:00
Rafal Jaworowski
b2b88c5cb4 Use current SP instead of global data ptr for the U-Boot API signature search hint.
Global data (pointed by R2 on PowerPC) in principle is not guaranteed to be in
proximity of U-Boot heap (where the API signature is placed) accross different
architectures and platforms. Instead, use U-Boot stack pointer as a hint for
the search instead of the global data; this method tends to be more uniform
accross different platforms.

Obtained from:	Semihalf
2008-09-03 16:38:27 +00:00
Rafal Jaworowski
51e8f5a470 Make metadata.c shared across all platforms using U-Boot.
This will [soon] be needed for ARM.
2008-09-03 15:52:05 +00:00
Ruslan Ermilov
042df2e2da Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by:	Jeremie Le Hen <jeremie@le-hen.org>
2008-06-25 21:33:28 +00:00
Rafal Jaworowski
7cc9e5030e Improve handling U-Boot's "eth%daddr" while PowerPC metadata preparation.
We're now more robust against cases of non-sorted and/or non-continuous
numbering of those entries.

Reviewed by:	imp, marcel
Approved by:	cognet (mentor)
2008-03-12 16:12:48 +00:00
Marcel Moolenaar
859baed9a9 o Build and install the U-Boot loader as ubldr.
o  Don't build/install the manual pages or configuration
   files that are already installed by the OFW loader.
o  Hook the U-Boot loader to the build.
2008-02-23 19:45:20 +00:00
Marcel Moolenaar
8b4c4c1c72 style(9) commit. 2008-02-23 19:43:29 +00:00
Marcel Moolenaar
3802c8b6da Setup the new bootinfo structure.
While here, make local function static and update copyright.
2008-02-23 19:08:25 +00:00
Marcel Moolenaar
0f5615e325 o Keep running on U-Boot's stack.
o  Disable interrupts while not running U-Boot code. We clobber
   registers that the U-Boot interrupt handlers assume to be
   fixed as per the U-Boot register usage. At this time this only
   applies to r14. U-Boot uses r2 now for what they used r29 for.
   After we restore r14 in preparation of doing the syscall, we
   re-enable interrupts. When we return from the syscall, we
   disable interrupts and restore the callee-saved r14.
2008-02-23 18:42:53 +00:00
Marcel Moolenaar
f673ad04f5 The NFS file system support is conditional upon LOADER_NFS_SUPPORT,
not LOADER_NET_SUPPORT.
2008-02-23 18:36:13 +00:00
Marcel Moolenaar
9a1b62b630 We build ficl and libofw with -msoft-float. Build the loader
with -msoft-float too.
2008-02-23 17:48:23 +00:00
Marcel Moolenaar
a515bae433 Move the $FreeBSD$ tag in a comment as __FBSDID doesn't work. 2008-02-17 20:38:22 +00:00
Marcel Moolenaar
da049ec7a5 MFp4 (e500):
Add support for U-Boot. This uses the U-Boot API as developed by
Rafal and which is (will be) part of U-Boot 1.3.2 and later.

Credits to: raj@
2008-02-16 22:40:55 +00:00
Rafal Jaworowski
77c843cc10 Clean up PowerPC loader(8) build config.
Turn off TFTP support by default: when both TFTP and NFS are enabled in the
loader, strange interactions occur in the pure netbooting scenario (i.e.
loader is TFTP-ed, kernel+world mounted over NFS), leading to very slow access
to the NFS-exported files.

Reviewed by:	grehan
Approved by:	cognet (mentor)
2008-02-11 12:30:32 +00:00
Marcel Moolenaar
ed04c6bea1 "FreeBSD/Open Firmware/PowerPC ..." is confusing and non-standard.
Use "FreeBSD/powerpc Open Firmware ..." instead.
2007-12-26 19:15:58 +00:00
Marcel Moolenaar
6d86273c0a Remove file after being repocopied to ../ofw, where it lives on.
Repocopy by: simon@
2007-12-17 22:50:39 +00:00
Marcel Moolenaar
22f4c5e3d9 Build the OFW loader from its new location after the sources
were repocopied from ./loader to ./ofw.
2007-12-17 22:19:44 +00:00
John Baldwin
be5d6589e0 Remove more Alpha bits from the boot code including fixing several
stale comments.
2006-05-12 04:09:53 +00:00
Ruslan Ermilov
e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
Ruslan Ermilov
4750e08f7b Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:
"boot_dfltroot", "boot_mute", and "boot_pause" respectively.
2005-09-22 15:06:58 +00:00
Warner Losh
6a0fd84b50 Start each of the license/copyright comments with /*- 2005-01-05 22:16:58 +00:00
Ruslan Ermilov
cbbdcac72a NOFORTH -> NO_FORTH 2004-12-21 12:32:15 +00:00
Scott Long
05d0bf79ed Remove the last vestiges of the userconfig option. None of this actually
did anything, so this commit should be considered a NO-OP.
2004-12-01 04:59:33 +00:00
Peter Grehan
523c8e33e4 Remove NOMAN so loader man pages are installed.
Noticed by:	ru
2004-08-18 11:31:00 +00:00
Marius Strobl
39513fa664 Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by:	tmm
2004-08-16 15:45:27 +00:00
Peter Grehan
1f302e5357 Add PowerPC bridge instruction flag to the assembler to help out
with test code written in the loader.
2004-08-02 03:06:21 +00:00
Peter Grehan
744b9a014d Use a linker script for the loader. This avoids issues with
command-line options, such as misaligning the data segment.
Exposed by the limited PearPC OFW ELF loader, but a good thing in
general.
2004-07-08 12:52:35 +00:00
Peter Grehan
79c8d45fce Remove cache flush, 256Mb 1:1 BAT mapping, and BAT clearing. This doesn't
work on a G5 (no BAT registers) or on PearPC (dBAT3 used for mapping
the framebuffer and BATs not re-inited on OpenFirmware calls).

 It also hid a number of bugs.
2004-07-08 06:13:05 +00:00
Peter Grehan
716563e20c Loader makefile cleanup.
Submitted by:  ru
2004-02-09 21:54:54 +00:00
David E. O'Brien
bd506e2a3a Convert to __FBSDID. 2004-01-04 23:21:18 +00:00
Peter Grehan
456ff079c0 Update libstand filesystems to be in-line with tier-1 platforms. 2003-12-10 09:17:01 +00:00
Peter Grehan
7e299a724d - Bring Makefile up to rev with sparc64 in terms of config options and rules
- Move loader relocation up to 0x1C00000. This is in line with OSX bootx,
  and allows more space for boot-time modules/ramdisks without conflicting
  with OpenFirmware's use of RAM
2003-12-10 09:16:22 +00:00
David E. O'Brien
047c5be3e7 FICL doesn't build on PowerPC yet, so disable. 2003-08-16 02:48:20 +00:00
Peter Grehan
c9cbdf3393 Fix asm string newlines to keep gcc3.3 happy. Use register prefixes
to make the asm a bit more readable.
2003-08-05 11:30:18 +00:00
Peter Wemm
145b0eb56d Also look for an "elf64 kernel" (for sparc64) and "elf32 kernel" (for
powerpc) when building metadata.
2003-04-30 22:00:16 +00:00
Jake Burkholder
7c6c018c0c Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c. 2002-12-19 19:34:59 +00:00
Jake Burkholder
de0acbf78f Change the device path representation in libofw to use the full firmware
path, instead of an internal i386 specific one.  Don't try to interpret
a disklabel in ofw_disk.c, open the partition's device node directly and
let the firmware do it.  This fixes booting from a partition other than 'a'
on sparc64, which is needed to support more installation methods.

No objection:	ppc
2002-11-10 19:17:36 +00:00
Benno Rice
631c19755e Add support for passing metadata. 2002-07-10 12:13:16 +00:00
Benno Rice
777d0df628 Uncomment some bits that we now need. 2002-06-07 11:49:56 +00:00
David E. O'Brien
d1bdfb40fd -ffreestanding is the word.
(also resort some CFLAGS such that the more "important" value are first so
they are easier to see)
2002-05-10 09:26:35 +00:00
Benno Rice
cae2c81dc2 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.
2001-10-07 13:22:25 +00:00
Ruslan Ermilov
188cdfac56 Create backup copies using install(1). 2001-09-12 10:25:50 +00:00
Peter Wemm
47f1082c4f Remove -DNEW_LINKERSET, it is not used here anymore. This is now native. 2001-06-21 00:08:23 +00:00
Peter Wemm
44fa54f5f6 Nuke old gensetdefs based linker sets with extreme prejudice 2001-06-14 01:23:57 +00:00
Ruslan Ermilov
aa7664372f MAN[1-9] -> MAN. 2001-03-27 11:59:22 +00:00
Benno Rice
4cc1860f9b OpenFirmware/PowerPC loader, part 2.
As of this patchset, the loader builds (under NetBSD/macppc), boots, interacts
and talks to BOOTP/NFS servers.

(main.c was moved from boot/ofw/libofw to boot/ofw/common but has no revision
 history)

Reviewed by:	obrien
2000-11-10 06:39:58 +00:00
David E. O'Brien
c2606cffec Convert from the Alpha compontents to PowerPC ones. 2000-10-16 19:58:32 +00:00
David E. O'Brien
146a7d5318 "Ok, my loader's now up to putting up a prompt. It probes disks partially
but can't boot from them yet."

Thanks to Stephane Potvin for the some of the code in this set.

Submitted by:	Benno Rice <benno@jeamland.net>
2000-10-16 10:46:22 +00:00