summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include
Commit message (Collapse)AuthorAgeFilesLines
* [dhcp] Automatically generate vendor class identifier stringMichael Brown2016-07-042-10/+0Star
| | | | | | | | | | | | The vendor class identifier strings in DHCP_ARCH_VENDOR_CLASS_ID are out of sync with the (correct) client architecture values in DHCP_ARCH_CLIENT_ARCHITECTURE. Fix by removing all definitions of DHCP_ARCH_VENDOR_CLASS_ID, and instead generating the vendor class identifier string automatically based on DHCP_ARCH_CLIENT_ARCHITECTURE and DHCP_ARCH_CLIENT_NDI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Allow for variable encapsulation of architecture-specific optionsMichael Brown2016-07-042-14/+12Star
| | | | | | | | | | | | | DHCPv4 and DHCPv6 share some values in common for the architecture- specific options (such as the client system architecture type), but use different encapsulations: DHCPv4 has a single byte for the option length while DHCPv6 has a 16-bit field for the option length. Move the containing DHCP_OPTION() and related wrappers from the individual dhcp_arch.h files to dhcp.c, thus allowing for the architecture-specific values to be reused in dhcpv6.c. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Support COMBOOT in 64-bit buildsMichael Brown2016-04-151-132/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [gdb] Add support for x86_64Michael Brown2016-03-221-6/+4Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Use generic set_bit() functionMichael Brown2016-03-161-23/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Provide an abstraction wrapper for prot_callMichael Brown2016-02-191-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Add bin-x86_64-pcbios build platformMichael Brown2016-02-1654-5429/+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 librm to be compiled for x86_64Michael Brown2016-02-161-3/+12
| | | | | | | This commit does not make librm functional for x86_64; it merely allows it to compile without errors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.hMichael Brown2016-02-164-22/+30
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Add check_bios_interrupts() debug functionMichael Brown2016-01-121-0/+1
| | | | | | | | 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>
* [vmware] Expose GuestRPC mechanism in 64-bit buildsMichael Brown2016-01-052-149/+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>
* [pxe] Construct all fake DHCP packets before starting PXE NBPMichael Brown2015-08-291-0/+1
| | | | | | | | | | | | | | | | 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>
* [libc] Add ffs(), ffsl(), and ffsll()Michael Brown2015-03-161-1/+45
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Move real_to_user() to realmode.hMichael Brown2015-03-052-12/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [libc] Rewrite byte-swapping codeMichael Brown2015-03-021-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite setjmp() and longjmp()Michael Brown2015-03-021-18/+28
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0210-14/+24
| | | | | | | | | | 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-0248-48/+48
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [timer] Rewrite the 8254 Programmable Interval Timer supportMichael Brown2015-02-172-17/+3Star
| | | | | | | | The 8254 timer code (used to implement udelay()) has an unknown provenance. Rewrite this code to avoid potential licensing uncertainty. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Add support for Hyper-V hypervisorMichael Brown2014-12-182-73/+72Star
| | | | | | | Add support for detecting and communicating with the Hyper-V hypervisor. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Support displaying and hiding cursorMichael Brown2014-08-061-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Add functions to read and write model-specific registersMichael Brown2014-07-231-0/+38
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Speed up protected-to-real mode transition under KVMMichael Brown2014-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On an Intel CPU supporting VMX, KVM will emulate instructions while the CPU state remains "invalid". In real mode, the CPU state is defined to be "invalid" if any segment register has a base which is not equal to (sreg<<4) or a limit which is not equal to 64kB. We don't actually use the base stored in the REAL_DS descriptor for any significant purpose. Change the base stored in this descriptor to be equal to (REAL_DS<<4). A segment register loaded with REAL_DS is then automatically valid in both real and protected modes. This allows KVM to stop emulating instructions much sooner. The only use of REAL_DS for memory accesses currently occurs in the indirect ljmp within prot_to_real. Change this to a direct ljmp, storing rm_cs in .text16 as part of the ljmp instruction. This removes the only memory access via REAL_DS (thereby allowing for the above descriptor base address hack), and also simplifies the ljmp instruction (which will still have to be emulated). Load the real-mode interrupt descriptor table register before switching to real mode, since this avoids triggering an EXCEPTION_NMI and corresponding VM exit. This reduces the time taken by prot_to_real under KVM by around 65%. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Use built-in interrupt reflectorMichael Brown2014-04-291-45/+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>
* [librm] Allow interrupts in protected modeMichael Brown2014-04-292-0/+75
| | | | | | | | When running in a virtual machine, switching to real mode may be expensive. Allow interrupts to be enabled while in protected mode and reflected down to the real-mode interrupt handlers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Add generic profiling infrastructureMichael Brown2014-04-281-0/+28
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add flsll()Michael Brown2014-04-271-0/+50
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix __libgcc attribute for recent gcc versionsMichael Brown2014-04-251-0/+11
| | | | | | | | | | | | | | | | | | We observed some time ago (in commit 4ce8d61 "Import various libgcc functions from syslinux") that gcc seems to treat calls to the implicit arithmetic functions (e.g. __udivdi3()) as being affected by -mregparm but unaffected by -mrtd. This seems to be no longer the case with current gcc versions, which treat calls to these functions as being affected by both -mregparm and -mrtd, as expected. There is nothing obvious in the gcc changelogs to indicate precisely when this happened. From experimentation with available gcc versions, the change occurred sometime between v4.6.3 and v4.7.2. We assume that only versions up to v4.6.x require the special treatment. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uaccess] Add memcmp_user()Michael Brown2014-01-121-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vesafb] Add VESA frame buffer consoleMichael Brown2013-11-281-0/+210
| | | | | | | | | | | 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>
* [bzimage] Align initrd images to page boundaryMichael Brown2013-06-051-2/+3
| | | | | | | | | | | | | | | | | | | | Some versions of Linux apparently complain if initrds are not aligned to a page boundary. Fix by changing INITRD_ALIGN from 4 bytes to 4096 bytes. The amount of padding at the end of each initrd will now often be sufficient to allow the cpio header to be prepended without crossing an alignment boundary. The final location of the initrd may therefore end up being slightly higher than the post-shuffle location. bzimage_load_initrd() must therefore now copy the initrd body prior to copying the cpio header, otherwise the start of the initrd body may be overwritten by the cpio header. (Note that the guarantee that an initrd will never need to overwrite an initrd at a higher location still holds, since the overall length of each initrd cannot decrease as a result of adding a cpio header.) Reported-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Redefine low 8 bits of error code as "platform error code"Michael Brown2013-04-193-0/+239
| | | | | | | | | | The low 8 bits of an iPXE error code are currently defined as the closest equivalent PXE error code. Generalise this scheme to platforms other than PC-BIOS by extending this definition to "closest equivalent platform error code". This allows for the possibility of returning meaningful errors via EFI APIs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add ability to perform a warm rebootMichael Brown2013-03-221-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add "reboot" command for EFIMichael Brown2013-03-222-0/+32
| | | | | | | | | 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>
* [build] Avoid strict-aliasing warning for gcc 4.3Bo Yang2013-03-211-2/+2
| | | | | Signed-off-by: Bo Yang <boyang@suse.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Split out ISO9660 and El Torito definitions to separate header filesMichael Brown2013-03-201-116/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [initrd] Add ability to reshuffle initrds into image list orderMichael Brown2012-11-121-0/+29
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uaccess] Add userptr_sub() to find the difference between two user pointersMichael Brown2012-11-051-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sdi] Add support for SDI imagesMichael Brown2012-09-051-0/+39
| | | | | | | Add support (disabled by default) for booting .sdi images as used by Windows XP Embedded. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Generalise i386 raw I/O API to x86Michael Brown2012-07-172-167/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Add PXENV_FILE_CMDLINE API callMichael Brown2012-07-112-0/+22
| | | | | | | Allow a PXE NBP to obtain its command line (if any) via the new PXE API call PXENV_FILE_CMDLINE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "cpuid" commandMichael Brown2012-06-071-86/+0Star
| | | | | | | Allow x86 CPU feature flags (such as support for 64-bit mode) to be checked using the "cpuid" command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Merge i386 and x86_64 versions of errfile.hMichael Brown2012-06-061-46/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Allow settings to be specified in the VMware .vmx fileMichael Brown2012-04-171-0/+1
| | | | | | | | | | | | | Allow iPXE settings to be specified in the .vmx file via the VMware GuestInfo mechanism. For example: guestinfo.ipxe.filename = "http://boot.ipxe.org/demo/boot.php" guestinfo.ipxe.dns = "192.168.0.1" guestinfo.ipxe.net0.ip = "192.168.0.15" guestinfo.ipxe.net0.netmask = "255.255.255.0" guestinfo.ipxe.net0.gateway = "192.168.0.1" Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for emulating floppy disk drivesMichael Brown2012-03-302-0/+53
| | | | | Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Add RTC-based time sourceMichael Brown2012-03-193-0/+103
| | | | | | Add a time source using the CMOS RTC to obtain the current time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Define an API for getting the current timeMichael Brown2012-03-191-0/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>