Commit Graph

185 Commits

Author SHA1 Message Date
Ian Dowse
4832a19173 Add a "comconsole_speed" loader variable that can be used to change
the serial console speed (i386 and amd64 only). If the previous
stage boot loader requested a serial console (RB_SERIAL or RB_MULTIPLE)
then the default speed is determined from the current serial port
speed. Otherwise it is set to 9600 or the value of BOOT_COMCONSOLE_SPEED
at compile time.

This makes it possible to set the serial port speed once in
/boot.config and the setting will propagate to boot2, loader and
the kernel serial console.
2005-08-18 01:39:43 +00:00
Jung-uk Kim
fd95fd457f Simplify SMBIOS loader variables and drop `hint.smbios.0.enabled'.
They are not real hints.

Reported by:	des
Pointed out by:	peter
Approved by:	anholt (mentor)
2005-07-27 19:11:10 +00:00
Jung-uk Kim
3e709972e1 Scan static SMBIOS structures and export the following environment
variables to loader:

hint.smbios.0.enabled		"YES" when SMBIOS is detected

hint.smbios.0.bios.vendor	BIOS vendor
hint.smbios.0.bios.version	BIOS version
hint.smbios.0.bios.reldate	BIOS release date

hint.smbios.0.system.maker	System manufacturer
hint.smbios.0.system.product	System product name
hint.smbios.0.system.version	System version number

hint.smbios.0.planar.maker	Base board manufacturer
hint.smbios.0.planar.product	Base board product name
hint.smbios.0.planar.version	Base board version number

hint.smbios.0.chassis.maker	Enclosure manufacturer
hint.smbios.0.chassis.version	Enclosure version

These strings can be used to detect hardware quirks and to set appropriate
flags.  For example, Compaq R3000 series and some HP laptops require

	hint.atkbd.0.flags="0x9"

to boot.  See amd64/67745 for more detail.

Note: Please do not abuse this feature to resolve general problem when it
      can be fixed programmatically.  This must be used as a last resort.

PR:		kern/81449
Approved by:	anholt (mentor)
2005-07-14 19:52:22 +00:00
John Baldwin
8b7c03a7a4 - Add support to the loader for multiple consoles.
- Teach the i386 and pc98 loaders to honor multiple console requests from
  their respective boot2 binaries so that the same console(s) are used in
  both boot2 and the loader.
- Since the kernel doesn't support multiple consoles, whichever console is
  listed first is treated as the "primary" console and is passed to the
  kernel in the boot_howto flags.

PR:		kern/66425
Submitted by:	Gavin Atkinson gavin at ury dot york dot ac dot uk
MFC after:	1 week
2005-05-27 19:31:00 +00:00
John Baldwin
9389b62e52 Fix a warning by adding a missing 'const'.
MFC after:	1 week
2005-05-27 19:28:04 +00:00
Philippe Charnier
f942457007 Remove unused variables. Remove prototype for function that does not exist. 2005-05-20 13:14:18 +00:00
Garrett Wollman
98576a6485 Pass the hostname we got from DHCP to the kernel so that machines can
share a read-only NFS root.
2005-04-17 21:38:22 +00:00
Nate Lawson
2626a56934 Extend a local buffer to prevent an overflow of the XSDT address.
Submitted by:	Joerg Sonnenberger
Obtained from:	DragonflyBSD
MFC after:	1 day
2005-04-16 17:38:24 +00:00
Stefan Farfeleder
94bd92c387 Fix 'implicit int' instance. 2005-04-09 14:07:13 +00:00
Alexander Kabaev
721d5bfe2e Allow kernels loaded by pxeboot, which was compiled with LOADER_TFTP_SUPPORT,
to stll be able to mount NFS root as prescribed by DCHP configuration. Since
pxeboot is using TFTP to get to the files, pxeboot can not rely on NFS to
provide it a root directory hande as a side effect. pxeboot has to  make RPC
mount call itself.
2005-03-12 21:26:53 +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 Wemm
cf0c439f9d Remove a pre-tier-1 kernel compatability helper. This means a 6.x loader
won't boot a pre-5.1 development amd64 kernel.  That's no big loss though.
2004-11-08 23:59:44 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Hidetoshi Shimokawa
167938e1e7 - Add FireWire subclass and OHCI interface.
- Add some PCI BIOS function calls.
	(find_devclass, read_config, write_config)
2004-10-22 14:56:23 +00:00
Wes Peters
ecaf63f715 Trap invalid sector size 0 in disk probe, refusing to add such a
device to the list.  This prevents crashes on /0 errors in 'lsdev'
et al.

Reviewed-by:	jhb@
MT5 after:	RE approval
2004-09-21 06:46:44 +00:00
Ian Dowse
941fdb393b Add the loader side of support for preloading ELF relocatable object
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.
2004-08-29 00:48:42 +00:00
Poul-Henning Kamp
ad165b6f6d Unspam sys/boot, the dev_t commit should not have touched these.
Spotted by:	peter
2004-06-16 18:21:22 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
4ee9ad6b13 Premptively fix GCC3.4 issue: add break; after empty default: clauses.
PR:	65493
Submitted by:	Pawel Worach <sajd@telia.com>
2004-06-16 08:12:06 +00:00
Nate Lawson
2c0d74e8e8 Use the correct location of the EBDA for searching for the RSDP.
The EBDA is the 1 KB area addressed by the 16 bit pointer at 0x40E.

Pointed out by:	robert.moore AT intel.com
2004-05-25 05:52:48 +00:00
Ruslan Ermilov
237266b2e6 Back out last revision that unnecessarily changed valid assembler
line comments and damaged the CVS history.

Prompted by:	bde, jhb
2004-05-14 20:29:30 +00:00
John Polstra
15a3ddef19 Fix a potential stack buffer overflow on systems whose ACPI OEMID
fills its field (6 characters).  In that case the OEMID is not
null-terminated, and the sprintf that was used would copy up to the
next null byte, which could be pretty far away.
2004-05-14 01:29:21 +00:00
Ruslan Ermilov
edfa817773 After talking to Bruce Evans and reading more standards specs,
switch to using C99-style comments everywhere in preprocessed
assembler.  The reason is that lines starting with the regexp
'^[[:space:]]#' are treated as preprocessing directives, and
while it seems to work now with GCC, it's not necessarily has
to work.  Use C99 comments `//' for the trailing comments to
save whitespace.
2004-04-28 14:31:44 +00:00
Ruslan Ermilov
8e310f4646 Argh, unbreak "make depend" for AMD64.
Reported by:	kris
2004-02-07 23:30:45 +00:00
Ruslan Ermilov
e215fffac2 - Removed -elf which is not a valid gcc(1) option anymore.
- Removed -ffreestanding; it's enforced by ../Makefile.inc.
2004-02-07 14:32:06 +00:00
Ruslan Ermilov
7e39a38ec9 Untangle building of AMD64 boot code.
Tested on:	amd64 (sledge)
2004-02-07 08:10:07 +00:00
Ruslan Ermilov
a4a62f5d1f First round of cleanups to sys/boot/ makefiles:
- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.

Tested on:	i386, amd64
Prodded by:	bde
2004-02-06 21:58:32 +00:00
John Baldwin
4939882522 If a transfer to or from a floppy disk crosses a 64k boundary, we have to
use a bounce buffer for the actual transfer to avoid crossing a 64k
boundary.  To do this, we malloc a buffer twice as big as we need and then
find an aligned block within that buffer to do the transfer.  The check
to see which part of the block we use used the wrong variable for part of
the condition meaning that in certain edge cases we would ask the BIOS to
cross a 64k boundary.  The BIOS request would then fail resulting in file
transfers that just magically fail in the middle without any apparent
reason.  Specifically, my tests for the splitfs boot floppies managed to
trigger this edge case.

MFC after:	1 week
X-MFC-info:	along with fixes to libstand filesystems
2004-01-21 23:22:29 +00:00
Bruce Evans
bb44220efa Don't repeat selected defines from ns16550.h or sioreg.h. Just
include ns16550.h.  The missing installation of ns16550.h was fixed
long ago and the misplaced defines in sioreg.h were fixed recently.
2003-09-16 11:24:23 +00:00
David E. O'Brien
d9b97e8dff Use __FBSDID().
Also some minor copyright style cleanups.
2003-08-25 23:28:32 +00:00
John Baldwin
8b149b5131 Consistently use the BSD u_int and u_short instead of the SYSV uint and
ushort.  In most of these files, there was a mixture of both styles and
this change just makes them self-consistent.

Requested by:	bde (kern_ktrace.c)
2003-08-07 15:04:27 +00:00
Nate Lawson
c53bcc89ca Null terminate the OEM hint. This rids my laptop of the smiley face that
would follow the 6 valid chars of the table entry.
2003-08-07 14:53:14 +00:00
Nate Lawson
cefe7f9185 Add include file so this builds with new acpica
Reported by:	Kevin Oberman <oberman@es.net>
2003-07-13 22:54:53 +00:00
Ruslan Ermilov
ae0c4c928a Revert non-style part of the recent two deltas that dealt with
using as(1) to compile plain assembler source files; bsd.lib.mk
has been fixed (in revision 1.147).
2003-07-02 12:45:45 +00:00
Ian Dowse
c83b0b621f When looking for the ':' separator in the root path, don't go past
the terminating '\0'. Since the initialisation of rootpath in
libstand/bootp.c may copy junk into the rest of the buffer, it was
possible for the code to find a ':' after the '\0' and do the wrong
thing.

Reviewed by:	ps
MFC after:	1 week
2003-06-16 20:48:56 +00:00
David E. O'Brien
9b8d527fef Add ${AFLAGS} to 'as' invocation. 2003-06-07 17:42:26 +00:00
David E. O'Brien
9f2636a8cf Don't use a C compiler to assemble a pure asm file. 2003-06-02 02:37:27 +00:00
Peter Wemm
728ec271c1 Fix a bug in the AMD64 trampoline. I misunderstood the implicit
32->64 bit zero extend.  This changes a movl to an orq.

Approved by:	re (amd64 bits)
2003-05-17 00:30:51 +00:00
Peter Wemm
063107e21d Revert leftover AMD64 disable-acpi-module stuff. 2003-05-12 04:57:05 +00:00
Peter Wemm
573044a926 For amd64 kernels, repeat the 1GB mapping over the entire address space
instead of just at 0GB and 1GB marks.  This gives more flexibility for
the choice of KERNBASE.

Approved by:	re (amd64 stuff)
2003-05-11 22:42:29 +00:00
Peter Wemm
a5bd71a96d Argh. This was broken by the last-minute elf32/elf64/"elf kernel" changes. 2003-05-01 04:31:33 +00:00
Peter Wemm
2f0eeb54eb Nuke; repocopied to elf32_freebsd.c where it lives on. 2003-05-01 03:57:19 +00:00
Peter Wemm
48a0b96a50 Enable the i386 loader to load and run an amd64 kernel. If this puts
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.
2003-05-01 03:56:30 +00:00
Peter Wemm
d6d3ae55c3 ACPI will always be present on AMD64 - it will never be an autodetect
module.
2003-04-30 22:02:39 +00:00
Nate Lawson
51773ddf47 Support functions for the new ACPI import.
* AcpiOsDerivePciId(): finds a bus number, given the slot/func and the
    acpi parse tree.
  * AcpiOsPredefinedOverride(): use the sysctl hw.acpi.os_name to
    override the value for _OS.

Ideas from:	takawata, jhb
Reviewed by:	takawata, marcel
Tested on:	i386, ia64
2003-04-29 18:50:34 +00:00
Poul-Henning Kamp
197e5e73ef Libdisk does not need to include <sys/diskslice.h> any more.
Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.
2003-04-04 16:35:16 +00:00
Poul-Henning Kamp
63fc86da6f Use NEXTDOSPART instead of MAX_SLICES. 2003-01-20 11:15:12 +00:00
Poul-Henning Kamp
fb8b107e52 Correctly recognize both bogus and genuine BSD disklabels.
Don't expect me to participate in a discussion which is which.

Sponsored by:	DARPA & NAI Labs.
2002-11-03 21:47:55 +00:00
Poul-Henning Kamp
3bb24c35f2 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
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00