summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [infiniband] Add the concept of an Infiniband upper-layer driverMichael Brown2010-09-054-80/+169
| | | | | | | | | 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>
* [netdevice] Add the concept of a network upper-layer driverMichael Brown2010-09-052-35/+114
| | | | | | | 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>
* [netdevice] Call netdev_link_[up|down|err]() only while registeredMichael Brown2010-09-0520-54/+50Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sis190] Initialise network device before calling register_netdev()Michael Brown2010-09-051-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tables] Add for_each_table_entry_continue() and _continue_reverse()Michael Brown2010-09-051-0/+58
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rtl8139] Strip CRC from received packetsMichael Brown2010-09-031-0/+1
| | | | | | | | | | 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>
* [retry] Hold reference while timer is running and during expiry callbackMichael Brown2010-09-0310-14/+31
| | | | | | | | | 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>
* [process] Add process_running()Michael Brown2010-09-032-2/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tables] Add table_index()Michael Brown2010-09-031-0/+25
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Add xfer_deliver_raw_meta()Michael Brown2010-09-032-5/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Generalise metadata "whence" field to "flags" fieldMichael Brown2010-09-038-40/+30Star
| | | | | | | | | | | | | 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>
* [eepro100] Add new PCI ID 8086:27dcMarty Connor2010-09-031-0/+1
| | | | | | | | | 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>
* [build] Fix misaligned table entries when using gcc 4.5Piotr Jaroszyński2010-08-2014-26/+17Star
| | | | | | | | | | 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>
* [compiler] Prevent empty weak function stubs from being removedJoshua Oreman2010-08-192-1/+9
| | | | | | | | | | | | | | | | | 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>
* [build] Add tap.linux to "make everything"Michael Brown2010-08-191-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add the tap driverPiotr Jaroszyński2010-08-194-0/+257
| | | | | | | | | 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>
* [linux] Add command line argumentsPiotr Jaroszyński2010-08-194-0/+227
| | | | | | | | | | | 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>
* [linux] Add device and driver modelPiotr Jaroszyński2010-08-194-0/+298
| | | | | | | | | 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>
* [linux] Add empty smbiosPiotr Jaroszyński2010-08-195-0/+58
| | | | | | | | | 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>
* [linux] Add napPiotr Jaroszyński2010-08-194-0/+60
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add umallocPiotr Jaroszyński2010-08-194-0/+146
| | | | | | | Add umalloc API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add uaccessPiotr Jaroszyński2010-08-194-0/+144
| | | | | | | | | | | | | | | 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>
* [linux] Add timerPiotr Jaroszyński2010-08-194-0/+100
| | | | | | | Add linux timer API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add consolePiotr Jaroszyński2010-08-194-1/+152
| | | | | | | | 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>
* [linux] Add most of the linux apiPiotr Jaroszyński2010-08-192-0/+283
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add linux_syscallPiotr Jaroszyński2010-08-192-0/+78
| | | | | | | 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>
* [linux] Add linux api headersPiotr Jaroszyński2010-08-194-0/+90
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add linuxprefixPiotr Jaroszyński2010-08-192-0/+47
| | | | | | | 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>
* [dhcp] Use i386-pcbios DHCP options on linuxPiotr Jaroszyński2010-08-191-0/+36
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add linux platform skeletonPiotr Jaroszyński2010-08-197-2/+239
| | | | | | | | 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>
* [libc] Add strtoull()Piotr Jaroszyński2010-08-193-22/+90
| | | | | | | | | | 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>
* [mtnic] Switch to malloc_dma() and free_dma()Piotr Jaroszyński2010-08-171-29/+29
| | | | | | | 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>
* [libc] Add isxdigit()Piotr Jaroszyński2010-08-171-0/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Export find_setting()Piotr Jaroszyński2010-08-172-1/+2
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Provide %.fd0 build targets only for pcbiosMichael Brown2010-08-173-15/+12Star
| | | | | Originally-fixed-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Add everything targetPiotr Jaroszyński2010-08-161-2/+16
| | | | | | | | | 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>
* [build] Properly handle multiple goals per BIN directoryPiotr Jaroszyński2010-08-162-6/+17
| | | | | | | | | | | | | | | | 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>
* [build] Build pcbios specific drivers only on pcbiosPiotr Jaroszyński2010-08-162-2/+4
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Move get_memmap() to the I/O API groupPiotr Jaroszyński2010-08-1613-47/+51
| | | | | | | | | 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>
* [dhcp] Allow multiple interfaces in dhcp commandMichael Brown2010-08-161-22/+56
| | | | | | | | | | | | | | | | | | 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>
* [comboot] Run com32 programs with a valid IDTGeoff Lywood2010-08-014-6/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [forcedeth] Replace driver with native iPXE driverAndrei Faur2010-08-012-1230/+2375
| | | | | | | | | | | | | | | | | 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>
* [string] Use 64-bit registers in assembly memswap() on x86_64Joshua Oreman2010-08-011-4/+4
| | | | | | | | | 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>
* [802.11] Fix a use-after-freeJoshua Oreman2010-08-011-0/+1
| | | | | | | | | 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>
* [802.11] Use correct name for sec80211_detect()Joshua Oreman2010-08-011-3/+3
| | | | | | | | | 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>
* [tcp] Fix a 64bit compile time errorPiotr Jaroszyński2010-07-221-1/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Fix the 32-bit version of elf2efi64Geoff Lywood2010-07-212-12/+12
| | | | | | | | | | | | | | | | | | | 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>
* [tcp] Allow out-of-order receive queue to be discardedMichael Brown2010-07-212-3/+50
| | | | | | | | | 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>
* [malloc] Add cache discard mechanismMichael Brown2010-07-212-46/+85
| | | | | | | 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>
* [tcp] Handle out-of-order received packetsMichael Brown2010-07-212-35/+180
| | | | | | | | | | | | | | | Maintain a queue of received packets, so that lost packets need not result in retransmission of the entire TCP window. Increase the TCP window to 8kB, in order that we can potentially transmit enough duplicate ACKs to trigger Fast Retransmission at the sender. Using a 10MB HTTP download in qemu-kvm with an artificial drop rate of 1 in 64 packets, this reduces the download time from around 26s to around 4s. Signed-off-by: Michael Brown <mcb30@ipxe.org>