aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/i386
Commit message (Collapse)AuthorAgeFilesLines
* [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-031-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-211-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/+2
| | | | 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-021-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>
* [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>
* [block] Replace gPXE block-device API with an iPXE asynchronous interfaceMichael Brown2010-09-1416-1924/+732
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block device interface used in gPXE predates the invention of even the old gPXE data-transfer interface, let alone the current iPXE generic asynchronous interface mechanism. Bring this old code up to date, with the following benefits: o Block device commands can be cancelled by the requestor. The INT 13 layer uses this to provide a global timeout on all INT 13 calls, with the result that an unexpected passive failure mode (such as an iSCSI target ACKing the request but never sending a response) will lead to a timeout that gets reported back to the INT 13 user, rather than simply freezing the system. o INT 13,00 (reset drive) is now able to reset the underlying block device. INT 13 users, such as DOS, that use INT 13,00 as a method for error recovery now have a chance of recovering. o All block device commands are tagged, with a numerical tag that will show up in debugging output and in packet captures; this will allow easier interpretation of bug reports that include both sources of information. o The extremely ugly hacks used to generate the boot firmware tables have been eradicated and replaced with a generic acpi_describe() method (exploiting the ability of iPXE interfaces to pass through methods to an underlying interface). The ACPI tables are now built in a shared data block within .bss16, rather than each requiring dedicated space in .data16. o The architecture-independent concept of a SAN device has been exposed to the iPXE core through the sanboot API, which provides calls to hook, unhook, boot, and describe SAN devices. This allows for much more flexible usage patterns (such as hooking an empty SAN device and then running an OS installer via TFTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [multiboot] Reduce length of "Features" startup bannerMichael Brown2010-09-121-1/+1
| | | | | | | Minimise the chances of an unwanted line wrap on the iPXE feature list printed at startup. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Call netdev_link_[up|down|err]() only while registeredMichael Brown2010-09-051-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Generalise metadata "whence" field to "flags" fieldMichael Brown2010-09-031-1/+1
| | | | | | | | | | | | | 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>
* [build] Fix misaligned table entries when using gcc 4.5Piotr Jaroszyński2010-08-201-1/+1
| | | | | | | | | | 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>
* [linux] Add command line argumentsPiotr Jaroszyński2010-08-191-0/+3
| | | | | | | | | | | 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 linux_syscallPiotr Jaroszyński2010-08-191-0/+45
| | | | | | | 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-191-0/+6
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add linuxprefixPiotr Jaroszyński2010-08-191-0/+25
| | | | | | | 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>
* [linux] Add linux platform skeletonPiotr Jaroszyński2010-08-192-0/+107
| | | | | | | | 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>
* [build] Provide %.fd0 build targets only for pcbiosMichael Brown2010-08-172-15/+7
| | | | | Originally-fixed-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> 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-167-8/+9
| | | | | | | | | 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>
* [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>
* [romprefix] Do not check for BBS compatibilityMichael Brown2010-06-241-29/+3
| | | | | | | | | The existence and usage of the BEV entry point is covered by the PnP spec, not the BBS spec; the BBS spec merely describes a policy for selecting the boot device order. iPXE should therefore check only for a PnP BIOS in order to decide whether or not to hook INT19. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix broken build caused by implied dependency upon "perl"Michael Brown2010-06-241-4/+4
| | | | | | | | | | | | | | | | | Commit ea12dc0 ("[build] Avoid hard-coding the path to perl") introduced a build failure for fully clean trees (e.g. after running "make veryclean"), since the dependency upon $(PARSEROM) now includes a dependency upon "perl" (which doesn't exist) rather than upon "/usr/bin/perl" (which does exist). There should of course be no dependency upon the perl binary at all; the dependency should be upon "./util/parserom.pl" alone. Fix by removing the $(PERL) from the definition of Perl-based utility paths, and adding $(PERL) at the point of usage. Reported-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-222-69/+58
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all name-resolution interfaces to generic interfacesMichael Brown2010-06-221-32/+33
| | | | | | | | Remove name-resolution as an interface type, and replace name-resolution interfaces with generic interfaces supporting the resolv_done() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [doc] Fix comment on Linux/x86 boot protocol pathWu Fengguang2010-06-031-1/+1
| | | | | Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-311-0/+2
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Remove obsolete pxe_errortab.cMichael Brown2010-05-301-103/+0
| | | | | | | strerror() has not been able to use the PXE-only error table since commit 9aa61ad ("Add per-file error identifiers") back in 2007. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Remove PACKED macroMichael Brown2010-05-294-70/+70
| | | | | | | Most of iPXE uses __attribute__((packed)) anyway, and PACKED conflicts with an identically-named macro in the upstream EFI header files. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use correct DHCP options on EFI systemsGeoff Lywood2010-05-292-0/+80
| | | | | | | | See RFC 4578 for details. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-274-21/+17
| | | | | | | | | | | | | | | This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Propagate carry flag from COMBOOT APIStefan Hajnoczi2010-05-253-12/+41
| | | | | | | | | | | | COMBOOT API calls set the carry flag on failure. This was not being propagated because the COMBOOT interrupt handler used iret to return with EFLAGS restored from the stack. This patch propagates CF before returning from the interrupt. Reported-by: Geoff Lywood <glywood@vmware.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Treat PXENV_RESTART_TFTP as unreturnableMichael Brown2010-05-213-7/+17
| | | | | | | | | | | | | | | | | | | | | | | Microsoft WDS can end up calling PXENV_RESTART_TFTP to execute a second-stage NBP which then exits. Specifically, wdsnbp.com uses PXENV_RESTART_TFTP to execute pxeboot.com, which will exit if the user does not press F12. iPXE currently treats PXENV_RESTART_TFTP as a normal PXE API call, and so attempts to return to wdsnbp.com, which has just been vaporised by pxeboot.com. Use rmsetjmp/rmlongjmp to preserve the stack state as of the initial NBP execution, and to restore this state immediately prior to executing the NBP loaded via PXENV_RESTART_TFTP. This matches the behaviour in the PXE spec (which says that "if TFTP is restarted, control is never returned to the caller"), and allows pxeboot.com to exit relatively cleanly back to iPXE. As with all usage of setjmp/longjmp, there may be subtle corner case bugs due to not gracefully unwinding any state accumulated by the time of the longjmp call, but this seems to be the only viable way to provide the specified behaviour. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix building with binutils 2.16Michael Brown2010-04-271-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add .mrom format, allowing loading of large ROMsMichael Brown2010-04-254-8/+516
| | | | | | | | | | | | | | | | | | | | | Add an infrastructure allowing the prefix to provide an open_payload() method for obtaining out-of-band access to the whole iPXE image. Add a mechanism within this infrastructure that allows raw access to the expansion ROM BAR by temporarily borrowing an address from a suitable memory BAR on the same PCI card. For cards that have a memory BAR that is at least as large as their expansion ROM BAR, this allows large iPXE ROMs to be supported even on systems where PMM fails, or where option ROM space pressure makes it impossible to use PMM shrinking. The BIOS sees only a stub ROM of approximately 3kB in size; the remainder (which can be well over 64kB) is loaded only at the time iPXE is invoked. As a nice side-effect, an iPXE .mrom image will continue to work even if its PMM-allocated areas are overwritten between initialisation and invocation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Replace obsolete makerom.pl with quick script using Option::ROMMichael Brown2010-04-251-0/+4
| | | | | | | | | | | The only remaining useful function of makerom.pl is to correct the ROM and PnP checksums; the PCI IDs are set at link time, and padding is performed using padimg.pl. Option::ROM already provides a facility for correcting the checksums, so we may as well just use this instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Inhibit the use of relocation during POSTMichael Brown2010-04-253-6/+25
| | | | | | | | | | | | | | | It is common for system memory maps to be grotesquely unreliable during POST. Many sanity checks have been added to the memory map reading code, but these do not catch all problems. Skip relocation entirely if called during POST. This should avoid the problems typically encountered, at the cost of slightly disrupting the memory map of an operating system booted via iPXE when iPXE was entered during POST. Since this is a very rare special case (used, for example, when reflashing an experimental ROM that would otherwise prevent the system from completing POST), this is an acceptable cost. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Split PMM allocations for image source and decompression areaMichael Brown2010-04-251-51/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some BIOSes (at least some AMI BIOSes) tend to refuse to allocate a single area large enough to hold both the iPXE image source and the temporary decompression area, despite promising a largest available PMM memory block of several megabytes. This causes ROM image shrinking to fail on these BIOSes, with undesirable consequences: other option ROMs may be disabled due to shortage of option ROM space, and the iPXE ROM may itself be corrupted by a further BIOS bug (again, observed on an AMI BIOS) which causes large ROMs to end up overlapping reserved areas of memory. This can potentially render a system unbootable via any means. Increase the chances of a successful PMM allocation by dropping the alignment requirement (which is redundant now that we can enable A20 from within the prefix); this allows us to reduce the allocation size from 2MB down to only the required size. Increase the chances still further by using two separate allocations: one to hold the image source (i.e. the copy of the ROM before being shrunk) and the other to act as the decompression area. This allows ROM image shrinking to take place even on systems that fail to allocate enough memory for the temporary decompression area. Improve the behaviour of iPXE in systems with multiple iPXE ROMs by sharing PMM allocations where possible. Image source areas can be shared with any iPXE ROMs with a matching build identifier, and the temporary decompression area can be shared with any iPXE ROMs with the same uncompressed size (rounded up to the nearest 128kB). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use area at top of INT 15,88 memory map for temporary decompressionMichael Brown2010-04-253-17/+27
| | | | | | | | | Use INT 15,88 to find a suitable temporary decompression area, rather than a fixed address. This hopefully gives us a better chance of not treading on any PMM-allocated areas, in BIOSes where PMM support exists but tends not to give us the large blocks that we ask for. Signed-off-by: Michael Brown <mcb30@ipxe.org>