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

3385 Commits

Author SHA1 Message Date
Michael Brown c8199aacaa [xfer] Add xfer_window_changed()
xfer_window_changed() can be used to notify peers that an interface is
now ready to accept data.  This can potentially be used to eliminate
the need for wasteful processes that simply poll xfer_window() until
the window becomes non-zero.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:12:17 +01:00
Michael Brown 35b19d8848 [infiniband] Add the concept of an Infiniband upper-layer driver
Replace the explicit calls from the Infiniband core to the IPoIB layer
with the general concept of an Infiniband upper-layer driver
(analogous to a PCI driver) which can create arbitrary devices on top
of Infiniband devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:06:16 +01:00
Michael Brown ca4df90a63 [netdevice] Add the concept of a network upper-layer driver
Add the concept of a network upper-layer driver, which can create
arbitrary devices on top of network devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 03:03:38 +01:00
Michael Brown 97ef28aea0 [netdevice] Call netdev_link_[up|down|err]() only while registered
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 02:51:46 +01:00
Michael Brown 3950d1d8e6 [sis190] Initialise network device before calling register_netdev()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 02:50:30 +01:00
Michael Brown c04b6ccd75 [tables] Add for_each_table_entry_continue() and _continue_reverse()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-05 02:49:06 +01:00
Michael Brown a3021ad0e4 [rtl8139] Strip CRC from received packets
The rtl8139 driver includes the Ethernet CRC within the received
packet.  All current protocols ignore trailing garbage, but FCoE
requires the frame length to be correct (since the FCoE footer
position is calculated from the end of the packet), so fix the driver
to strip out the CRC.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:29:44 +01:00
Michael Brown 28934eef81 [retry] Hold reference while timer is running and during expiry callback
Guarantee that a retry timer cannot go out of scope while the timer is
running, and provide a guarantee to the expiry callback that the timer
will remain in scope during the entire callback (similar to the
guarantee provided to interface methods).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:28:43 +01:00
Michael Brown 25447294d5 [process] Add process_running()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:26:21 +01:00
Michael Brown da123eada4 [tables] Add table_index()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:25:06 +01:00
Michael Brown 0329673833 [xfer] Add xfer_deliver_raw_meta()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:23:16 +01:00
Michael Brown 364b92521a [xfer] Generalise metadata "whence" field to "flags" field
iPXE has never supported SEEK_END; the usage of "whence" offers only
the options of SEEK_SET and SEEK_CUR and so is effectively a boolean
flag.  Further flags will be required to support additional metadata
required by the Fibre Channel network model, so repurpose the "whence"
field as a generic "flags" field.

xfer_seek() has always been used with SEEK_SET, so remove the "whence"
field altogether from its argument list.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 21:21:14 +01:00
Marty Connor b0eacbd421 [eepro100] Add new PCI ID 8086:27dc
Add PCI ID 8086:27dc to the eepro100 driver.

Reported-by: Cédric Delmas <c.delmas@akka.eu>
Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-09-03 14:33:32 +01:00
Piotr Jaroszyński b9eaf24df2 [build] Fix misaligned table entries when using gcc 4.5
Declarations without the accompanying __table_entry cause misalignment
of the table entries when using gcc 4.5.  Fix by adding the
appropriate __table_entry macro or (where possible) by removing
unnecessary forward declarations.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-20 10:13:04 +01:00
Joshua Oreman 49d6f57005 [compiler] Prevent empty weak function stubs from being removed
Even with the noinline specifier added by commit 1a260f8, gcc may skip
calls to non-inlinable functions that it knows have no side
effects. This caused the get_cached_dhcpack() call in start_dhcp(),
the weak stub of which has no code in its body, to be removed,
preventing cached DHCP from working.

Fix by adding a __keepme macro to compiler.h expanding to asm(""), as
recommended by gcc's info page, and using it in the weak stub for
get_cached_dhcpack().

Reported-by: Aaron Brooks <aaron@brooks1.net>
Tested-by: Aaron Brooks <aaron@brooks1.net>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 13:37:52 +01:00
Michael Brown 059c11e1e6 [build] Add tap.linux to "make everything"
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 13:26:00 +01:00
Piotr Jaroszyński d60cbe43b7 [linux] Add the tap driver
Add the tap driver that can be used like:
$ ./ipxe.linux --net tap,if=tap0,mac=00:0c:29:c5:39:a1
The if setting is mandatory.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 13:12:53 +01:00
Piotr Jaroszyński ddef2e1bc1 [linux] Add command line arguments
Support qemu-like arguments for network setup:
--net driver_name[,setting=value]*

and global settings:
--settings setting=value[,setting=value]*

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:45:41 +01:00
Piotr Jaroszyński 91fb434bda [linux] Add device and driver model
Add the base to build linux drivers and the linux UI code on.  UI
fills device requests, which are later walked over by the linux
root_driver and delegated to specific linux drivers.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:42:42 +01:00
Piotr Jaroszyński aacd1d62fb [linux] Add empty smbios
There exists an smbios userspace library so implementing this is
probably possible, but doesn't seem really important to have in
userspace.  Hence provide a dummy implementation returning an error.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:38:34 +01:00
Piotr Jaroszyński 9ab6761b9c [linux] Add nap
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:38:08 +01:00
Piotr Jaroszyński 6ec1c509e4 [linux] Add umalloc
Add umalloc API.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:37:48 +01:00
Piotr Jaroszyński a320085750 [linux] Add uaccess
Add user access API for linux.

On linux userspace virtual == user == phys addresses.  Physical
addresses also being the same is wrong, but there is no general way of
converting userspace addresses to physical as what appears to be
contiguous in userspace is physically fragmented.  Currently only the
DMA memory is special-cased, but its conversion to bus addresses is
done in phys_to_bus.  This is known to break virtio as it is passing
phys addresses to the virtual device.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:35:28 +01:00
Piotr Jaroszyński 01a4c244db [linux] Add timer
Add linux timer API.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:32:53 +01:00
Piotr Jaroszyński 18d3c12b01 [linux] Add console
Add linux console using stdin/out. Configure the attached terminal for
readline use.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:31:13 +01:00
Piotr Jaroszyński 1812bfd5d0 [linux] Add most of the linux api
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:30:39 +01:00
Piotr Jaroszyński e743910cf9 [linux] Add linux_syscall
Add linux_syscall for both i386 and x86_64.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:30:03 +01:00
Piotr Jaroszyński 0e5fc47a25 [linux] Add linux api headers
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:29:37 +01:00
Piotr Jaroszyński bb5b66b887 [linux] Add linuxprefix
Add a minimal _start required to run main.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:28:21 +01:00
Piotr Jaroszyński 55187e8c4e [dhcp] Use i386-pcbios DHCP options on linux
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:27:41 +01:00
Piotr Jaroszyński e84db1121b [linux] Add linux platform skeleton
Add makefiles, ld scripts and default config for linux platform for
both i386 and x86_64.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:25:06 +01:00
Piotr Jaroszyński 1822b1deb9 [libc] Add strtoull()
Don't implement strtoul() on top of strtoull() as strtoull() is much
bigger and only used on linux currently. Instead refactor most of the
logic out of strtoul() into static inlines and reuse that. Also put it
in a separate object so it won't get linked in.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-19 12:22:07 +01:00
Piotr Jaroszyński b1fa4378d1 [mtnic] Switch to malloc_dma() and free_dma()
alloc_memblock() and free_memblock() are internal.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-17 14:45:06 +01:00
Piotr Jaroszyński 6e4573bcd0 [libc] Add isxdigit()
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-17 14:44:27 +01:00
Piotr Jaroszyński 380d7c8d45 [settings] Export find_setting()
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-17 14:39:10 +01:00
Michael Brown 42a1f43bf9 [build] Provide %.fd0 build targets only for pcbios
Originally-fixed-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-17 14:36:39 +01:00
Piotr Jaroszyński 4d068fd53a [build] Add everything target
The everything target builds multiple image types on each supported
arch/platform combination.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-16 17:34:37 +01:00
Piotr Jaroszyński 2d98d4a018 [build] Properly handle multiple goals per BIN directory
When building multiple targets per BIN with multiple jobs, for
example:

  make -j16 bin-i386-efi/ipxe.efi{,drv,rom} bin-x86_64-efi/ipxe.efi{,drv,rom}

we would invoke a make subprocess for each goal in parallel resulting
in multiple makes running in a single BIN directory.  Fix by grouping
goals per BIN directory and invoking only one make per BIN.  It is
both safer and faster.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-16 17:26:20 +01:00
Piotr Jaroszyński 6142b721bf [build] Build pcbios specific drivers only on pcbios
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-16 16:54:37 +01:00
Piotr Jaroszyński 5bbad9c8f0 [ioapi] Move get_memmap() to the I/O API group
pcbios specific get_memmap() is used by the b44 driver making
all-drivers builds fail on other platforms.  Move it to the I/O API
group and provide a dummy implementation on EFI.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-16 16:54:03 +01:00
Michael Brown e3c7a1948d [dhcp] Allow multiple interfaces in dhcp command
The "dhcp" command now accepts a list of interfaces to try until one
succeeds.  For example:

 iPXE> dhcp net0 net1 net2

If no interfaces are specified, all interfaces will be tried.

Note that interfaces that fail to DHCP are closed in order to avoid
memory exhaustion.  This behavior differs from the previous "dhcp"
command implementation but should not affect any existing scripts
since a "dhcp" command failure would in any case cause the script to
abort.

Originally-implemented-by: Lars Kellogg-Stedman <lars@oddbit.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-16 16:46:22 +01:00
Geoff Lywood a4023e02e8 [comboot] Run com32 programs with a valid IDT
COM32 binaries generally expect to run with interrupts
enabled. Syslinux does so, and COM32 programs will execute cli/sti
pairs when running a critical section, to provide mutual exclusion
against BIOS interrupt handlers.  Previously, under iPXE, the IDT was
not valid, so any interrupt (e.g. a timer tick) would generally cause
the machine to triple fault.

This change introduces code to:
- Create a valid IDT at the same location that syslinux uses
- Create an "interrupt jump buffer", which contains small pieces of
  code that simply record the vector number and jump to a common
  handler
- Thunk down to real mode and execute the BIOS's interrupt handler
  whenever an interrupt is received in a COM32 program
- Switch IDTs and enable/disable interrupts when context switching to
  and from COM32 binaries

Testing done:
- Booted VMware ESX using a COM32 multiboot loader (mboot.c32)
- Built with GDBSERIAL enabled, and tested breakpoints on int22 and
  com32_irq
- Put the following code in a COM32 program:
    asm volatile ( "sti" );
    while ( 1 );
  Before this change, the machine would triple fault
  immediately. After this change, it hangs as expected. Under Bochs,
  it is possible to see the interrupt handler run, and the current
  time in the BIOS data area gets incremented.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-01 17:38:18 +01:00
Andrei Faur 315524e703 [forcedeth] Replace driver with native iPXE driver
This patch adds a native iPXE forcedeth driver and removes the legacy
Etherboot forcedeth driver. It supports 40 different chips, compared
to the original 14.

It has been tested on a NIC with an CK804 Ethernet Controller, and the
results of downloading 5 100mb images in a row have been:
12/11/11/11/11 seconds; booting DSL using pxelinux also succeeded. The
driver has also been tested by chaining undionly.kpxe and it worked.

Signed-off-by: Andrei Faur <da3drus@gmail.com>
Tested-by: Andrei Faur <da3drus@gmail.com>
Tested-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-01 17:37:19 +01:00
Joshua Oreman 79e05875d3 [string] Use 64-bit registers in assembly memswap() on x86_64
An assembly version of memswap() is in an x86 word-length-agnostic
header file, but it used 32-bit registers to store pointers, leading
to memory errors responding to ARP queries on 64-bit systems.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-01 17:31:14 +01:00
Joshua Oreman 73aea88a62 [802.11] Fix a use-after-free
When we received an encrypted packet, after replacing it with its
decrypted version and freeing the encrypted original, we would
continue to look at the header of the now-freed original packet. Fix
by moving the header pointer to point at the decrypted packet instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-01 17:29:57 +01:00
Joshua Oreman 0c593d95e5 [802.11] Use correct name for sec80211_detect()
The workhorse function for detecting 802.11 security was still named
_sec80211_detect(), a holdover from the old style of weak function
handling, with the result that all networks would be identified as
"unknown".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-08-01 17:29:07 +01:00
Piotr Jaroszyński 02e6092cd5 [tcp] Fix a 64bit compile time error
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-22 21:25:40 +01:00
Geoff Lywood b8dd94686b [efi] Fix the 32-bit version of elf2efi64
Currently, if elf2efi.c is compiled using a 32-bit HOST_CC, then the
resulting elf2efi64 binary will generate 32-bit EFI binaries instead
of 64-bit EFI binaries.

The problem is that elf2efi.c uses the MDE_CPU_* definitions to decide
whether to output a 32-bit or 64-bit PE binary.  However, MDE_CPU_*
gets defined in ProcessorBind.h, depending on the compiler's target
architecture.  Overriding them on the command line doesn't work in the
expected way, and you can end up in cases where both MDE_CPU_IA32 and
MDE_CPU_X64 are defined.

Fix by using a separate definition, EFI_TARGET_IA32/EFI_TARGET_X64,
which is specified only on the command line.

Signed-off-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-21 12:41:41 +01:00
Michael Brown 1d3b6619e5 [tcp] Allow out-of-order receive queue to be discarded
Allow packets in the receive queue to be discarded in order to free up
memory.  This avoids a potential deadlock condition in which the
missing packet can never be received because the receive queue is
occupying all of the memory available for further RX buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-21 12:01:50 +01:00
Michael Brown 9dc51afa2c [malloc] Add cache discard mechanism
Add a facility allowing cached data to be discarded in order to
satisfy memory allocations that would otherwise fail.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-21 11:58:50 +01:00