Commit Graph

1316 Commits

Author SHA1 Message Date
phk
6f7830c860 Unbreak boot2 by backing out rev 1.36 to Makefile, which does not
work as advertised:

	bang# pwd
	/bang/src/sys/boot/i386/boot2
	bang# make clean >& /dev/null
	bang# cvs -q update -r 1.35 Makefile >& /dev/null
	bang# make >& /dev/null
	bang# cat /usr/obj/`pwd`/boot2.h
	#define XREADORG 0x725
	bang# cvs -q update -r 1.36 Makefile > & /dev/null
	bang# make clean > & /dev/null
	bang# make > & /dev/null
	bang# cat /usr/obj/`pwd`/boot2.h
	#define XREADORG 0x25
	bang#
2002-10-08 07:52:28 +00:00
phk
24fb0bb017 Save four bytes by shortening a string two chars.
Sponsored by:	DARPA & NAI Labs.
2002-10-08 07:06:24 +00:00
green
6c65d531e9 Correct a bug in adding 0x700 to a number. 2002-10-07 22:21:16 +00:00
phk
881f1b527c Conditionalize the number of sectors loaded by boot1.s on UFS1/UFS12.
Conditionalize the "XX bytes left" checks reference on UFS1/UFS12.

Conditionally build the necessary 64bit math for boot2 if UFS12.

Sponsored by:	DARPA & NAI Labs.
2002-10-07 21:36:06 +00:00
phk
6cc4e6467c Change the comment character from # to // in boot1.s and run
it through CPP so we can conditionalized things.

Sponsored by:	DARPA & NAI Labs
2002-10-07 20:56:09 +00:00
phk
6bb1507f12 Correctly adjust for moved start address.
It seems that the existence of a "depend" target in src/sys/boot is not
to be taken as an indication that it actually does what one would expect,
at least it clearly threw my testing off.

Apologies to:	jhb
2002-10-07 19:12:36 +00:00
nyan
9cbd64aa06 Added '#include <sys/diskpc98.h>'.
Submitted by:	kawanobe@st.rim.or.jp (Kawanobe Koh)
2002-10-07 15:26:10 +00:00
phk
87986ee87a Correctly compensate for both offset and unoffset on-disk BSD disklabels.
Sponsored by:	DARPA & NAI Labs.
2002-10-07 13:11:28 +00:00
phk
1270e840d8 Move MEM_USR a page upwards to make space for larger UFS1 boot2.
Load 4 sectors more than we used to.  This is harmless overhead for
the UFS1_ONLY case, but sufficient for boot2(UFS1+2).

Sponsored by:	DARPA & NAI Labs
2002-10-07 12:15:11 +00:00
phk
163bc4d166 Ups, forgot to tell cvs commit about this file.
Move UFS1_ONLY to Makefiles instead of common/ufsread.c

Sponsored by:	DARPA & NAI Labs
2002-10-07 08:14:10 +00:00
phk
c91ffdd939 Move the definition of UFS1_ONLY into the Makefiles where it belongs.
Sponsored by:	DARPA & NAI Labs.
2002-10-07 08:09:20 +00:00
nyan
e9daa69b52 Connected boot2. 2002-10-03 16:21:40 +00:00
nyan
15190a2228 Added some header files from -stable and fixed the boot[12] programs. 2002-10-03 16:20:14 +00:00
iwasaki
f42743371e Don't call INT 12H anymore in boot program.
Many recent machine have a broken INT 12H (Get base memory size)
implementation and boot program stops if INT 12H is called.

This commit should solve the problem at very first step of FreeBSD
installation occurred on newer some machines.

Reviewed by:	bde, jhb
MFC after:	1 week
2002-10-01 19:31:09 +00:00
phk
19150ba4f8 Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:
Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h.

These two new copies are still intact copies of disklabel.h and
therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them
in programs which already include <sys.disklabel.h> is currently a
no-op.

This commit adds a number of such #includes.

Once I have verified that I have fixed all the places which need fixing,
I will commit the updated versions of the three #include files.

Sponsored by:   DARPA & NAI Labs.
2002-10-01 07:24:55 +00:00
peter
0f28e71fa5 Use as's --defsym switch to compensate for the loss of the M4 substitution
of SIOPRT which broke kgzldr and therefore make release.

Pointed out by:	 murray
2002-09-30 20:37:58 +00:00
nyan
4c0646543e Fixed to build after removing a.out suppot. 2002-09-24 02:17:13 +00:00
alfred
ac315391ce use __packed. 2002-09-23 18:54:32 +00:00
peter
478da56c11 At great personal risk, add a __packed and __aligned(x) define that
expand to __attribute__((packed)) and __attribute__((aligned(x)))
respectively.  Replace the handful of gcc-ism's that use
__attribute__((aligned(16))) etc around the kernel with __aligned(16).

There are over 400 __attribute__((packed)) to deal with, that can come
later.  I just want to use __packed in new code rather than add more
gcc-ism's.
2002-09-23 05:55:10 +00:00
nyan
0d814ab74a MFi386: Remove a.out support. 2002-09-19 13:47:18 +00:00
nyan
e28806ee62 Remove -elf option. 2002-09-19 13:43:02 +00:00
peter
a51c9b6627 Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
iwasaki
84ffd810ea Parse hint.acpi.0.disabled correctly.
Now that hint.acpi.0.disabled="0" won't disable acpi as expected.

Pointed-out by:	bde
2002-09-05 11:16:23 +00:00
brooks
72b448e706 Make SCSI_DELAY setable at boot time and runtime via the
kern.cam.scsi_delay tunable/sysctl.

Reviewed by:	mdodd, njl
2002-09-02 20:10:19 +00:00
jake
7eb367b57b Remove NOFORTH=yes, it seems to work now thanks to scottl. 2002-09-02 01:11:46 +00:00
kan
ae4b45674c Restore Rev. 1.40 (remove "Keyboard yes/no" printf).
GCC 3.2 overflows boot2 by 12 bytes, this patch brings it back
within the boundaries, with 12 bytes available for future bloat.

Approved by:	obrien
2002-09-01 21:29:10 +00:00
scottl
2fec81a60f Make ficl work on sparc64. The assumption that int == long == void * is
very pervasive in this code.  This fixes a few of those assumptions and
band-aids over some others.

Tested on: ia32 alpha sparc64

Reviewed by:	peter jake (in concept)
2002-08-31 01:04:53 +00:00
jhb
fef65bd375 Revert previous untested revision. The i386 loader consists of three parts:
At the front is btxldr, in the middle is BTX itself (our mini-kernel), and
then the 'client' (loader.bin) which is the actual loader itself.  boot2
just executes a raw ELF or a.out binary with the only setup provided being
that a bootinfo structure is passed on the stack.  Now, since loader.bin
is a BTX client, the loader needs to be able to locate a BTX kernel for
the client to execute in the context.  Thus, just like pxelder, btxldr
uses the a.out header on the loader binary to find the BTX kernel stored
in the loader and set it up.  It does _not_ just reuse the BTX kernel
that boot2 invoked it with.  This is because it can't assume that it will
_have_ a "spare" BTX kernel lying around.  For example, when cdboot
loads the loader there isn't an existing BTX kernel.  In fact, cdboot
will only work with an a.out loader as well since it also "borrows" the
BTX kernel in the loader binary (which it finds by parsing the a.out
header) just as pxeldr does.  The only difference between cdboot and
pxeldr is where they get /boot/loader from.

If we wanted to make /boot/loader be an actual ELF binary we would need
to change the following utilites to handle that (and they all have to be
able to handle locating the BTX kernel inside of an ELF binary somehow):
- btxldr
- pxeldr
- cdboot

If we didn't want to require a flag day but make the transition smooth
then we need to be able to support both a.out and ELF versions of
/boot/loader which isn't exactly trivial since all three of these utilities
are written in assembly.

Pointy-hat to:	peter
2002-08-30 14:59:47 +00:00
iwasaki
605d09c7f9 s/hint.acpi.0.disable/hint.acpi.0.disabled/
Fix device hints entry for disabling acpi(4).
This also should fix the arbitration with apm(4) when both drivers
are enabled.

Note that your /boot/device.hints needs to be updated if you want to
stop auto-loading acpi.ko or disable acpi(4).
2002-08-30 11:11:07 +00:00
peter
3968b50cd2 Try #2 at having /boot/loader default to ELF. Have pxeldr build its
own a.out version of loader.bin rather than depend on ../loader/loader
being a.out.
2002-08-29 23:37:44 +00:00
peter
d2c7052d90 Actually remove the stale a.out kld support. This is the stuff that was
never updated for the metadata infrastructure.
2002-08-29 23:02:37 +00:00
peter
d9c1d58394 Initiate deorbit burn of i386 a.out kld "support" in loader. Note that
this was quite broken, it never was updated for metadata support.
The a.out kld file support was never really used, as it wasn't necessary.
You could always load elf kld's, even in an a.out kernel.
2002-08-29 02:02:28 +00:00
trhodes
1f2b440ee5 Whitespace fix from last commit. 2002-08-27 01:02:56 +00:00
trhodes
5779daa590 Fix some grammar errors in loader.conf.5
PR:		40237
Submitted by:	Chris Pepper <pepper@rockefeller.edu>
2002-08-27 01:01:31 +00:00
robert
d5203d1ff8 - Do not pretend to compile a kernel and remove the definition
of the _KERNEL macro.
 - Do not include <sys/pcpu.h> for no reason.

Suggested by:	jake
2002-08-21 15:52:23 +00:00
robert
e5cb539085 - Define the macro _KERNEL to pretend we are compiling a kernel.
This is required by recent changes to <sys/pcpu.h>, which uses
   the #error preprocessor directive to keep non-kernel
   applications from using it.
   _KERNEL is defined below the #include <stand.h>, because <stand.h>
   removes the definition of _KERNEL.
 - Move the inclusion of <sys/queue.h> above the inclusion of
   <sys/linker.h> to avoid syntax errors.
2002-08-21 12:45:36 +00:00
scottl
5d5f15e434 Fix for stand-alone compiling
Reviewed by:	mini
2002-08-21 09:28:00 +00:00
orion
7b9dd904de Support for VIA VT8233 audio controller. 2002-08-17 16:23:44 +00:00
ru
4f5888e2e7 mdoc(7) police: Get rid of hard sentence breaks. 2002-08-13 15:09:33 +00:00
ru
b1ac9aa6f0 mdoc(7) police: revert unapproved changes in rev. 1.43, added missing markup bits in rev. 1.45. 2002-08-13 15:06:48 +00:00
iwasaki
c8de931482 Add help about hint.acpi.0.disable. 2002-08-09 20:07:51 +00:00
obrien
60f8c41a91 Restore autoloading of ACPI module.
Document the approved ways of disabling it.
Submitted by:	Daniel O'Connor <doconnor@gsoft.com.au>
2002-08-09 06:07:33 +00:00
obrien
3cb4683ef0 Don't auto load ACPI -- it causes trouble with my laptop and is TOTALLY
undocumented how to control its loading and queries to freebsd-current
go unanswered.
2002-08-09 05:21:01 +00:00
jake
2eb842c01d Print out the strings in vers.o instead of hardcoding the loader banner. 2002-08-04 01:30:26 +00:00
rwatson
41f4dc56d1 Sample loader.conf lines for various MAC modules. 2002-08-01 22:03:19 +00:00
jake
dea739f983 Stash various networking paramters in the environment for the kernel
to pick up, ala pxe.
2002-07-31 20:17:06 +00:00
ru
a8adf98c82 Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
peter
5c8d7ce181 Turn on -Wformat 2002-07-20 03:52:37 +00:00
peter
335f3b2c57 Fix printf format errors 2002-07-20 03:52:18 +00:00
peter
3c805ef8bd Work around some nasty bugs on the [beta] Itanium2's E1000 UNDI driver.
Bug#1: The GetStatus() function returns radically different pointers that
do not match any packets we transmitted.  I think it might be pointing to
a copy of the packet or something.  Since we do not transmit more than
one packet at a time, just wait for "anything".

Bug#2: The Receive() function takes a pointer and a length.  However, it
either ignores the length or otherwise does bad things and writes outside
of ptr[0] through ptr[len-1].  This is bad and causes massive stack
corruption for us since we are receiving packets into small buffers on
the stack.  Instead, Receive() into a large enough buffer and bcopy the
data to the requested area.
2002-07-20 03:51:53 +00:00
peter
4af604d052 Disable loader ufs support. It causes the loader to crash on the Itanium2
box that I have.  We have no EFI disk drivers yet anyway (maybe that is the
problem).
2002-07-20 03:46:43 +00:00
peter
084cc2c622 Fix printf format errors 2002-07-20 03:44:01 +00:00
nyan
5b01d48f39 Remove boot2 temporarily. 2002-07-18 14:50:41 +00:00
benno
44423651cb 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.
2002-07-18 12:39:02 +00:00
mp
8da6f99dd3 Don't imply that setting the boot_ variables to "NO" will disable them.
MFC after:	3 days
2002-07-16 18:16:01 +00:00
nyan
c0d792ed96 Change include order. 2002-07-16 14:39:52 +00:00
keramida
23964fb59a Use present tense in all the verbs, when describing loader's startup.
Most of them are not in a future tense already.
2002-07-15 03:39:34 +00:00
charnier
c32f3c3be4 The .Nm bootloader 2002-07-14 15:22:49 +00:00
charnier
e441f9245c The .Nm set of commands 2002-07-14 15:21:28 +00:00
charnier
123ce585c8 The .Nm 2002-07-14 15:19:46 +00:00
benno
80bd743152 Add support for passing metadata. 2002-07-10 12:13:16 +00:00
iwasaki
57bb0b6ca4 Resolve conflicts arising from the ACPI CA 20020611 import. 2002-07-09 17:54:02 +00:00
jake
e06b8c244d Enable netboot support by default, since it can now coexist with disk and
cdrom support.  This avoids having to distribute separate loaders.
2002-07-07 23:08:22 +00:00
mp
8c8871e6a7 Change help documentation for bootfile and module_path to reflect
the actual code. Both use a ";" (not a ",") to delimit entries.

PR:		39679
Submitted by:	Cyrille Lefevre <cyrille.lefevre@laposte.net>
MFC after:	3 days
2002-07-07 20:40:31 +00:00
jake
0985bbadd9 Make building with ficl work. Unfortunately booting with it doesn't. 2002-07-07 18:23:10 +00:00
jake
e2d2e1db1f Build ficl on sparc64 fwiw. It doesn't work. 2002-07-07 18:10:38 +00:00
mini
5355db5ad2 Add missing kernal tunables to loader.conf.
PR:		i386/39085
Submitted by:	David Yeske <dyeske@yahoo.com>
2002-07-03 06:42:43 +00:00
iwasaki
cceeb62b51 Fix a build problem for the ACPI CA 20020404 import.
Add definition of COMPILER_DEPENDENT_INT64 and also
fix definition of COMPILER_DEPENDENT_UINT64.

Pointed-out by:	Michael Nottebrock <michaelnottebrock@gmx.net>
2002-06-30 23:22:22 +00:00
peter
b6009897cf Remove a couple of __P() stragglers. 2002-06-29 02:32:34 +00:00
jake
070181b525 Enable cd9660 support by default. 2002-06-21 22:34:51 +00:00
jake
6e6ef32477 Enable UFS1_AND_UFS2 support for sparc64 by default. Booting from ufs1 or
ufs2 filesystems seems to work fine.
2002-06-21 22:33:56 +00:00
phk
25b1090f3a Revert the part of Kirks UFS2 commit which added divdi3.c and moddi3.c
to libi386, this issue was resolved already in a cleaner way.
2002-06-21 11:00:00 +00:00
mckusick
88d85c15ef This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>
2002-06-21 06:18:05 +00:00
peter
9fb8326f23 Add boot_serial and boot_multicons variables to set RB_SERIAL and
RB_MULTIPLE since this seems to be the easiest way to add these flags
for non-forth loaders etc.
2002-06-20 06:29:42 +00:00
phk
fff890a03f #include <sys/disklabel.h> to get BBSIZE. 2002-06-11 10:19:59 +00:00
phk
6204f6b9f8 Make the alpha architecture use the common ufsread().
Submitted by:	ticso
2002-06-11 06:56:31 +00:00
benno
3554dc136b Uncomment some bits that we now need. 2002-06-07 11:49:56 +00:00
benno
54bb6c7dad Fix up the DMA buffer allocation call. 2002-06-07 11:49:33 +00:00
phk
12c36bfb94 Add explicit dependency on ufsread.c 2002-06-05 12:30:45 +00:00
phk
02a3922676 Remove UFS related #includes, they're read in ufsread.c now. 2002-06-05 12:12:25 +00:00
phk
353a43a768 Make sparc64 share ufsread.c with i386.
Sponsored by: DARPA & NAI Labs.
2002-06-05 12:00:53 +00:00
phk
f256ed9075 Avoid entering IOCCC with a memcpy turned bcopy. 2002-06-05 11:56:12 +00:00
phk
6f8415eeca Indent this file more like style(9).
Sponsored by: DARPA & NAI Labs.
2002-06-05 11:20:37 +00:00
phk
7d924377ca Preparation for UFS2 commit:
Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.
2002-06-05 11:10:38 +00:00
schweikh
f7a7d725b1 Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after:	2 weeks
2002-05-30 09:24:01 +00:00
schweikh
2c79ab496a Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after:	2 weeks
2002-05-29 22:57:18 +00:00
jake
8511f99ef3 Add needed include of queue.h. Remove unneeded include of smp.h. 2002-05-29 19:38:49 +00:00
jake
2a45651b25 Use a contrived 'tlb_entry' structure for passing the mappings for the
kernel text and data from the loader to the kernel, so that the tte format
is not part of the loader->kernel ABI.
2002-05-29 05:49:59 +00:00
jake
d314b7908f Sync with i386. The loader was being installed before the beforeinstall
target, which conventiently moved it to loader.old, leaving no loader.
2002-05-28 23:09:59 +00:00
n_hibma
6029daa1e0 Cosmetic change (align with other boot blocks):
CONSPEED -> COMSPEED

Approved by:	nyan
2002-05-26 10:11:17 +00:00
gordon
faffa2a33d Add support for reading an additional loader configuration file. By default,
this is called /boot/nextboot.conf. This file is required to have it's first
line be nextboot_enable="YES" for it to be read. Also, this file is
rewritten by the loader to nextboot_enable="NO"<space> after it is read.
This makes it so the file is read exactly once. Finally, the nextboot.conf
is removed shortly after the filesystems are mounted r/w.

Caution should be taken as you can shoot yourself in the foot. This is only
the loader piece. There will be a tool called nextboot(8) that will manage
the nextboot.conf file for you. It is coming shortly.

Reviewed by:	dcs
Approved by:	jake (mentor)
2002-05-24 02:28:58 +00:00
nyan
f7e0cf5f9d Fixed to conflict labels.
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
2002-05-21 12:53:48 +00:00
nyan
6c2b9542c6 MFi386: revision 1.22 2002-05-21 09:44:52 +00:00
jake
ef5aab6b72 MD ficl files for sparc64. 2002-05-19 23:20:56 +00:00
marcel
768ae8ea9a o Remove namespace pollution from param.h:
-  Don't include ia64_cpu.h and cpu.h
   -  Guard definitions by  _NO_NAMESPACE_POLLUTION
   -  Move definition of KERNBASE to vmparam.h

o  Move definitions of IA64_RR_{BASE|MASK} to vmparam.h
o  Move definitions of IA64_PHYS_TO_RR{6|7} to vmparam.h

o  While here, remove some left-over Alpha references.
2002-05-19 04:42:19 +00:00
marcel
dc5fc64002 An almost mechanical sweep to replace C++ style comments with C
style comments. This is not an attempt to conform to style(9).
Such has lower priority.
2002-05-19 03:17:22 +00:00
phk
e97ac01e3e Fix one of the va_arg() with less than int sized type probelms. 2002-05-18 09:12:32 +00:00
trhodes
28d42899b7 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
jhay
fa9aaf2ad1 DEV_BSIZE lives in sys/param.h and not in machine/param.h anymore. 2002-05-15 11:32:53 +00:00
ru
a4cd115dd3 Even more BBSIZE related breakage. 2002-05-14 13:30:45 +00:00
nyan
4e0ba1d0e6 Fixed to build for GCC 3.1 2002-05-14 12:34:03 +00:00
nyan
ff317ae810 Add -ffreestanding to CFLAGS. 2002-05-14 12:32:59 +00:00
ru
825bd47b27 Align CLEANFILES with revision 1.25 changes. 2002-05-13 16:16:00 +00:00
ru
b2b69cf2b8 Fixed CLEANFILES after bsd.lib.mk sweep. 2002-05-13 15:48:05 +00:00
ru
bc2e1305d8 Removed now unused INTERNALSTATICLIB.
INTERNALLIB now implies NOPIC and NOPROFILE.
Removed gratuitous NOMAN.
2002-05-13 11:09:07 +00:00
ru
dc9ee40833 Major cleanup of bsd.lib.mk.
Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now means to build static library only and don't install
anything.  Added a NOINSTALLLIB knob for libpam/modules.  To not
build any library at all, just do not set LIB.
2002-05-13 10:53:24 +00:00
obrien
f788b3f04d Match the default newfs UFS block size. 2002-05-13 05:09:34 +00:00
bde
d526f40e5c Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;".  This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.

Removed -fno-align-foo since it is implied by -Os.  Previous commit
messages seem to have overstated the new alignment bugs in gcc.  The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken.  All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY.  This is caused by toplev.c setting
defaults too early.

Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed.  The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects.  There aren't
even any options to control alignment of data.
2002-05-12 15:45:28 +00:00
obrien
1b23a3102e Back out last commit. I expect our bsd.*.mk gods to remove the need for
defining so many extra things in addition to INTERNALLIB.  We don't like
repetitive C code and we shouldn't for make code either.
2002-05-12 13:54:42 +00:00
jake
2923a1a3ac Attempt to not crash and burn on UltraSPARC III machines; the cpuid property
is named differently.
2002-05-11 22:05:22 +00:00
peter
4daf43a4a4 Save about 60 bytes by #define memcpy __builtin_memcpy and removing
the function we provided.  Restore the Keyboard: yes/no  printf for the
probe diagnostics.  We end up with 40 bytes free.
2002-05-11 21:49:39 +00:00
peter
b47f03e300 Reconnect boot2. I'm sure I'll regret this though. :-) 2002-05-11 21:41:03 +00:00
peter
f9b8106499 Use a crowbar and duct-tape to make boot2 fit again. This gets it down
to 4 bytes free.  I removed a printf (the Keyboard yes/no) since it is of
marginal value and sed'ed the generated asm output to remove the unwanted
aligns.  There's probably a better way to gain a few extra bytes than
losing the printf.  Shortening strings is probably a better option but this
should get us over the hurdle.
2002-05-11 21:39:59 +00:00
jake
9b110cfade Change the disk probing so that it will actually find disks other
than the first one on a controller, and work for secondary
controllers.
Due to the prom not having nodes for each disk, but a catch-all one,
we have to iterate over each device, trying to open it to determine
whether it is actually present.
Since probing this way takese some time (and spews some spurious
warnings), it should maybe be short-circuited if we use the
device we were booted from.
Implement lazy device probing, and correct slice/partiniton
handling in the ofwd_open() code. With this, I can now actually boot
a kernel from disk, and the loader does not create unnecessary
delays.

Submitted by:	tmm
2002-05-11 21:30:46 +00:00
obrien
4da1be0803 NOPIC, NOPROFILE, NOMAN, and INTERNALSTATICLIB are redundant when using
INTERNALLIB now.
2002-05-11 18:02:33 +00:00
obrien
ce04447cdf -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
jhb
446a06fc8c - Axe -mpreferred-stack-boundary=2 as -Os turns this on by default.
- Axe -fdata-sections as turning it on or off makes no difference.  If
  it did make a difference it would serve to bloat boot2 even further with
  extra padding.
- Axe -fforce-addr.  This gets us 32 bytes so we are down to only being
  64-bytes over.

We still can't compile this with gcc 3.1.  The problem seems to be that
the -fno-align-foo options don't actually work.  Comparing the new and
old output it turns out that gcc is 4-byte padding all the functions and
labels and what not despite the passed in arguments thus adding the
unfortunate bloat to boot2.
2002-05-10 04:05:42 +00:00
obrien
eb01ba72c4 We don't need bootinfo any more, and sparc64 doesn't have it anyways. 2002-05-10 01:20:37 +00:00
obrien
ded6baca77 Don't be redundant. 2002-05-10 01:06:52 +00:00
obrien
b12dc54a67 -ffreestanding is the word for /sys. 2002-05-10 00:53:45 +00:00
obrien
09f3564bdf Turn off boot2 -- it gained over 96 bytes dieting on the in-tree Gcc 3.1. 2002-05-10 00:52:00 +00:00
obrien
e8779e48c0 Ficl doesn't build on sparc64. 2002-05-09 20:33:22 +00:00
obrien
d3e7ae74e6 Partical style cleanup. 2002-05-09 17:47:25 +00:00
joe
36c976074e Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
wes
210f257e4e Rename the file used to specify the nextboot to make it clear that this
is a loader configuration file and can be used for more than just a
kernel name.

Submitted by:	Gordon Tetlow <gordont@gnf.org>
2002-04-26 22:32:15 +00:00
dcs
c6603b03d3 A long, long time ago, msmith introduced vfs.root.mountfrom
loader variable, which let users specify the root mount point
the exact way one does after booting the kernel.

Let's take this opportunity to document it...
2002-04-26 20:52:59 +00:00
wes
9bf40bea60 Add a -k option to reboot to specify the kernel to boot next time
around.  If the kernel boots successfully, the record of this kernel
is erased, it is intended to be a one-shot option for testing
kernels.

This could be improved by having the loader remove the record of
the next kernel to boot, it is currently removed in /etc/rc immediately
after disks are mounted r/w.

I'd like to MFC this before the 4.6 freeze unless there is violent
objection.

Reviewed by:	Several on IRC
MFC after:	4 days
2002-04-26 07:31:04 +00:00
nyan
2d4219d383 MFi386: revision 1.56 2002-04-25 13:31:27 +00:00
nyan
f51b511837 MFi386: revision 1.8 2002-04-25 13:28:10 +00:00
jake
9a5eae2a45 Split file system setup code out into a function called mount.
Implement vsnprintf.  Implement panic in terms of it.
2002-04-24 05:54:10 +00:00
jake
11cf71a416 Add support for loading files other than /boot/loader. Useful if you're
loader is screwed and you want loader.old.
Rewrite the scaled down printf so it actually works right, and add support
for more formats.
2002-04-24 04:27:49 +00:00
jake
40d13085f4 Add an exit function. 2002-04-24 02:50:59 +00:00
jake
628ea2a252 Add -Wno-unused. 2002-04-24 02:50:36 +00:00
jake
3473cf4ec1 memcpy, memset -> bcopy, bzero. 2002-04-24 02:24:32 +00:00
jake
ab92bb92b7 Clean up elf loading to not make assumptions about the ordering of sections.
Don't load the symbol table; this is only needed for loading kernels and we
load the loader.
2002-04-24 02:10:35 +00:00
jake
205c7831cd Remove xfsread. Just call fsread directly. 2002-04-24 01:47:05 +00:00
jake
1aa7da0fd6 Remove a bunch of unused variables, functions and macros. Allocate storage
statically instead of using a faked up malloc.
2002-04-24 01:40:54 +00:00
marcel
1f2cc7b30c Improve self-relocation:
o  We don't expect the PLT relocations to follow the .rela section
   anymore. We still assume that PLT relocations are long formed,
o  Document register usage,
o  Improve ILP,
o  Fix the FPTR relocation by creating unique OPDs per function.
   Comparing functions is valid now,
o  The IPLT relocation naturally handles the addend. Deal with it.
   We ignore the addend for FPTR relocations for now. It's not at
   all clear what it means anyway.

Fix ABI misinterpretation:
o  For Elf_Rela relocations, the addend is explicit and should not
   be loaded from the memory address we're relocating. Only do that
   for Elf_Rel relocations (ie the short form).
o  DIR64LSB is not the same as REL64LSB. DIR64LSB applies to a
   symbol (S+A), whereas REL64LSB applies to the base address (BD+A),
2002-04-21 08:49:47 +00:00
obrien
76b7ec65d9 o Use our own elf2aout now.
o Generalize a little.
2002-04-21 02:37:55 +00:00
marcel
b37c8f0b41 Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
2002-04-19 06:43:09 +00:00
ru
217b7e94cc Install files via FILES, there's no reason to compare them before installing. 2002-04-17 16:56:36 +00:00
ru
0b397f2023 Really unbreak it this time (clean and install were still broken). 2002-04-17 15:33:40 +00:00
nyan
c911a2cbdc MFi386: revision 1.7. 2002-04-15 13:44:00 +00:00
ru
5f45c246ce Unbreak this as well.
At the extra bonus of fixing the contents of the .depend file.

Not really my day.
2002-04-12 15:49:30 +00:00
peter
a2bdc11625 Bandaid for a buffer overrun in the module searching code. When breaking
up the module_path string, we would walk one past the end of the buffer.
This hurting ia64 originally, but it was probably also happening on i386
occasionally as well.  The effects were usually harmless, it would add
bogus "binary" search directories to the places it actually looked for
files.
2002-04-11 10:00:44 +00:00
peter
63071c12c8 Finally fix loader completely for IA64. efifs_stat() wasn't setting
the S_IFREG bit for regular files.  This caused the path search code to
skip it when it finally did find the kernel (after the common/module.c
buffer overrun bug was fixed)
2002-04-11 09:50:11 +00:00
pb
bfa5faab11 Code cleanup, no functional change.
Patch adapted from PR.

PR:		i386/36015
Submitted by:	thomas@cuivre.fr.eu.org
MFC after:	1 week
2002-04-11 09:21:10 +00:00
dcs
2ead48154d Upgrade FICL to 3.02. Forgot this one, sorry.
PR:		36308
Submitted by:	dcs
2002-04-09 20:59:34 +00:00
dcs
eeb34873c0 Upgrade to FICL version 3.02. Anything wrong is my fault, everything right is
due Jon Mini.

PR:		36308
Submitted by:	Jon Mini <mini@haikugeek.com>
MFC after:	4 weeks
2002-04-09 17:45:28 +00:00
jake
297661679e Fix another unsigned long used to index the symbol table which should be
Elf_Hashelt.
2002-04-09 00:05:46 +00:00
peter
d76ff96eff We must not let install(1) strip loader.efi when installing it, or the
resulting binary will be damaged and no longer work.
2002-04-07 04:27:50 +00:00
peter
1a2f6bfa9f Set BINDIR 2002-04-07 04:26:42 +00:00
peter
a0a4c849a0 Add loader bootforth infrastructure and install it. 2002-04-07 04:25:45 +00:00
peter
cddc57f171 Make it a bit closer to the EFI build and tie up some loose ends. 2002-04-06 04:33:53 +00:00
peter
8eb1fab9da Try and tidy up some very loose ends with paths to various libraries etc. 2002-04-06 04:29:36 +00:00
peter
bc98e7be03 Do not add the ficl/alpha subdir to the ia64 include path. Try ficl/ia64
instead.
2002-04-06 04:16:58 +00:00
peter
b2d9042186 Do not assume that ${OBJCOPY} variable exists. It was hidden by the
fact that the 'ia64-make' wrapper explicitly set it.
2002-04-06 04:11:46 +00:00
peter
66482b75cf Use the correct elf hash table entry type. This matches a similar fix
in the kernel side of things some time ago.  The hash table entries are
always 32 bits wide, even on 64 bit machines.
2002-04-06 04:09:42 +00:00
peter
4e70269a83 Fix self hosted loader building. When you use a self configured gcc, it
detects and uses the gas section merge support.  As a result, a whole bunch
of new sections arrive, including .rodata.str1.8, which was not included
in our custom ldscript.ia64.  The result was a loader binary that EFI
rejected.

While here, collect the loader shell commands linker set and include it
in the data area rather than having its own section.

/boot/loader.efi was the last holdout for having a 100% self built ia64
system.
2002-04-06 03:39:22 +00:00
peter
b486ed03d8 Use a relative path to libstand.. /usr/src/lib/libstand may not exist
or may have the wrong header files.
2002-04-04 06:04:38 +00:00
tmm
eb20435a69 Do not use semi-fixed TLB slots for the 4M kernel pages any more. 2002-04-02 17:10:15 +00:00
tmm
2025cfe33a 1.) Rename locore.s to locore.S (by repocopy), to be able to remove
special-case make rule
2.) Cleanups, remove superfluous expicit rules, add -nostdlib to LDFLAGS,
    remove -X and -g, remove -g from CFLAGS
3.) Add BINDIR
4.) Build install the loader help file, add an empty help.sparc64
5.) Change the default configuration to only support booting from disk
6.) Get libofw.a from a path relative ${.OBJDIR}, not ${.CURDIR}

Submitted by:	jake (1 - 5), obrien (6)
2002-04-02 17:08:37 +00:00
tmm
a683bcc922 Add support for booting from CD-ROM. Make it possible to enable UFS
support using make arguments.
2002-04-01 23:28:35 +00:00
tmm
7151c10d96 1.) Produce a boot1 disklabel template of the format disklabel(8) expects.
2.) Clean up and change over to using bsd.prog.mk

Submitted by:	jake (2)
2002-04-01 22:57:51 +00:00
marcel
2830f94478 Only install the help file if we can find it. Use ${BASE}.help
in both the condition and for the install. We expect to find
the help file in ${.OBJDIR}.
2002-03-31 20:48:13 +00:00
marcel
688cf86e24 Pass the address of the bootinfo block to the kernel in register
r8. Keep it at the hardwired address for now. Bump the version.
2002-03-30 23:52:34 +00:00
marcel
83aa1632bb Pass the physical address of the bootinfo block to the kernel in
register r8. We continue to write the bootinfo block at the same
hardwired address, because the kernel still expects it there.
It is expected that future kernels use register r8 to get to the
bootinfo block and don't depend on the hardwired address anymore.

Bump the loader version once again due to the interface change.
2002-03-30 23:00:05 +00:00
nyan
cbfb12da8c MFi386: revision 1.55 2002-03-30 11:18:30 +00:00
marcel
dd7885b88d Add a quick and dirty way to determine where we're loaded from. We
only care if it's network or not at this time. If we're loaded from
the network, we set currdev (=loaddev) so that the kernel is loaded
from the network as well. In all other cases we initialize to disk.
This makes netbooting more convenient and can easily be enhanced to
do more elaborate checking.
2002-03-30 07:32:08 +00:00
marcel
64a996484d The EFI loader has been improved a lot since it was first added.
Most significantly (from an interfacing point of view) is the
support for the FPSWA pointer passing. Even though that was added
4 months ago, it's probably not a bad idea to bump the version
number to reflect this.
2002-03-30 04:54:54 +00:00
marcel
bafbd25360 Fix the initialization of the protocol:
o  Query the state field of the protocol mode to determine whether
   we need to start and/or initialize the protocol. When we're
   loaded across the network, the protocol has already been started
   and is already initialized. When no networking has happened yet,
   we have to start and initialize the protocol ourselves.
o  After initialization, we have to set the receive filters. Not
   doing this results in a deaf interface. We set the unicast and
   broadcast filters. Multicast may not be supported. This specific
   change fixes the problem we had that we could not netboot if
   the loader was started from the EFI shell.
o  To help future debugging, add a function that dumps the current
   mode of the interface. It's conditional on EFINET_DEBUG.
o  To help in runtime problems, emit a diagnostic message when we
   could not initialize the protocol properly.
2002-03-30 04:50:52 +00:00
marcel
08a102c3c4 Don't blindly dereference f->f_devdata as if it's always a pointer to
an efi_devdesc structure. When we're netbooting, f->f_devdata holds
the address of the network socket variable. Dereferencing this caused
some very unpredictable behaviour, including proper functioning.
So, as a sanity check, we first make sure f->f_dev points to our
own devsw. If not, the open will fail before we use f->f_devdata.

This solves the netboot hangs I invariably got whenever I used the
latest toolchain to compile the EFI loader.
2002-03-30 01:36:03 +00:00
marcel
fa19ce8844 o Make efinet_put a blocking call by waiting for the protocol
layer to signal transmission of the packet. This resolves the
   problem I'm seeing that an immediate call to net->Receive
   after calling net->Transmit returns EFI_DEVICE_ERROR. This
   condition seems to be sufficiently persistent that BOOTP and
   RARP fail.
o  While here, unify all functions to have 'nif' defined. Some
   have it as arguments. The others now have them as locals. We
   now always get the protocol interface by using the 'nif' var.

The current status of netbooting is that even though we now reliably
have BOOTP working (again), opening a file (ie loading a kernel)
across the network causes the loader to hang. I'm working on that now.
2002-03-29 23:10:15 +00:00
marcel
e27cdad86b Fix the beforeinstall target. We install ${PROG}.help if loader.help
exists, otherwise we install it anyway. I interpret this as a very
high desire to install ${PROG}.help. Alas, ${PROG}.help doesn't exist
at the moment and neither does loader.help, so in practice this just
doesn't work, no matter how you interpret it. The compromise is to
install ${PROG}.help IFF it exists. I realize we lost creativity with
this commit, but style should have been preserved, AFAICT :-)
2002-03-29 22:53:56 +00:00
obrien
031fa0ff97 Needs a.out support built into the loader. 2002-03-28 19:09:44 +00:00
marcel
5a1b52129d o Don't include sys/cdefs.h 2002-03-28 07:07:45 +00:00
marcel
bc47b3f988 o Add -L${DESTDIR}${LIBDIR} on the link line for -lstand.
o  Add -j .dynstr to objcopy. This makes .efi binaries work
   when built with a 3.x based toolchain.
2002-03-28 06:58:46 +00:00
marcel
4131d9a132 Duplicate the logic used elsewhere to define LIBSTAND. 2002-03-28 06:52:10 +00:00
obrien
d6e11fba68 was repocopied to ../boot1 2002-03-28 02:56:05 +00:00
obrien
892e01faba Apparently either gcc or ld, in their infinite wisdom, want to
put a bunch of crap before the code in .text.  Since the firmware
doesn't seem to honour the a.out entry point, we need to include
a little assmbler file which jumps to where we want to be in C.

Submitted by:	jake
2002-03-28 02:41:52 +00:00
obrien
69ebea4b1c Opps, bootblock component is no more. 2002-03-28 01:41:23 +00:00
obrien
fdd8f809c1 sparc64 is an ofw consumer. 2002-03-28 01:37:10 +00:00
obrien
a9e6f07077 Not all platforms have and want a.out format support. 2002-03-28 01:28:21 +00:00
obrien
21fae6eb80 Add a Makefile for sparc64 at this level. 2002-03-28 01:01:43 +00:00
pb
67873bb7a8 Add option -n to i386 boot2 to disallow boot interruption by keypress.
PR:		i386/36016
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
Reviewed by:	rnordier
MFC after:	1 week
2002-03-23 19:40:27 +00:00
alfred
c61e01af35 Remove __P. 2002-03-20 08:00:54 +00:00
peter
84239ef763 Add EFI write support to loader 2002-03-19 23:05:33 +00:00
peter
d508cde2ba Add -ffreestanding to avoid printf/puts/putchar conversions 2002-03-19 10:51:57 +00:00
peter
497bf7e888 Boot from efifs first. 2002-03-19 10:50:41 +00:00
peter
337520ffc2 gcc-3.1 likes to have extra { } around the internal array initializers in
the GUID templates.
2002-03-19 10:50:09 +00:00
sobomax
9d703dcfed Add splitfs vfs layer into libstand, which allows loading big kernels and
modules split across several physical medias. Following is how it works:

The splitfs code, when asked to open "foo" looks for a file "foo.split"
which is a text file containing a list of filenames and media names, e.g.

	foo.aa "Kernel floppy 1"
	foo.ab "Kernel floppy 2"
	foo.ac "Kernel and modules floppy"

For each file segment, the process is:

- try to open the file
- prompt "Insert the disk labelled <whatever> and press any key..."
- try to open the file
- return error if file could not be located

RE team is free to use this feature in the upcoming 5.0-DP1.

Reviewed by:	msmith, dcs
2002-03-17 12:18:05 +00:00
ru
104f4547d1 mdoc(7) police: fix a typo and markup. 2002-03-15 15:12:10 +00:00
ru
bb48189d63 Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)
2002-03-13 11:03:36 +00:00
ru
4eb95bc05a Further document "console" (nullconsole). 2002-03-13 10:55:22 +00:00
sobomax
ddf6a89609 CG superfluous prototype. 2002-03-10 22:33:04 +00:00
robert
3114b0f152 Change every occurrence of "bootblock" into "boot1" after
the repo-move from "src/sys/boot/sparc64/bootblock".
2002-03-05 16:39:36 +00:00
robert
29222a8f67 - Fix seeking for offsets requiring more than 32 bits.
- Add sanity checks to lookup().
 - Implement the 'l' modifier in printf().

Submitted by:	tmm
2002-03-05 11:22:43 +00:00
alfred
199a58a697 Support for USB fm radio.
Submitted by: David Yeske <dyeske@yahoo.com>
2002-03-04 03:51:21 +00:00
jake
7d70ce2abc Catch up to change in tte format.
Forgetten by:	jake
Submitted by:	tmm
2002-03-01 06:17:28 +00:00
nyan
dce4f706b7 Add -D_KERNEL to CFLAGS for ntohl(). 2002-02-28 10:08:23 +00:00