david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

2549 Commits

Author SHA1 Message Date
Michael Brown 03c80c12b8 [iSCSI] Support Windows Server 2008 direct iSCSI installation
Add yet another ugly hack to iscsiboot.c, this time to allow the user to
inhibit the shutdown/removal of the iSCSI INT13 device (and the network
devices, since they are required for the iSCSI device to function).

On the plus side, the fact that shutdown() now takes flags to
differentiate between shutdown-for-exit and shutdown-for-boot means that
another ugly hack (to allow returning via the PXE stack on BIOSes that
have broken INT 18 calls) will be easier.

I feel dirty.
2008-07-17 17:45:17 +01:00
Michael Brown 4e033c774b [phantom] Guard against partially-written status descriptors
Conjecture: The hardware issues 64-bit DMA writes of status descriptors,
which some PCI bridges seem to split into two 32-bit writes in reverse
order (i.e. dword 1 first).  This means that we sometimes observe a
partial status descriptor.  Add an explicit check to ensure that the
descriptor is complete before processing it.

Also ensure that the RDS consumer counter is incremented only when we
know that we have actually consumed an RX descriptor.
2008-07-17 15:45:40 +01:00
Michael Brown bb41ec385c [int13] Pairwise swap drive numbers, instead of shifting all drive numbers
Shifting all INT13 drive numbers causes problems on systems that use a
sparse drive number space (e.g. qemu BIOS, which uses 0xe0 for the CD-ROM
drive).

The strategy now is:

  Each drive is assigned a "natural" drive number, being the next
  available drive number in the system (based on the BIOS drive count).

  Each drive is accessed using its specified drive number.  If the
  specified drive number is -1, the natural drive number will be used.

  Accesses to the specified drive number will be delivered to the
  emulated drive, masking out any preexisting drive using this number.

  Accesses to the natural drive number, if different, will be remapped to
  the masked-out drive.

The overall upshot is that, for examples:

  System has no drives.  Emulated INT13 drive gets natural number 0x80
  and specified number 0x80.  Accesses to drive 0x80 go to the emulated
  drive, and there is no remapping.

  System has one drive.  Emulated INT13 drive gets natural number 0x81
  and specified number 0x80.  Accesses to drive 0x80 go to the emulated
  drive.  Accesses to drive 0x81 get remapped to the original drive 0x80.
2008-07-15 23:19:59 +01:00
Michael Brown 21e9e801e2 [udp] Avoid reusing auto-allocated ports after connection close.
This duplicates a fix made to tcp.c in commit
d5735c631c.
2008-07-10 04:21:10 +01:00
Michael Brown 6f39dfe6c0 [dhcp] Verify DHCP server source port
Verifying server ID and DHCP transaction ID is insufficient to
differentiate between DHCPACK and ProxyDHCPACK when the DHCP server and
Proxy DHCP server are the same machine.
2008-07-10 04:11:09 +01:00
Andrew Schran 34c1a5b91d [forcedeth] Add support for PCI ID 10de:0373 2008-07-10 01:19:08 +01:00
Michael Brown 997bccc64e [hermon] Add support for MT26418 device
PCI ID supplied (and tested) by Frederic
Temporelli <frederic.temporelli@bull.net>
2008-07-09 00:53:38 +01:00
Michael Brown d474386336 [phantom] Remove warning relating to now-fixed firmware bug 2008-07-08 22:37:36 +01:00
Michael Brown 22d00797f1 [phantom] Add NetXen dual copyright 2008-07-08 22:36:07 +01:00
Michael Brown 4f05d2fca7 [phantom] Initialise RCVPEG before reading MAC addresses 2008-07-08 20:59:33 +01:00
Michael Brown 0436e417bc [image] Fail "imgexec"/"boot" if the image to execute is ambiguous
If there is more than one loaded image, refuse to automatically select
the image to execute.  There are at least two possible cases, with
different "correct" answers:

1. User loads image A by mistake, then loads image B and types "boot".
   User wants to execute image B.

2. User loads image A, then loads image B (which patches image A), then
   types "boot".  User wants to execute image A.

If a user actually wants to load multiple images, they must explicitly
specify which image is to be executed.
2008-07-08 03:50:44 +01:00
Michael Brown 4f2861a376 [image] Revert "clear LOADED flag" patch
Clearing the LOADED flag actually prevents users from doing clever things
such as loading an image, then loading a patch image, then executing the
first image.  (image_exec() checks for IMAGE_LOADED, so this sequence of
operations will fail if the LOADED flag gets cleared.)

This reverts commit 14c080020f.
2008-07-08 03:15:02 +01:00
Michael Brown 14c080020f [image] Clear LOADED flag on all other images when loading a new image
Loading an image may overwrite part or all of any previously-loaded
images, so we should clear the LOADED flag for all images prior to
attempting to load a new image.
2008-07-08 03:03:48 +01:00
Michael Brown 4847d97372 [settings] Allow "config" command to access root settings block 2008-07-08 02:10:18 +01:00
Michael Brown dbe9269f3a [bzimage] Kill off the initrd image type
We can just treat all non-kernel images as initrds, which matches our
behaviour for multiboot kernels.  This allows us to eliminate initrd as
an image type, and treat the "initrd" command as just another synonym for
"imgfetch".
2008-07-08 01:30:11 +01:00
Michael Brown 2df682c5be [dhcp] Allow DHCP non-option settings to be cleared
dhcppkt_store() is supposed to clear the setting if passed NULL for the
setting data.  In the case of fixed-location fields (e.g. client IP
address), this requires setting the content of the field to all-zeros.
2008-07-08 01:13:59 +01:00
Michael Brown 3ad348e55a [phantom] Add support for NetXen Phantom NICs 2008-07-04 19:38:14 -07:00
Michael Brown 227bb05a50 [tftp] Strip the initial '/' to keep Windows TFTP servers happy. 2008-07-02 15:01:25 -07:00
Michael Brown 4fbbf651d7 [i386] Change semantics of __from_data16 and __from_text16
__from_data16 and __from_text16 now take a pointer to a
.data16/.text16 variable, and return the real-mode offset within the
appropriate segment.  This matches the use case for every occurrence
of these macros, and prevents potential future bugs such as that fixed
in commit d51d80f.  (The bug arose essentially because "&pointer" is
still syntactically valid.)
2008-06-30 18:52:13 -07:00
Michael Brown d51d80f785 [pxe] Fix a typo in PXENV_GET_CACHED_INFO that broke Altiris
__from_data16 takes the value pointed to, rather than the pointer
itself.  This was silently causing gPXE to return a dud buffer pointer
when the caller did not supply a buffer for PXENV_GET_CACHED_INFO.
2008-06-30 18:35:51 -07:00
Michael Brown fdb8481de1 [dhcp] Verify server identifier on ProxyDHCPACKs
Perform the same test for a matching DHCP_SERVER_IDENTIFIER on
ProxyDHCPACKs as we do for DHCPACKs.  Otherwise, a retransmitted
DHCPACK can end up being treated as the ProxyDHCPACK.

I have a vague and unsettling memory that this test was deliberately
omitted, but I can't remember why, and can't find anything in the VC
logs.
2008-06-30 17:56:37 -07:00
H. Peter Anvin 25450dc59c [Config] remove src/Config
Remove src/Config as it has no more users, and conflicts with
src/config on case-deficient filesystems.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-30 12:26:13 -07:00
H. Peter Anvin 1152b78ec1 [ns8390] Use stub files instead of src/Config
ns8390.c can produce four different drivers (one PCI, three ISA.)  The
ISA driver requires setting a few macros; do that by setting defines
in stub files instead of using src/Config.

Currently, all the ISA drivers are broken (they were not enabled by
default), so #if 0 them out.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-30 12:26:12 -07:00
Stefan Hajnoczi 1719b105cd [lkrnprefix] Make gPXE .lkrn images conform to the zImage 2.07 format 2008-06-30 19:53:28 +01:00
Stefan Hajnoczi ce51128534 [bzImage] Support loading zImage kernels
zImage kernels require the real-mode portion to be loaded at 9000:0000
rather than 1000:0000.
2008-06-30 19:51:41 +01:00
Stefan Hajnoczi e9e1da131a [GDB] Provide functions to manually enter GDB stub. 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 7eb555a8ae [GDB] Obey flow control when GDB connects. 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi fe79edfc3d [GDB] Remove unused DR6 debug register variable 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 578b056730 [GDB] UDP clean up and add netdev refcnt 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 3715c8c721 [GDB] Zero-extend 16-bit segment registers
When the 16-bit segment registers are accessed using 32-bit instructions
the high order bytes are undefined on older CPUs.  We now explicitly
zero the high order bytes when snapshotting the CPU state.  This ensures
that the GDB stub reports consistent values for the segment registers.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 5504fa9047 [GDB] Add copyright header for gdbmach.c 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 19386ec2c8 [GDB] Add watch and rwatch hardware watchpoints 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 6e670b5f38 [GDB] Remote debugging over UDP
This commit implements GDB over UDP.  Using UDP is more complex than
serial and has required some restructuring.

The GDB stub is now built using one or both of GDBSERIAL and GDBUDP
config.h options.

To enter the debugger, execute the gPXE shell command:
gdbstub <transport> [<options>...]

Where <transport> is "serial" or "udp".  For "udp", the name of a
configured network device is required:
gdbstub udp net0

The GDB stub listens on UDP port 43770 by default.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 9ec3ff95f0 [GDB] Atomic read/write for device memory 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 59b5465b30 [GDB] Handle kill and detach packets.
This commit also includes a test to ensure that single stepping works,
since continue, kill, detach, and single step all share code.
2008-06-30 19:19:48 +01:00
Michael Brown 27731d975e [romprefix] Fix PMM detection start address
Commit fd0aef9 introduced a typo that caused PMM detection to start at
paragraph 0xe00 rather than 0xe000.  (Detection would still work, since it
would scan until it ran out of base memory, but it would end up scanning
an unnecessarily large portion of base memory.)

Spotted by Sebastian Herbszt <herbszt@gmx.de>.
2008-06-28 23:18:11 +01:00
Michael Brown 4c75e9ded4 [nvs] Add support for ST M25P32 SPI flash devices 2008-06-27 14:39:25 -07:00
Michael Brown 2596a9aa9c [misc] Fix building on OpenBSD
OpenBSD throws compiler warnings that we can't reproduce on Linux, for
some reason.

Original patch from Dewey Hylton <dewey@hyltown.com>.
2008-06-27 22:35:26 +01:00
H. Peter Anvin b7882065f5 [a20] Send a null command to the KBC after changing A20
Send a null command, specifically "pulse outputs" with no outputs
selected, to the KBC after changing A20.  This was apparently done by DOS,
presumably as a synchronization hack, and the authors of the UHCI spec
thought it was inherent.  Therefore, there are systems out there (e.g. HP
DL360 G5) which will stop responsing to "legacy USB" unless they see the
null command, 0xFF, written to port 0x64 at the end of the A20 toggling
sequence.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-27 22:29:13 +01:00
Michael Brown 2b9e7a4767 [libc] Remove unused le32_to_cpup(x) and cpu_to_le16p() macros
If we ever need these macros, they should be defined in
include/{big,little}_bswap.h, and the whole family should be defined.
2008-06-27 22:12:44 +01:00
Steven Walter 14fe4d4ba5 [tg3] Recognize the BCM5789
Add an entry to tg3_nics for the BCM5789

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
2008-06-27 22:12:43 +01:00
Michael Brown ddf5c8d4d3 [cmdline] Fix image command-line construction for zero-length argument lists
This fixes a bug introduced in commit 4c85017.
2008-06-27 21:50:18 +01:00
Michael Brown 0ea821c7b7 [script] Remove arbitrary limit on script line lengths 2008-06-18 00:43:58 +01:00
Michael Brown 0d91c37ce5 [legacy] Align legacy drivers' __shared data to the maximum possible
Some drivers that still use the legacy-driver wrapper (tg3 in particular)
apparently do not specify their alignment constraints properly.  This
hack forces any __shared data to be maximally aligned.

Note that this provides only 16-byte alignment; it is not possible to
request alignment to any greater than 16 bytes using
__attribute__((aligned)), since the relocation code will preserve only 16
byte alignment (and operation under -DKEEP_IT_REAL cannot preserve more
that 16 byte alignment).

Idea proposed by Tim Hockin <thockin@google.com>
2008-06-14 20:01:14 +01:00
Michael Brown cd0e9bcd22 [prefix] When we have to hook INT 19, chain to original handler if possible
When the BIOS doesn't support BBS, hooking INT 19 is the only way to add
ourselves as a boot device.  If we have to do this, we should at least
try to chain to the original INT 19 vector if our boot fails.

Idea suggested by Andrew Schran <aschran@google.com>
2008-06-14 13:49:26 +01:00
Stefan Hajnoczi a71b4df1c9 [via-rhine] Fix erroneous uses of memory I/O instead of port I/O 2008-06-12 15:21:42 +01:00
Michael Brown 31c6df5365 [cleanup] Remove long-obsolete gpxe/async.h header file 2008-06-12 13:15:53 +01:00
Michael Brown ac28d054c8 [bzimage] Support kernel command lines of greater than 256 characters
2.6.22+ kernels have an extra field in the bzimage_header structure to
indicate the maximum permitted command-line length.  Use this if it is
available.
2008-06-12 02:19:10 +01:00
Michael Brown 4c85017968 [cmdline] Remove arbitrary limit on the length of image command lines 2008-06-12 02:12:10 +01:00
Michael Brown 031b30898a [smbios] Fix SMBIOS string fetching
A bug in read_smbios_string() was causing the starting offset of the
SMBIOS structure to be added twice, resulting in completely the wrong
strings being returned.

Bug identified by Martin Herweg <m.herweg@gmx.de>
2008-06-11 13:43:58 +01:00