Commit Graph

487 Commits

Author SHA1 Message Date
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
Ruslan Ermilov
968ecff61c Inherit BINDIR from a parent Makefile.inc. 2004-02-06 12:58:32 +00:00
Ruslan Ermilov
742816a54a Only include ../Makefile.inc once in loader/Makefile. 2004-02-06 12:45:27 +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
John Baldwin
361c31ad14 - Use constant for shift when converting file length in bytes to a sector
count.
- Fix the twiddle output so that it actually spins.
- Save %cx around BIOS calls to read in sectors from the disc as at least
  one BIOS trashes %cx when called to read off of a USB CD-ROM drive.

Submitted by:	Martin Nilsson <martin@gneto.com>
MFC after:	1 week
2004-01-12 20:34:42 +00:00
David E. O'Brien
b06cf654be Allow one to specify the com port settings for boot0sio. 2004-01-06 18:46:35 +00:00
John Baldwin
acbf8a8d4a - Change the lookup() function to report success or failure using the carry
flag rather than explicitly halting if a lookup failed.
- Add a loop around the call to lookup() to traverse an array of
  nul-terminated strings for possible paths to the boot loader.  A double
  nul character denotes the end of the list.
- Add a new message to say that the boot failed if all of the path lookups
  for a boot loader file failed.
- Add '/boot/loader' as a second boot path.  If you build an ISO using
  risky options to mkisofs such as -U then the loader will be called
  '/boot/loader' rather than '/BOOT/LOADER;0'.  This allows cdboot to work
  with such risky ISO images.
- Bump version to 1.2 to denote added functionality.

The basic idea as well as some of the code were provided by the submitter,
but I added some extra code to use a loop rather than hard-code just 2
possible paths.

PR:		misc/43543
Submitted by:	kientzle
MFC after:	1 week
2003-12-11 22:42:50 +00:00
John Baldwin
bb17adda46 Properly fix a typo that the previous revision made even worse. 2003-12-11 20:40:12 +00:00
David E. O'Brien
b5a8abc730 Sync these two files. 2003-12-09 05:40:06 +00:00
David E. O'Brien
53916adaa8 Hook boot0sio to the build. Use 'boot0cfg -b /boot/boot0sio' to use. 2003-12-08 19:02:06 +00:00
Bruce M Simpson
49bce9d435 Add a serial console capable version of the FreeBSD boot manager. This has
been lying around my tree(s) for the past year or so. It could do with TLC.

Requested by:	obrien
Sponsored by:	Weyland-Yutani Corporation
2003-12-08 17:51:39 +00:00
Daniel C. Sobral
ff652aa8ea With the beastie menu a problem was introduced in which selecting a
different kernel to boot with kernel="NAME" would load the kernel and
loader.conf-selected modules from /boot/NAME, but it would not change
module_path. So, for instance, the automatically loaded acpi.ko would come
from /boot/kernel/acpi.ko, *always*.

Mind you, this happened for unassisted boot. If you interrupted, typed
"unload" and then "boot NAME", it would Do The Right Thing.

The source of the problem is the double initialization with beastie's
loader.rc. One would happen inside "start", and would load the kernel. The
next one would happen later in the loader.rc script, resetting module_path.

Because module_path is set to the Right Value by the functions in support.4th
that actually load the kernel, when beastie.4th proceeded to boot
module_path would remain wrong, as the kernel was already loaded.

This can be corrected by removing either initialization, and also by changing
the command used by beastie.4th from "boot" to "boot-conf", which makes sure
you use the right kernel and modules.

I chose to remove the second initialization, since this let you interrupt
(or confirm) boot before beastie even comes up. I avoid also doing the
boot-conf change because that would simply cause the kernel and modules to
be loaded twice (in fact, that was my original patch, until, in writing this
very commit message, I saw the error of my ways).

This commit changes the semantics of module loading when using the beastie
menu. Now it does what one would expect it to, but not what it was actually
doing, so something may break for unusual setups depending on broken
behavior. As our japanese friends so nicely put it, shikata ga nakatta. :-)

Approved by:	re (scottl)
2003-11-21 19:01:02 +00:00
John Baldwin
9778a4e0c3 Update the size of the OS string table that wasn't updated in the previous
commit that removed the UNIX entry.

Submitted by:	Rudolf Cejka <cejkar@fit.vutbr.cz>
Approved by:	re (rwatson)
2003-11-20 20:28:18 +00:00
Poul-Henning Kamp
5c391f4d6b When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
While we end up the same place, we end up with two different CS register
values after the jump and 0xf000 is compatible with the hardware reset
value.

This makes a difference if the BIOS does a near jump before a far jump.

Detective work and patch by:	 Adrian Steinmann <ast@marabu.ch>
2003-11-16 18:24:23 +00:00
Bruce Evans
4d450ff944 Changed the RB_PAUSE flag from 0x40000 to 0x100000 and marked the old
value as reserved for internal use in boot blocks, because RB_PAUSE
broke binary compatibility by usurping the RB_DUAL flag.  Probably no
one except me has boot blocks for which this matters, since most boot
blocks based on biosboot including pc98's boot2 can't boot elf kernels,
and /boot/loader doesn't properly pass flags set by the previous stage.

reboot.h:
Also mark the historical RB_PROBEKBD flag (0x80000) as reserved for
internal use in boot blocks.

boot2.c:
Added comments to inhibit usurping of other flags.

Approved by:	guido, imp
MFC after: 	1 week
2003-11-15 10:04:06 +00:00
Bruce Evans
129540b834 Include <sys/reboot.h> the definition of RB_BOOTINFO. The previous
commit broke the world because it depended on namespace pollution that
was only in my version of <machine/bootinfo.h>.  The include was removed
in rev.1.63 after the last reference to it went away in rev.1.61.
2003-11-11 06:27:34 +00:00
Bruce Evans
c00209396c Fixed loss of setting of the RB_BOOTINFO flag in rev.1.43. Fixed wrong
comment about this flag in rev.1.61.  It is not historical like the
comment said; it is the flag that says that most of what is laboriously
put in the bootinfo struct is actually there.  Newer kernels were
bootable by even the broken boot2 without losing anything except the
symbol table, but older kernels need at least the memory sizes.

Restoring the "|" with RB_BOOTINFO that was lost in rev.1.43 costs 5
bytes.  The fix can be done in only 4 bytes by fixing some code that
was removed in rev.1.61 (put RB_BOOTINFO back in in the initial value
of "opts" and fix RBX_MASK to not clobber it.)
2003-11-10 19:06:09 +00:00
John Baldwin
7af6cc7dee Fix an incorrect quote character in an M4 test conditon. Basically, one
of the verbose print statements that BTXLDR_VERBOSE enables wasn't properly
enabled.
2003-11-06 21:33:17 +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
Poul-Henning Kamp
27cb47196a Add BOOT_PXELDR_ALWAYS_SERIAL option which forces serial console. 2003-09-03 08:12:20 +00:00
David E. O'Brien
d9b97e8dff Use __FBSDID().
Also some minor copyright style cleanups.
2003-08-25 23:28:32 +00:00
Warner Losh
8c0a2b3383 Many newer CF do not handle having the entire track read from them at
boot time.  Instead, read it a sector at a time.  While this sounds
like a significant slowdown, I've not been able to measure any
signficant difference.

Submitted by: luigi
Reviewed by: jhb, sam (both a while ago)
MFC After: 3 days
2003-08-22 01:59:28 +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
Ruslan Ermilov
6c874d4fa8 Switch to using bsd.prog.mk; this gives us back the standard
.s.o transformation rule.
2003-06-30 14:10:58 +00:00
Ruslan Ermilov
40205a0623 Revision 1.13, besides its useful part, replaced bsd.prog.mk by
bsd.lib.mk and thus broke the build since AFLAGS were not taken
into considered anymore, as bsd.lib.mk currently has wrong .s.o
rule that uses cc(1) instead of as(1).

Revision 1.14 reverted to using as(1), and revision 1.15 brought
AFLAGS back to the business, but revision 1.14 also broke "make
clean".

To fix this, but not break anything that was fixed in revisions
1.13-1.15, we revert mostly to revision 1.13 except for switching
back to using bsd.prog.mk.  This gives us back the default .s.o
rule from sys.mk that uses as(1), and fixes "make clean" by
restoring the full contents of OBJS.

Also fixed LDFLAGS.
2003-06-30 00:15:38 +00:00
Peter Wemm
062b3e0c77 Build on amd64. Yes, I know this isn't particularly nice. 2003-06-26 03:51:57 +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
9ad6ff5596 Don't use a C compiler to assemble a pure asm file. 2003-06-07 08:03:19 +00:00
Jun Kuriyama
5b63e8fcf0 Tweak make values and targets not to build kgzldr.o at
installation stage.

Reviewed by: bde
2003-06-06 13:49:51 +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
David E. O'Brien
3c5dad6ef0 Accpet '1'..'5' in place of F1..F5 for serial console users.
Reviewed by:	Bruce M Simpson <bms@spc.org>
2003-06-01 20:41:04 +00:00
Scott Long
832bb1e2d0 Enable the new bootloader for i386 only. The new loader.rc is will only
be installed if an old one does not exist, i.e. only during install, not
during upgrades.

Approved by:	re
2003-05-31 05:25:18 +00:00
Scott Long
dfc36ded78 Add a new bootloader menu. Pull in screen.4th and frames.4th from the
examples directory to support it.  This is installed only on i386 for
now.  It will be enabled in a later commit.

Approved by:	re
2003-05-30 09:29:24 +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
Ruslan Ermilov
e478cf0a5a Fixed CLEANFILES.
Submitted by:	cron
2003-02-25 15:41:49 +00:00
Poul-Henning Kamp
b04b95ab47 Build a file "boot" which consists of boot1 and boot2 concatenated.
There is little if any reason to treat the two components separately
and it will simplify disklabel(8) and libdisk if we didn't.
2003-01-26 13:33:57 +00:00
Poul-Henning Kamp
63fc86da6f Use NEXTDOSPART instead of MAX_SLICES. 2003-01-20 11:15:12 +00:00
David E. O'Brien
90949c8331 Simplify the Makefile by just using our standard PROG variable. 2003-01-18 23:09:56 +00:00