- Add in support for the EDD (Enhanced Disk Drive) BIOS extensions to
use LBA mode for accessing drives past cylinder 1024. This should allow
us to load a kernel from anywhere on a newer drive up to 2 TB. Part
of this came from the PR below.
PR: i386/13847
Submitted by: Tor Egge <Tor.Egge@fast.no>
theory, this should allow the K7V Athlon motherboard to boot ok with boot
virus protection enabled. However, I have no hardware to test this. It
shouldn't break anything though. :)
Prodded by: Kelly Yancey <kbyanc@posi.net>
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.
code instead of using 32-bit code and having to just "know" that it's
really 16-bit instructions when things run. This also allows the code
to use fewer macros and more actual assembly statements, which eases
maintenance. Unfortunately, due to as(1) brokenness, we still use m4
macros for all 16-bit addresses, and all short jumps (i.e., 8-bit
relative addresses in the jump instruction) must be wrapped in .code32
directives to avoid useless bloat by as(1). This also fixes a few
problems that were preventing boot0 from compiling with the latest
and greatest version of as(1).
below). This did not work previously because interrupts were
disabled when PXE calls were being made, and they must be enabled.
This should also allow us to be compliant with all newer PXE rom's
from Intel.
For PXE 0.99, this has been tested using the Intel N440BX motherboard
and I am confident it will work on the Intel L440GX motherboard.
Lots of help/information from: jhb, peter
I would like to thank Michael Johnston <michael.johnston@intel.com>,
Mike Henry <mike.henry@intel.com>, and all the other PXE developers
at Intel for their help, and information in helping solve this
problem.
from user mode. Don't disable interrupts when returning from vm86 mode
to user mode either. Now, we only disable interrupts before calling a
hardware interrupt handler, which is the only time we _should_ be
disabling interrupts.
Because of this, err, feature, any routine that one called in vm86 mode
had to re-enable interrupts by setting the interrupt flag or interrupts
would remain disabled even after the routine returned. For example, I
have a simple debugging routine that uses a vm86 mode function to dump
any arbitrary memory word that I use to read the BIOS timer or any other
memory location. This function does 1 load instruction from memory and
then returns. Since it didn't re-enable interrupts, the first time I
called it to read the BIOS timer, it disabled interrupts. This also
affected the PXE bootstrap as it needs interrupts enabled while it is
processing. This patch fixes both of those situations so that those
functions do not worry about having to enable interrupts. Hardware
interrupt handlers worked fine with the old code because they always
enable interrupts as part of their routine.
If you have any problems with the loader after this commit, please
let me know. I'd like to MFC it in a week or two since PXE support
needs it.
Noticed by: ps, Michael Johnston <michael.johnston@intel.com>
You may specify TFTP or NFS via compile time options in the loader,
but not both at this time.
Also, remove a warning about not knowing how to boot from network
devices. We can obviously do that now.
- Don't hard code 0x10000 as the entry point for the loader. Instead add
src/sys/boot/i386/Makefile.inc which defines a make variable with the
entry point for the loader. Move the loader's entry point up to
0x20000, which makes PXE happy.
- Don't try to use cpp to parse btxldr for the optional BTXLDR_VERBOSE,
instead use m4 to achieve this. Also, add a BTXLDR_VERBOSE knob in the
btxldr Makefile to turn this option on.
- Redo parts of cdldr's Makefile so that it now builds and installs cdboot
instead of having i386/loader/Makefile do that. Also, add in some more
variables to make the pxeldr Makefile almost identical and thus to ease
maintainability.
- Teach cdldr about the a.out format. Cdldr now parsers the a.out header
of the loader binary and relocates it based on that. The entry point of
the loader no longer has to be hardcoded into cdldr. Also, the boot
info table from mkisofs is no longer required to get a useful cdboot.
- Update the lsdev function for BIOS disks to parse other file systems
(such as DOS FAT) that we currently support. This is still buggy as
it assumes that a floppy with a DOS boot sector actually has a MBR and
parses it as such. I'll be fixing this in the future.
- The biggie: Add in support for booting off of PXE-enabled network
adapters. Currently, we use the TFTP API provided by the PXE BIOS.
Eventually we will switch to using the low-level NIC driver thus
allowing both TFTP and NFS to be used, but for now it's just TFTP.
Submitted by: ps, alfred
Testing by: Benno Rice <benno@netizen.com.au>
necessary. Pass an absolute block number too, instead of receiving a
relative one in realstrategy(), as bcache_strategy() requires this.
The fix is sligthly different from the one in the PR.
PR: 17098
Submitted by: John Hood <jhood@sitaranetworks.com>
1) Fix a bug in the int15 function 87 emulation where we only copied half
of what the BIOS asked for. This caused the Mylex RAID adapter to go
haywire and start trashing memory when you tried to boot from it.
2) Don't use interrupt 19 to reboot. Instead, set the reboot flag to a warm
boot and jump to the BIOS's reboot handler. int 19 doesn't clear memory
or restore the interrupt vector table, and thus really isn't safe. For
example, when booting off of PXE, the PXE BIOS eats up a chunk of memory
for its internal data and structures. Since we rebooted via int 19,
using the 'reboot' command in the loader resulted in that memory not
being reclaimed by the BIOS. Thus, after a few PXE boots, the system
was out of lower memory.
3) Catch any int 19 calls made by a BTX client or a user pressing
Ctrl-Alt-Delete and shutdown BTX and reboot the machine cleanly. This
fixes Ctrl-Alt-Delete in the loader and in boot2 instead of presenting
the user with a BTX fault.
Approved by: jkh
Found by: 1) by msmith
- Fix btxldr to preserve a NULL bootinfo pointer when it copies the kernel
arguments.
- Add the cdldr bootstrap program. This program is tacked onto the
beginning of the standard 3rd stage boot loader (/boot/loader) to form
the CD boot loader (/boot/cdboot). When a CD is booted, the cdboot file
is copied into memory instead and executed. The cdldr stub emulates the
environment normally provided by boot2 and then starts the loader. This
booting method does not emulate a floppy drive, but boots directly off of
the CD. This should fix the problems some BIOS's have with emulating a
2.88 MB floppy image.
- Add support to the loader to recognize that it has been booted by cdldr
instead of boot2 and use a simpler method of extracting the BIOS boot
device.