summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
...
* [undi] Cope with devices that erroneously claim not to use interruptsMichael Brown2011-03-231-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some PXE stacks advertise that interrupts are not supported, despite requiring the use of interrupts. Attempt to cope with such cards without breaking others by always hooking the interrupt, and using the "interrupts supported" flag only to decide whether or not to wait for an interrupt before calling PXENV_UNDI_ISR_IN_PROCESS. The possible combinations are therefore: 1. Card generates interrupts and claims to support interrupts iPXE will call PXENV_UNDI_ISR_IN_PROCESS only after an interrupt has been observed. (This is required to avoid lockups in some PXE stacks, which spuriously sulk if called before an interrupt has been generated.) Such a card should work correctly. 2. Card does not generate interrupts and does not claim to support interrupts iPXE will call PXENV_UNDI_ISR_IN_PROCESS indiscriminately, matching the observed behaviour of at least one other PXE NBP (winBoot/i). Such a card should work correctly. 3. Card generates interrupts but claims not to support interrupts iPXE will call PXENV_UNDI_ISR_IN_PROCESS indiscriminately. An interrupt will still result in a call to PXENV_UNDI_ISR_IN_START. Such a card may work correctly. 4. Card does not generate interrupts but claims to support interrupts Such a card will not work at all. Reported-by: Jerry Cheng <jaspers.cheng@msa.hinet.net> Tested-by: Jerry Cheng <jaspers.cheng@msa.hinet.net> Reported-by: Mauricio Silveira <mauricio@livreti.com.br> Tested-by: Mauricio Silveira <mauricio@livreti.com.br> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix building with latest binutilsBastian Blank2011-03-162-2/+2
| | | | | Signed-off-by: Bastian Blank <waldi@debian.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add facility for rudimentary keyboard mappingMichael Brown2011-03-161-2/+19
| | | | | | | Allow for remapping of ASCII characters returned by the BIOS, using a map consisting of (from,to) pairs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Use correct size for PMM allocation of image source blockMichael Brown2011-03-151-6/+7
| | | | | | | | | | | | | | | | | | iPXE allocates its first PMM block using the image source length, which is rounded up to the nearest 16-byte paragraph. It then copies in data of a length calculated from the ROM size, which is theoretically less than or equal to the image source length, but is rounded up to the nearest 512-byte sector. This can result in copying beyond the end of the allocated PMM block, which can corrupt the PMM data structures (and other essentially arbitrary areas of memory). Fix by rounding up the image source length to the nearest 512-byte sector before using it as the PMM allocation length. Reported-by: Alex Williamson <alex.williamson@redhat.com> Reported-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Reported-by: Itay Gazit <itayg@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Use INT 16,11 instead of INT 16,01 to check for keystrokesMichael Brown2011-03-101-1/+1
| | | | | | | | INT 16,01 will discard some extended keystrokes on some BIOSes, making it impossible for iPXE to detect keypresses such as F12. Fix by using INT 16,11 instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Report an IRQ number only if device supports interruptsMichael Brown2011-03-101-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-093-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify use of imgdownload()Michael Brown2011-03-094-52/+14Star
| | | | | | | Allow imgdownload() to be called without first having to allocate (and so keep track of) an image. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Allow iPXE's own command line to be executed as a scriptMichael Brown2011-03-072-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | Some prefixes (e.g. .lkrn) allow a command line to be passed in to iPXE. At present, this command line is ignored. If a command line is provided, treat it as an embedded script (without an explicit "#!ipxe" magic marker). This allows for patterns of invocation such as title iPXE kernel /boot/ipxe.lkrn dhcp && \ sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage Here GRUB is instructed to load ipxe.lkrn with an embedded script equivalent to #!ipxe dhcp sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage This can be used to effectively vary the embedded script without having to rebuild ipxe.lkrn. Originally-implemented-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Recognise scancodes for F5-F12 inclusiveMichael Brown2011-03-071-25/+24Star
| | | | | | | | | The function keys F5-F12 all conform to the same ANSI pattern as the other "special" keys that we currently recognise. Add these key definitions, and shrink the representation of the ANSI sequences in bios_console.c to compensate. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Do not assume that image has a non-NULL command lineMichael Brown2011-03-071-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image managementMichael Brown2011-03-078-236/+216Star
| | | | | | | | | | | Refactor the {load,exec} image operations as {probe,exec}. This makes the probe mechanism cleaner, eliminates some forward declarations, avoids holding magic state in image->priv, eliminates the possibility of screwing up between the "load" and "exec" stages, and makes the documentation simpler since the concept of "loading" (as distinct from "executing") no longer needs to be explained. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Refer to online documentation for command helpMichael Brown2011-03-042-4/+3Star
| | | | | | | | | | The online documentation (e.g. http://ipxe.org/cmd/ifopen), though not yet complete, is far more comprehensive than could be provided within the iPXE binary. Save around 200 bytes (compressed) by removing the command descriptions from the interactive help, and instead referring users directly to the web page describing the relevant command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Automatically reopen underlying block device as neededMichael Brown2011-03-021-34/+50
| | | | | | | | | | | | | | | | We currently use INT 13,00 as an opportunity to reopen the underlying block device, which works well for callers such as DOS that will use INT 13,00 in response to any disk errors. However, some callers (such as Windows Server 2008) do not attempt to reset the disk, and so any failures become effectively permanent. Fix this by automatically reopening the underlying block device whenever we might want to access it. This makes direct installation of Windows to an iSCSI target much more reliable. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Set the "size" bit in the GDT entry for the flat data segmentMichael Brown2011-03-011-1/+1
| | | | | | | | | | | | The "size" bit (aka the D/B) bit should (as far as I can tell) be irrelevant for accesses to a non-code, non-stack, expand-upwards segment. However, VirtualBox fails on some accesses via this segment if this bit is not set. This change allows iPXE to boot under VirtualBox without having to disable VT-x/AMD-V support. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Add rudimentary debugging messages to libprefixMichael Brown2011-03-011-0/+40
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Remove Linux-specific code from default (non-Linux) buildMichael Brown2011-02-251-0/+2
| | | | | | | | | | | Building the Linux-specific code (tap.o et al) requires external headers that have proven to be extremely variable across systems, causing frequent build failures. Until this situation is rectified, remove the Linux-specific code from the default (non-Linux build). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use unique entry symbols for each prefixMichael Brown2011-02-2316-30/+22Star
| | | | | | | | | | | | Some binutils versions will drag in an object to satisfy the entry symbol; some won't. Try to cope with this exciting variety of behaviour by ensuring that all entry symbols are unique. Remove the explicit inclusion of the prefix object on the linker command line, since the entry symbol now provides all the information needed to identify the prefix. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Ensure an entry point symbol exists in all buildsMichael Brown2011-02-237-3/+16
| | | | | | | | | | Commit 623469d ("[build] Eliminate unused sections at link-time") introduced a regression in several build formats, in which the prefix would end up being garbage-collected out of existence. Fix by ensuring that an entry symbol exists in each possible prefix, and is required by the linker script. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Eliminate unused sections at link-timeMichael Brown2011-02-225-10/+24
| | | | | | | | | Use -ffunction-sections, -fdata-sections, and --gc-sections to automatically prune out any unreferenced sections. This saves around 744 bytes (uncompressed) from the rtl8139.rom build. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add missing "static" modifierMichael Brown2011-02-221-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow EFI to control PCI bus enumerationMichael Brown2011-02-171-2/+3
| | | | | | | | | | | | | | EFI performs its own PCI bus enumeration. Respect this, and start controlling devices only when instructed to do so by EFI. As a side benefit, we should now correctly create multiple SNP instances for multi-port devices. This should also fix the problem of failing to enumerate devices because the PCI bridges have not yet been enabled at the time the iPXE driver is loaded. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Make driver PCI ID a property of the PCI deviceMichael Brown2011-02-171-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Replace pci_max_bus() with pci_num_bus()Michael Brown2011-02-173-10/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Use single "busdevfn" field in struct pci_deviceMichael Brown2011-02-173-8/+8
| | | | | | | Merge the "bus" and "devfn" fields into a single "busdevfn" field, to match the format used by the majority of external code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcbios] Merge adjacent memory regions of same typeEduardo Habkost2011-02-171-2/+10
| | | | | | | | | | Some BIOSes can report multiple memory regions which may be adjacent and the same type. Since only the first region is used in the mboot.c32 layer it's possible to run out of memory when loading all of the boot modules. One may get around this problem by having iPXE merge these memory regions internally. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [init] Remove concept of "shutdown exit flags"Michael Brown2011-01-279-12/+18
| | | | | | | | Remove the concept of shutdown exit flags, and replace it with a counter used to keep track of exposed interfaces that require devices to remain active. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [liba20] Rename libflat to liba20Michael Brown2011-01-271-0/+0
| | | | | | | libflat no longer has anything to do with flat real mode; it handles only the A20 gate. Update library name to match. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libflat] Remove now-obsolete flatten_real_mode callMichael Brown2011-01-272-122/+5Star
| | | | | | | | Flat real mode will have been set up as a side-effect of the protected-mode call invoked during install_block() for .text16.early; there is no need to do so explicitly. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use 16-bit protected mode for access to high memoryMichael Brown2011-01-272-42/+195
| | | | | | | | | | | | Flat real mode works perfectly on real hardware, but seems to cause problems for some hypervisors. Revert to using 16-bit protected mode (and returning to real mode with 4GB limits, so as not to break PMM BIOSes). Allow the code specific to the .mrom format to continue to assume that flat real mode works, since this format is specific to real hardware. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Report SUPPORTED_IRQ only if device supports interruptsMichael Brown2011-01-251-1/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Improve pxe_udp debug messagesMichael Brown2010-12-151-9/+14
| | | | | | | | | | The PXE debugging messages have remained pretty much unaltered since Etherboot 5.4, and are now difficult to read in comparison to most of the rest of iPXE. Bring the pxe_udp debug messages up to normal iPXE standards. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Set correct PktType in PXENV_UNDI_ISRMichael Brown2010-12-091-1/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Avoid touching fields that may not exist in PXENV_UNDI_GET_NIC_TYPEMichael Brown2010-12-091-5/+5
| | | | | | | | | | | Earlier versions of the PXE specification do not have the SubVendor_ID and SubDevice_ID fields, and some NBPs may not provide space for them. Avoid overwriting the contents of these fields, just in case. This is similar to the problem with the BufferLimit field in PXENV_GET_CACHED_INFO. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "reboot" commandMichael Brown2010-12-091-0/+66
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add FILE_LICENCE macro to some GPL-v2-or-later filesShao Miller2010-12-041-0/+2
| | | | | | | | | Changes were made to files where the licence text within the files themselves confirms that the files are GPL version 2 or later. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libflat] Test A20 gate without switching to flat real modeMichael Brown2010-12-031-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Use the real-mode address ffff:0010 to access the linear address 0x100000, and so test whether or not the A20 gate is enabled without requiring a switch into flat real mode (or some other addressing mode). This speeds up CPU mode transitions, and also avoids breaking the NBP from IBM's Tivoli Provisioning Manager for Operating System Deployment. This NBP makes some calls to iPXE in VM86 mode rather than true real mode and does not correctly emulate our transition into flat real mode. Interestingly, Tivoli's VMM *does* allow us to switch into protected mode (though it patches our GDT so that we execute in ring 1 rather than ring 0). However, paging is still disabled and we have a 4GB segment limit. Being in ring 1 does not, therefore, restrict us in any meaningful way; this has been verified by deliberately writing garbage over Tivoli's own GDT (at address 0x02201010) during a nominally VM86-mode PXE API call. It's unclear precisely what protection this VMM is supposed to be offering. Suggested-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Use generic option-parsing libraryMichael Brown2010-11-221-2/+73
| | | | | | Total cost: 66 bytes Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Use network device receive queue freezingMichael Brown2010-11-201-6/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Support underlying UNDI devices that don't support interruptsMichael Brown2010-11-191-17/+31
| | | | | | | | | | | | | | Some network cards do not generate interrupts when operated via the UNDI API. Allow for this by waiting for the ISR to be triggered only if the PXE stack advertises that it supports interrupts. When the PXE stack does not advertise interrupt support, we skip the call to PXENV_UNDI_ISR_IN_START and just poll the device using PXENV_UNDI_ISR_IN_PROCESS. This matches the observed behaviour of at least one other PXE NBP (emBoot's winBoot/i), so there is a reasonable chance of this working. Originally-implemented-by: Muralidhar Appalla <Muralidhar.Appalla@emulex.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Always allow MAX_LL_HEADER_LEN for the link-layer headerMichael Brown2010-11-191-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bzimage] Increase maximum command-line size to 0x7ffJarrod Johnson2010-11-131-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Add FreeBSD location for isolinuxMichael Brown2010-11-031-1/+2
| | | | | Reported-by: Jedrzej Kalinowski <kalinoj1@iem.pw.edu.pl> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add missing addr32 prefixMichael Brown2010-10-291-1/+1
| | | | | Reported-by: Jedrzej Kalinowski <kalinoj1@iem.pw.edu.pl> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Dump out MBR at DBGLVL_EXTRAMichael Brown2010-10-181-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add missing FILE_LICENCE declaration to undiloader.SMichael Brown2010-10-181-0/+2
| | | | | | | undiloader.S was originally part of romprefix.S, and so inherits its licence. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Fix building on RHEL5 and similar platformsMichael Brown2010-10-111-48/+40Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Fix typo in debug messageMichael Brown2010-09-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Include disk signature in debugging outputMichael Brown2010-09-222-2/+9
| | | | | | | The disk signature is used by some OSes (notably Windows) to identify the boot disk, so it's useful debugging information to have. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add infrastructure to support EDD version 4.0Michael Brown2010-09-222-27/+243
| | | | | | | | | | | | | | | | | | | | | | Support the extensions mandated by EDD 4.0, including: o the ability to specify a flat physical address in a disk address packet, o the ability to specify a sector count greater than 127 in a disk address packet, o support for all functions within the Fixed Disk Access and EDD Support subsets, o the ability to describe a device using EDD Device Path Information. This implementation is based on draft revision 3 of the EDD 4.0 specification, with reference to the EDD 3.0 specification. It is possible that this implementation may need to change in order to conform to the final published EDD 4.0 specification. Signed-off-by: Michael Brown <mcb30@ipxe.org>