Commit Graph

60 Commits

Author SHA1 Message Date
Ruslan Ermilov
9662d32c73 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
Ian Dowse
870fb18bc1 Oops, the previous revision (1.35) broke booting from floppies
because the buffers we use could end up spanning a 64k boundary.
Unfortunately it causes too much bloat (228 -> 72 bytes free) to
just reinstate the old malloc() function.

Instead, define a structure that contains all 4 buffers which must
not cross 64k boundaries. We allocate a 64k-aligned instance in
main() using the magic that was in the old boot2 malloc() function.
This brings the free space down to 168 bytes, but that is still
better than it was before revision 1.35 (136 bytes).

Reported by:	Mike Brancato <funnyguy@digitalsmackdown.net>
Pointy-hat to:	iedowse
2002-01-17 22:39:19 +00:00
Ian Dowse
e9f9046337 Make the i386 boot2 fully blocksize-agnostic, as has already been
done with boot1 on the alpha. We use 4k buffers regardless of the
actual filesystem block size.

Remove the simple malloc() implementation, as it is no longer used.
2002-01-14 19:39:19 +00:00
Ian Dowse
7e9c85d4ce Increase BSIZEMAX from 8k to 16k, so that we can reliably boot from
filesystems with 16k blocks.
2002-01-09 15:46:17 +00:00
Peter Wemm
ce4c60d38d Fix the ILLEGAL fdisk table that is there for supporting "dangerously
dedicated" mode.  This was specifying that there are 256 (illegal!)
heads on the disk.  If bioses store that in a byte, and it gets truncated
to 0, then that almost certainly causes the infamous divide-by-zero
nightmare.

This is also most likely the reason why the Thinkpad T20/A20 series
were locking up when FreeBSD was installed.  This is also the most likely
reason why a boot1 being present causes an IA64 box to lock up at boot.
(removing the "part4" stuff from boot1.s fixes the IA64 boxes and would
most likely have fixed the T20/A20 and some TP600E series thinkpads)
2001-11-01 06:19:32 +00:00
Jonathan Lemon
c80bd6e378 Allow the RBX_DUAL flag to appear in bootinfo. 2001-10-23 20:27:05 +00:00
John Baldwin
b0606ca15f Add in a hack to support IBM "El Torito" CD-ROM booting BIOS's which expect
the first sector of the emulated floppy to contain a valid MS-DOS BPB that
it can modify.  Since boot1 is the first sector of boot.flp, this resulted
in the BIOS overwriting part of boot1: specifically the function used to
read in sectors from the disk.

Submitted by:	Mark Peek <mark@whistle.com>
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
PR:		i386/26382
Obtained from:	NetBSD, OpenBSD (the example BPB)
MFC after:	1 month
2001-07-31 19:50:09 +00:00
Robert Nordier
816aa3c0b5 Unset MAINTAINER. 2001-07-21 14:32:47 +00:00
David E. O'Brien
5e6220d9d0 * include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
2001-05-02 23:56:21 +00:00
Robert Nordier
ce6a6a0f90 Set MAINTAINER. 2000-10-02 17:23:16 +00:00
John Baldwin
8dfe6fb59c - Inline all the functions that are only called once. This results in a
savings of 68 bytes in boot2.
- Also add a comment warning that you can't remove the empty exit()
  function.
2000-07-06 01:51:27 +00:00
John Baldwin
54ff3ae038 Doh. The disklabel is not 0x200 bytes of zeros, but it is 0x200 bytes long. 2000-07-06 00:29:40 +00:00
John Baldwin
a6bef20793 Clarify the comments in here a bit. The first sector of boot2 is not just
zeros, it is actually the disklabel itself.  boot2.ldr is simply a
placeholder in the boot2 binary.
2000-07-06 00:22:50 +00:00
John Baldwin
cbf3fb883e Add in support for EDD to support large disks via LBA. This uses a
method similar to that of the loader to avoid potentially breaking older
drives in that we only use EDD if the desired cylinder is > 1023.
2000-06-26 22:57:16 +00:00
John Baldwin
35bdac5bbd Comment this bad boy. Hopefully the next person that comes along won't
have to spend a few hours reading the code to figure all this out.
2000-06-19 22:50:46 +00:00
Ruslan Ermilov
5737d0e1d4 Treat \t and \n inside /boot.config as whitespaces.
PR:		19215
2000-06-13 13:07:53 +00:00
John Baldwin
638bac9fc0 Clean up all of the 16-bit assembly code in the x86 bootstrap to work
with the new binutils.  Now that we have a decent assembler, all the old
m4 macros are no longer needed.  Instead, straight assembly can be used
since as(1) now understands 16-bit addressing, branches, etc.  Also,
several bugs have been fixed in as(1), allowing boot0.s to be further
cleaned up.
2000-05-23 12:18:49 +00:00
John Baldwin
2cb6d95d48 Add a missing dependency: boot2 depends on the BTX kernel. 2000-04-11 14:49:13 +00:00
Ruslan Ermilov
a6120246a2 Support the new ata(4) syntax, while providing backward compatibility for wd(4).
Reviewed by:	jkh, msmith, sos
Approved by:	jkh
2000-02-09 19:23:46 +00:00
David E. O'Brien
c8e02dfe73 Add -fdata-sections, which is a new GCC 2.95 optimization. Remove
-fschedule-insns as it wasn't such a big win with 2.95 after all.

Add the *BIG* win "-mpreferred-stack-boundary=2" optimiztion submitted by
Dima.  GCC 2.95 ensures the stack frame is always properly [opitimally]
aligned by surrounding every function call by code simular to
"addl $-12, %esp" / "addl $12, %esp".  Here we need the reduction in space,
with speed not an issue.
1999-11-15 04:23:40 +00:00
David E. O'Brien
cd37fe517b Return this file to its pre-spammed version. Thanks to some new compiler
optimizations, we can go from 3 bytes free with the spammed version, to
279 bytes free with the full version.
1999-11-14 22:17:06 +00:00
David E. O'Brien
cf49270ac3 Enter complier upgrade mode again. We need to cut 169 bytes from this:
Remove some printf() calls, reduce size of buffers, and abbreviate
	some strings.

Hopefully the boot people will fix this spamage after the cut over to
Gcc 2.95.2 as the system compiler.
1999-11-14 00:41:54 +00:00
David E. O'Brien
73de3d0ff7 Turn on the -fforce-addr and -fschedule-insns optimizations. Adding
either one gives us an additional 32 bytes of additional space available
when using EGCS 1.1.2.  With GCC 2.95.2 -fforce-addr gives us 12 more bytes,
and adding -fschedule-insns gives us an additional 4 bytes.
1999-11-13 23:08:46 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Robert Nordier
50d57a133e Reintroduce LBA (cyl > 1023) support in the bootblocks, enabled by
means of a build option.
1999-07-20 01:19:23 +00:00
Robert Nordier
bc53095dd4 Fix use of e_phoff in place of e_phnum. 1999-06-19 20:50:38 +00:00
Robert Nordier
0e5731f9f4 Fix damage introduced in previous commit. 1999-04-05 07:36:30 +00:00
Robert Nordier
bf0eae60c5 Optimize better for space.
Thanks to: jdp
1999-04-05 07:24:51 +00:00
David E. O'Brien
df5ee53868 Remove the string ">>> FreeBSD/i386 BOOT". I need to reduce the size of
boot2 by 16 bytes.  I expect this to be temperary until the boot2 authors
can do the proper fix.
1999-04-04 21:15:41 +00:00
Joerg Wunsch
9859e703f6 Make <DEL> an alternative rubout character for command input; many
serial terminals use this as their default rubout key.
1999-03-31 08:28:42 +00:00
Robert Nordier
391911b768 Check size of partition before using it. 1999-01-29 03:36:42 +00:00
Mike Smith
5d3d992565 Fill in the bi_bios_dev field in the bootinfo struct; the loader doesn't
guess this value well in anything other than the simplest of situations.
1999-01-24 00:10:10 +00:00
Robert Nordier
05c7fdda18 In the event of a disk error, boot2 is expecting an error
code to be returned: give it one
1999-01-13 23:30:07 +00:00
Robert Nordier
726c0943c0 Drop boot.help support. 1999-01-11 11:36:03 +00:00
Robert Nordier
c03fa7f977 Use etc/make.conf settings for serial port and speed.
Submitted by: rvb
Reviewed by: bde
1999-01-10 14:48:05 +00:00
Peter Wemm
c03b24b2d8 Damn, I thought I had committed this already, but it seems not.
Move the relocated boot1 and arg transfer space from 0x600/0x800 to
0x700/0x900.  In theory this should make no difference, apart from the fact
that Buslogic controllers happen to use a few bytes at 0x600 for some sort
of scratch space for it's int 0x13 hook (!!!), causing the machine to crash
badly when the boot2 code makes it's callbacks into boot1 for disk IO.

Submitted by:	Robert Nordier <rnordier@freebsd.org>
1999-01-10 13:29:52 +00:00
Robert Nordier
21ffb6774a Revise error messages. 1998-11-11 08:56:17 +00:00
Robert Nordier
0293eac42c Prevent boot.config being parsed more than once. 1998-11-08 18:37:28 +00:00
Robert Nordier
7ac90f7d65 Drop the familiar 'text=xxxx data=xxxx bss=xxxx ...' display while
loading.  This eliminates noise when loading boot/loader; and when
loading a kernel, they generally flash by too fast to be
intelligible anyway.
1998-11-08 18:29:29 +00:00
Robert Nordier
9888bdcd29 boot1: Eliminate EDD detection and optional use of disk packet
interface.  Do some general consistency fixes and space optimizations.
Use of some freed-up space to defend against possible BIOS misfeatures.

boot2: Revise disk read interface to provide for boot1 changes.  Free
up space for this.
1998-11-08 15:36:35 +00:00
Robert Nordier
548bf5dd17 Make use of BIOS int 0x13 extensions configurable, and disabled
by default.
1998-11-05 20:52:25 +00:00
Robert Nordier
9244e1a412 Avoid interruptions while talking to keyboard controller. 1998-10-27 20:19:24 +00:00
Robert Nordier
c589107988 biosboot compatibility fix: change behavior of backspace in getstr().
Noticed by: abial

Optimize away a few bytes to make space for the above.
1998-10-27 20:16:36 +00:00
Robert Nordier
1a8efde980 Make serial port, data format, and bps configurable. 1998-10-20 20:20:48 +00:00
Robert Nordier
ae99ddc79e Fix some glitches in the input routine:
Don't display a \b if not acting on it.
Don't process binary zero chars (which result from pressing function
keys, etc. on the PC).
1998-10-17 11:25:05 +00:00
Robert Nordier
918ddbed16 Having probed the keyboard, turn off the -P flag. 1998-10-17 10:35:15 +00:00
Robert Nordier
93d51dcaf9 Treat all options as toggles (ie. -c -c is the same no -c). Since
the boot.config settings are persistent, this seems to provide a
useful override capability, and should break only on broken
boot.config's.

Output a cosmetic newline if booting with no input.
1998-10-17 09:50:09 +00:00
Robert Nordier
3044a22097 biosboot compatibility fix:
If we have a boot.config command, display it.
1998-10-17 09:16:01 +00:00
Robert Nordier
7fa25d805a biosboot compatibility fix:
Read boot.help before parsing boot.config.  We were parsing
boot.config first, which could result in boot.help being read
from a different location (or not found), which would probably
just cause surprise, without being useful.
1998-10-17 09:01:13 +00:00
Robert Nordier
67ac585edf Fix path to sio.s 1998-10-15 22:08:13 +00:00