summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface
Commit message (Collapse)AuthorAgeFilesLines
* [comboot] Support COMBOOT in 64-bit buildsMichael Brown2016-04-154-1054/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Provide an abstraction wrapper for prot_callMichael Brown2016-02-191-12/+6Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Convert prot_call() to a real-mode near callMichael Brown2016-02-181-3/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Discard argument as part of return from prot_call()Michael Brown2016-02-171-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Add bin-x86_64-pcbios build platformMichael Brown2016-02-1623-7820/+0Star
| | | | | | | | | | | | | | Move most arch/i386 files to arch/x86, and adjust the contents of the Makefiles and the include/bits/*.h headers to reflect the new locations. This patch makes no substantive code changes, as can be seen using a rename-aware diff (e.g. "git show -M5"). This patch does not make the pcbios platform functional for x86_64; it merely allows it to compile without errors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Allow rtc_entropy.c to be compiled for x86_64Michael Brown2016-02-161-16/+13Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Use size_t when casting _text16_memsz and _data16_memszMichael Brown2016-02-161-4/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Use intptr_t when casting .text16 function pointersMichael Brown2016-02-164-17/+12Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.hMichael Brown2016-02-163-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Add check_bios_interrupts() debug functionMichael Brown2016-01-121-0/+27
| | | | | | | | Provide a debug function check_bios_interrupts() to look for changes to the interrupt vector table. This can be useful when investigating the behaviour (including crashes) of external PXE NBPs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Add debug message to display real-mode segment addressesMichael Brown2016-01-111-0/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Colourise debug outputMichael Brown2016-01-111-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Expose GuestRPC mechanism in 64-bit buildsMichael Brown2016-01-054-803/+0Star
| | | | | | | | | The GuestRPC mechanism (used for VMWARE_SETTINGS and CONSOLE_VMWARE) does not use any real-mode code and so can be exposed in both 64-bit and 32-bit builds. Reported-by: Matthew Helton <mwhelton@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Generalise CONSOLE_VESAFB to CONSOLE_FRAMEBUFFERMichael Brown2015-10-161-1/+7
| | | | | | | | | | | The name "vesafb" is intrinsically specific to a BIOS environment. Generalise the build configuration option CONSOLE_VESAFB to CONSOLE_FRAMEBUFFER, in preparation for adding EFI framebuffer support. Existing configurations using CONSOLE_VESAFB will continue to work. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fbcon] Move margin calculations to fbcon.cMichael Brown2015-10-141-28/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fbcon] Allow character height to be selected at runtimeMichael Brown2015-10-141-5/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Notify BIOS via INT 1a,564e for each new network deviceMichael Brown2015-09-151-0/+26
| | | | | | | | | Use INT 1a,564e to notify the BIOS of each network device that we detect. This provides an opportunity for the BIOS to implement platform policy such as changing the MAC address by issuing a call to PXENV_UNDI_SET_STATION_ADDRESS. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Invoke INT 1a,564e when PXE stack is activatedMichael Brown2015-09-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invoke INT 1a,564e whenever a PXE stack is activated, passing the address of the PXENV+ structure in %es:%bx. This is designed to allow a BIOS to be notified when a PXE stack has been installed, providing an opportunity for start-of-day commands such as setting the MAC address according to a policy chosen by the BIOS. PXE defines INT 1a,5650 as a means of locating the PXENV+ structure: this call returns %ax=0x564e and the address of the PXENV+ structure in %es:%bx. We choose INT 1a,564e as a fairly natural notification call, using the parameters as would be returned by INT 1a,5650. The full calling convention (documented as per section 3.1 of the PXE specification) is: INT 1a,564e - PXE installation notification Enter: %ax = 0x564e %es = 16-bit segment address of the PXENV+ structure %bx = 16-bit offset of the PXENV+ structure Exit: %edx may be trashed (as is the case for INT 1a,5650) All other register contents must be preserved CF is cleared IF is preserved All other flags are undefined Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Generalise tftp_uri() to pxe_uri()Michael Brown2015-09-021-13/+11Star
| | | | | | | | | | | | | | | | | | Merge the functionality of parse_next_server_and_filename() and tftp_uri() into a single pxe_uri(), which takes a server address (IPv4/IPv6/none) and a filename, and produces a URI using the rule: - if the filename is a hierarchical absolute URI (i.e. includes a scheme such as "http://" or "tftp://") then use that URI and ignore the server address, - otherwise, if the server address is recognised (according to sa_family) then construct a TFTP URI based on the server address, port, and filename - otherwise fail. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Construct all fake DHCP packets before starting PXE NBPMichael Brown2015-08-291-24/+34
| | | | | | | | | | | | | | | | Commit edf74df ("[pxe] Always reconstruct packet for PXENV_GET_CACHED_INFO") fixed the problems caused by returning stale DHCP packets (e.g. from an earlier boot attempt using a different network device), but broke interoperability with NBPs such as WDS which may overwrite our cached (fake) DHCP packets and expect the modified packets to be returned by a subsequent call to PXENV_GET_CACHED_INFO. Fix by constructing the fake DHCP packets immediately before transferring control to a PXE NBP. Calls to PXENV_GET_CACHED_INFO will now never modify the cached packets. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Avoid dragging in serial console support unconditionallyMichael Brown2015-07-311-1/+3
| | | | | | | | | | | | | | When the ability for iPXE to handle multiple serial ports was added, the choice was made that the singular serial port referred to by COMBOOT calls should mean the port used for the serial console. This unintentionally caused IMAGE_COMBOOT to also enable CONSOLE_SERIAL. Fix by providing a weak-symbol version of the serial console which will be used if serial console support was not explicitly enabled. Reported-by: Torgeir Wulfsberg <Torgeir.Wulfsberg@kongsberg.com> Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Implement INT22,0x000cWissam Shoukair2015-06-291-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [serial] Use new UART abstraction in serial console driverMichael Brown2015-06-291-13/+10Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Always reconstruct packet for PXENV_GET_CACHED_INFOMichael Brown2015-06-291-10/+8Star
| | | | | | | Avoid accidentally returning stale packets (e.g. for a previously attempted network device) by always constructing a fresh DHCP packet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Use flat real mode to call INT 1a,b101Michael Brown2015-06-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Some HP BIOSes (observed with an HP ProLiant m710p Server Cartridge) have a bug in the implementation of INT 1a,b101: they blithely assume that real-mode code is able to read from anywhere in the 32-bit memory space. This problem affects the call to INT 1a,b101 made from within pcibios_num_bus() (which uses REAL_CODE() and hence executes in genuine real mode) but does not affect the call made from within romprefix.S (since with a PMM BIOS, that call executes in flat real mode anyway). Work around the problem by explicitly calling flatten_real_mode() before invoking INT 1a,b101. This is a rarely-used code path, and so the extra overhead of emulating instructions in some VM configurations (see commit 6d4deee ("[librm] Use genuine real mode to accelerate operation in virtual machines") for more details) is negligible. Reported-by: Wissam Shoukair <wissams@mellanox.com> Debugged-by: Wissam Shoukair <wissams@mellanox.com> Debugged-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13con] Add basic ability to log to a local disk via INT 13Michael Brown2015-05-191-0/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | Several popular public cloud providers do not provide any sensible mechanism for obtaining debug output from an OS which is failing to boot. For example, Amazon EC2 provides the "Get System Log" facility, which occasionally deigns to report a random subset of the characters emitted via the VM's serial port, but usually returns only a blank screen. (Amazingly, this is still superior to the debugging facilities provided by Azure.) Work around these shortcomings by adding a console type which sends output to a magically detected raw disk partition, and including such a partition within any iPXE .usb-format image. To use this facility: - build an iPXE .usb image with CONSOLE_INT13 enabled - boot the cloud VM from this image - after the boot fails, attach the VM's boot disk to a second VM - from this second VM, use "less -f -R /dev/sdb3" (or similar) to view the iPXE output. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Move real_to_user() to realmode.hMichael Brown2015-03-052-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | At some point in the past few years, binutils became more aggressive at removing unused symbols. To function as a symbol requirement, a relocation record must now be in a section marked with @progbits and must not be in a section which gets discarded during the link (either via --gc-sections or via /DISCARD/). Update REQUIRE_SYMBOL() to generate relocation records meeting these criteria. To minimise the impact upon the final binary size, we use existing symbols (specified via the REQUIRING_SYMBOL() macro) as the relocation targets where possible. We use R_386_NONE or R_X86_64_NONE relocation types to prevent any actual unwanted relocation taking place. Where no suitable symbol exists for REQUIRING_SYMBOL() (such as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to generate a one-byte-long symbol to act as the relocation target. If there are versions of binutils for which this approach fails, then the fallback will probably involve killing off REQUEST_SYMBOL(), redefining REQUIRE_SYMBOL() to use the current definition of REQUEST_SYMBOL(), and postprocessing the linked ELF file with something along the lines of "nm -u | wc -l" to check that there are no undefined symbols remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-025-5/+25
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-024-4/+20
| | | | | | | | | | | | | | | Relicence files with kind permission from the following contributors: Alex Williamson <alex.williamson@redhat.com> Eduardo Habkost <ehabkost@redhat.com> Greg Jednaszewski <jednaszewski@gmail.com> H. Peter Anvin <hpa@zytor.com> Marin Hannache <git@mareo.fr> Robin Smidsrød <robin@smidsrod.no> Shao Miller <sha0.miller@gmail.com> Thomas Horsten <thomas@horsten.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0215-15/+67
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Maintain a queue for received PXE UDP packetsMichael Brown2015-02-061-38/+85
| | | | | | | | | Some devices return multiple packets in a single poll. Handle such devices gracefully by enqueueing received PXE UDP packets (along with a pseudo-header to hold the IPv4 addresses and port numbers) and dequeueing them on subsequent calls to PXENV_UDP_READ. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Use tftp_uri() to construct PXE TFTP URIsMichael Brown2015-02-061-12/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tftp] Explicitly abort connection whenever parent interface is closedMichael Brown2015-02-061-10/+7Star
| | | | | | | | | Fetching the TFTP file size is currently implemented via a custom "tftpsize://" protocol hack. Generalise this approach to instead close the TFTP connection whenever the parent data-transfer interface is closed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Allow interrupts to be excluded from profiling resultsMichael Brown2014-05-041-2/+2
| | | | | | | | | Interrupt processing adds noise to profiling results. Allow interrupts (from within protected mode) to be profiled separately, with time spent within the interrupt handler being excluded from any other profiling currently in progress. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Profile all PXE API callsMichael Brown2014-05-031-6/+97
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Work around missing PXENV_UNDI_OPEN only when necessaryMichael Brown2014-05-031-2/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Profile UNDI transmit datapathMichael Brown2014-05-031-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Profile all PXE API callsMichael Brown2014-05-031-0/+49
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcbios] Do not switch to real mode to sleep the CPUMichael Brown2014-04-291-3/+3
| | | | | | | Now that we can handle interrupts while in protected mode, there is no need to switch to real mode just to halt the CPU. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcbios] Do not switch to real mode to check for timer interruptMichael Brown2014-04-291-4/+4
| | | | | | | | | | | | | The currticks() function is called at least once per TCP packet, and so is performance-critical. Switching to real mode just to allow the timer interrupt to fire is expensive when running inside a virtual machine, and imposes a significant performance cost. Fix by enabling interrupts without switching to real mode. This results in an approximately 100% increase in download speed when running under KVM. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Use built-in interrupt reflectorMichael Brown2014-04-292-43/+0Star
| | | | | | | | We now have the ability to handle interrupts while in protected mode, and so no longer need to set up a dedicated interrupt descriptor table while running COM32 executables. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--timeout" parameter to image downloading commandsMichael Brown2014-03-101-2/+3
| | | | | | | | | | | | | | | | | | iPXE will detect timeout failures in several situations: network link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc. This does not cover all possible circumstances. For example, if a connection to a web server is successfully established and the web server acknowledges the HTTP request but never sends any data in response, then no timeout will be triggered. There is no timeout defined within the HTTP specifications, and the underlying TCP connection will not generate a timeout since it has no way to know that the HTTP layer is expecting to receive data from the server. Add a "--timeout" parameter to "imgfetch", "chain", etc. If no progress is made (i.e. no data is downloaded) within the timeout period, then the download will be aborted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Rename "console" command's --bpp option to --depthMichael Brown2014-01-221-1/+1
| | | | | | | | | | Rename the "--bpp" option to "--depth", to free up the single-letter option "-b" for "--bottom" in preparation for adding margin support. This does not break backwards compatibility with documented features, since the "console" command has not yet been documented. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Allow for an arbitrary margin around the text areaMichael Brown2014-01-221-11/+31
| | | | | | | | | | | | | | Allow for an arbitrary margin to be specified in the console configuration. If the actual screen size does not match the requested screen size, then update any margins specified so that they remain in the same place relative to the requested screen size. If margins are unspecified (i.e. zero), then leave them as zero. The underlying assumption here is that any specified margins are likely to describe an area within a background picture, and so should remain in the same place relative to that background picture. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fbcon] Allow for an arbitrary margin around the text areaMichael Brown2014-01-221-2/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Handle failures from fbcon_init()Michael Brown2014-01-221-9/+27
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Set "magic" colour to transparent when a background picture is usedMichael Brown2013-12-091-0/+6
| | | | | | | Use the magic colour facility to cause the user interface background to become transparent when we have a background picture. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Work around data corruption bug in bochs/qemu VBE implementationMichael Brown2013-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vgabios used by bochs and qemu (and other virtualisation products) has a bug in its implementation of INT 10,4f00 which causes the high 16 bits of %ebx and %edx to become corrupted. The vgabios code uses a "pushaw"/"popaw" pair to preserve the low 16 bits of all non-segment registers. The vgabios code is compiled using bcc, which generates 8086-compatible code and so never touches the high 16 bits of the 32-bit registers. However, the function vbe_biosfn_return_controller_information() includes the line: size_64k = (Bit16u)((Bit32u)cur_info->info.XResolution * cur_info->info.XResolution * cur_info->info.BitsPerPixel) >> 19; which generates an implicit call to the "lmulul" function. This function is implemented in vbe.c as: ; helper function for memory size calculation lmulul: and eax, #0x0000FFFF shl ebx, #16 or eax, ebx SEG SS mul eax, dword ptr [di] mov ebx, eax shr ebx, #16 ret which modifies %eax, %ebx, and %edx (as a result of the "mul" instruction, which places its result into %edx:%eax). Work around this problem by marking %ebx and %edx as being clobbered by the call to INT 10,4f00. (%eax is already used as an output register, so does not need to be on the clobber list.) Reported-by: Oliver Rath <rath@mglug.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Provide access to SMBIOS via /dev/memMichael Brown2013-12-051-40/+12Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>