summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface/pcbios
Commit message (Collapse)AuthorAgeFilesLines
* [bios] Add bin-x86_64-pcbios build platformMichael Brown2016-02-1613-3896/+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 intptr_t when casting .text16 function pointersMichael Brown2016-02-162-6/+4Star
| | | | 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>
* [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>
* [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>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | | | | 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-021-1/+5
| | | | | | | | | | | | | | | 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-0210-10/+42
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). 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>
* [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>
* [vesafb] Select an optimal mode, rather than the first acceptable modeMichael Brown2013-11-281-49/+91
| | | | | | | | | | | | | | | | | | There is no requirement for VBE modes to be listed in increasing order of resolution. With the present logic, this can cause e.g. a 1024x768 mode to be selected if the user asks for 640x480, if the 1024x768 mode is earlier in the mode list. Define a scoring system for modes as score = ( width * height - bpp ) and choose the mode with the lowest score among all acceptable modes. This should prefer to choose the mode closest to the requested resolution, with a slight preference for higher colour depths. Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Return meaningful error when no suitable mode is foundMichael Brown2013-11-281-44/+75
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Skip modes for which we cannot get mode informationMichael Brown2013-11-281-2/+1Star
| | | | | | | | | The VirtualBox BIOS fails to retrieve mode information (with status 0x0100) for some modes within the mode list. Skip any such modes, rather than treating this as a fatal error. Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Include raw status value within VBE error messagesMichael Brown2013-11-281-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Add VESA frame buffer consoleMichael Brown2013-11-281-0/+420
| | | | | | | | | | | The VESA frame buffer console uses the VESA BIOS extensions (VBE) to enumerate video modes, selects an appropriate mode, and then hands off to the generic frame buffer code. The font is extracted from the VGA BIOS, avoiding the need to provide an external font file. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "poweroff" commandMarin Hannache2013-07-151-0/+108
| | | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add ability to perform a warm rebootMichael Brown2013-03-221-1/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add "reboot" command for EFIMichael Brown2013-03-221-0/+41
| | | | | | | | | Abstract out the ability to reboot the system to a separate reboot() function (with platform-specific implementations), add an EFI implementation, and make the existing "reboot" command available under EFI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Provide SMBIOS version number via smbios_version()Michael Brown2013-03-201-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Split out ISO9660 and El Torito definitions to separate header filesMichael Brown2013-03-201-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Split largest_memblock() function out from init_eheap()Michael Brown2012-11-061-49/+8Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Use correct size when estimating floppy disk geometryMichael Brown2012-09-141-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-207-7/+14
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Fix compilation on some versions of gccMichael Brown2012-04-101-4/+3Star
| | | | | | | | | Using __from_text16() and __from_data16() in inline asm constraints sometimes defeats gcc's ability to simplify expressions down to compile-time constants. Reported-by: Jason Kohles <jkohles@palantir.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for emulating floppy disk drivesMichael Brown2012-03-301-56/+244
| | | | | Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Unhide umalloc()ed memory region when there are no allocationsMichael Brown2012-03-271-1/+2
| | | | | | | | At present, we always hide an extra sizeof(struct external_memory), to account for the header on the lowest allocated block. This header ceases to exist when there are no allocated blocks remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Fail allocations when we run out of external memoryMichael Brown2012-03-271-7/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix compilation under CygwinMichael Brown2012-03-231-1/+1
| | | | | Originally-fixed-by: Steve Goodrich <steve.goodrich@se-eng.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Add RTC-based time sourceMichael Brown2012-03-192-39/+138
| | | | | | Add a time source using the CMOS RTC to obtain the current time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Allow entropy_enable() to return an errorMichael Brown2012-03-181-1/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add RTC-based entropy sourceMichael Brown2012-02-281-0/+233
| | | | | | | | | | | The RTC-based entropy source uses the nanosecond-scale CPU TSC to measure the time between two 1kHz interrupts generated by the CMOS RTC. In a physical machine these clocks are driven from independent crystals, resulting in some observable clock drift. In a virtual machine, the CMOS RTC is typically emulated using host-OS constructions such as SIGALRM. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Provide a permanently closed window via the control interfaceMichael Brown2011-06-281-0/+15
| | | | | | | Allow objects to support both streaming and block device protocols, by starting streaming data only when the data transfer window opens. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Catch INT 13,4b when no explicit drive number is presentMichael Brown2011-04-281-2/+7
| | | | | | | | | This allows older versions of ELTORITO.SYS (such as the version found on the FreeDOS installation CD-ROM) to use iPXE's emulated CD-ROM drive. Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for INT 13,4bMichael Brown2011-04-281-4/+46
| | | | | | | This allows the ELTORITO.SYS driver for MS-DOS to access our emulated CD-ROM drives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for El Torito bootable CD-ROM imagesMichael Brown2011-04-271-48/+353
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sanboot] Add "sanhook" and "sanunhook" commandsMichael Brown2011-04-241-7/+5Star
| | | | | | | Expose the multiple-SAN-drive capability of the iPXE core via the iPXE command line by adding commands to hook and unhook additional drives. 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>
* [int13] Add missing "static" modifierMichael Brown2011-02-221-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Replace pci_max_bus() with pci_num_bus()Michael Brown2011-02-171-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>