summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
* [pcbios] Allow for larger-than-20-byte buffers in e820mangler.SMichael Brown2008-09-291-14/+45
| | | | | | | | | | Although the E820 API allows for a caller to provide only a 20-byte buffer, there exists at least one combination (HP BIOS, 32-bit WinPE) that relies on information found only in the "extended attributes" field, which requires a 24-byte buffer. Allow for up to a 64-byte E820 buffer, in the hope of coping with future idiocies like this one.
* [pcbios] Print INT 15,E820 extended attributes, if presentMichael Brown2008-09-291-3/+43
| | | | | | | | | | | | | The ACPI specification defines an additional 4-byte field at offset 20 for an E820 memory map entry. This field is presumably optional, since generally E820 gets given only a 20-byte buffer to fill. However, the bits of this optional field are defined as: bit 0 : region is enabled bit 1 : region is non-volatile memory rather than RAM so it seems as though callers that pass in only a 20-byte buffer may be missing out on some rather important information.
* [gdb] Fix a compiler warning that shows up only when assertions are enabledMichael Brown2008-09-291-2/+2
| | | | | gcc should (I think) be warning about this anyway, but seems to do so only when assertions are enabled for this object.
* [pcbios] Save/restore %es in INT 15,e820Michael Brown2008-09-291-0/+2
| | | | | | | Our INT 15,e820 code was setting %es=%ss (as part of the "look ahead in the memory map" logic), but failing to restore %es afterwards. This is a serious bug, but wasn't affecting many platforms because almost all callers seem to set %es=%ss anyway.
* [i386] Add dump_regs() debug callMichael Brown2008-09-291-0/+23
| | | | | Use as "call dump_regs" from any real-mode code within .text16. Should preserve all registers and flags.
* [romprefix] Fully clear the "Press B to boot..." message when INT19 is usedMichael Brown2008-09-261-1/+1
|
* [pcbios] Fetch INT 15,e820 entry directly into our e820 cacheMichael Brown2008-09-251-19/+9Star
| | | | | | | | | | | | | | | | | | | | Some BIOSes require us to pass in not only the continuation value (in %ebx) as returned by the previous call to INT 15,e820 but also the unmodified buffer (at %es:%di) as returned by the previous call to INT 15,e820. Apparently, someone thought it would be a worthwhile optimisation to fill in only the low dword of the "length" field and the low byte of the "type field", assuming that the buffer would remain unaltered from the previous call. This problem was being triggered by the "peek ahead" logic in get_mangled_e820(), which would read the next entry into a temporary buffer in order to be able to guarantee terminating the map with %ebx=0 rather than CF=1. (Terminating with CF=1 upsets some Windows flavours, despite being documented legal behaviour.) Work around this problem by always fetching directly into our e820 cache; that way we can guarantee that the underlying call always sees the previous buffer contents (and the same buffer address).
* [pcbios] Add facility for testing arbitrary E820 memory mapsMichael Brown2008-09-253-0/+112
| | | | | | | | | | We seem to be having issues with various E820 memory maps. These problems are often difficult to reproduce, requiring access to the specific system exhibiting the problem. Add a facility for hooking in a fake E820 map generator, using an arbitrary map defined in a C array, solely in order to be able to test the map-mangling code against arbitrary E820 maps.
* [romprefix] Allow BANNER_TIMEOUT to control banners in romprefix.SMichael Brown2008-09-251-18/+26
| | | | | | | | In particular, allow BANNER_TIMEOUT=0 to inhibit the prompt banners altogether. Ironically, this request comes from the same OEM that originally required the prompts to be present during POST.
* [pxe] Enable interrupts before starting PXE NBP executionMichael Brown2008-09-241-0/+1
| | | | Based on a patch provided by XenSource for Etherboot 5.4.
* [pcbios] Inhibit INT 15 memory map hiding on brain-dead BIOSesMichael Brown2008-09-241-0/+27
| | | | | | | | | | | | | | Some really moronic BIOSes bring up the PXE stack via the UNDI loader entry point during POST, and then don't bother to unload it before overwriting the code and data segments. If this happens, we really don't want to leave INT 15 hooked, because that will cause any loaded OS to die horribly as soon as it attempts to fetch the system memory map. We use a heuristic to detect whether or not we are being loaded at the top of free base memory. If we determine that we are being loaded at some other arbitrary location in base memory, then we assume that it's not safe to hook INT 15.
* [romprefix] If we hook INT 19, prompt before attempting bootMichael Brown2008-09-241-44/+107
| | | | | | | On non-BBS systems we hook INT 19, since there is no other way we can guarantee gaining control of the flow of execution. If we end up doing this, prompt the user before attempting boot, since forcibly capturing INT 19 is rather antisocial.
* [pcbios] Sanity-check the INT15,e820 and INT15,e801 memory mapsMichael Brown2008-09-241-0/+33
| | | | | Some systems seem to report insane memory maps (particularly at POST time). Detect and work around some of the common failure cases.
* [relocate] Guard against systems that report empty memory regionsMichael Brown2008-09-231-5/+10
| | | | | | | | | If the INT 15,e820 memory map reports a region [0,0), this confuses the "truncate to even megabytes" logic, which ends up rounding the region 'down' to [0,fff00000). Fix by ensuring that the region's end address is at least 1, before we subtract 1 to obtain the "last byte in region" address.
* [memmap] Allow for 4GB+ systems in debug messageMichael Brown2008-09-231-3/+3
| | | | | | INT 15,e801 is capable of returning a memory range that extends to 4GB, so allow for this in the debug message that shows the data returned by INT 15,e801.
* [undi] Scan for UNDI ROMs on 512-byte boundaries rather than 2kB boundariesMichael Brown2008-09-121-2/+2
| | | | | | | | | Apparently some BIOSes will place option ROMs on 512-byte boundaries. While this is against specification, it doesn't actually hurt anything, so we may as well increase our scan granularity to 512 bytes. Contributed by Luca <lucarx76@gmail.com>
* [pcbios] Add extra debugging messages relating to the system memory mapMichael Brown2008-09-072-4/+17
|
* [pxe] Add a dummy PXENV+ entry point at UNDI_CS:0000Michael Brown2008-09-062-1/+13
| | | | | | | | | Wyse Streaming Manager server (WLDRM13.BIN) assumes that the PXENV+ entry point is at UNDI_CS:0000; apparently, somebody at Wyse has difficulty distinguishing between the words "may" and "must"... Add a dummy entry point at UNDI_CS:0000, which just jumps to the correct entry point.
* [multiboot] Allow for unspecified {load,bss}_end_addr for raw imagesMichael Brown2008-09-061-2/+5
| | | | | | | The multiboot specification states that, for raw images, if load_end_addr is zero then it should be interpreted as meaning "use the entire file", and if bss_end_addr is zero it should be interpreted as meaning "no bss".
* [libprefix] Add addr32 prefix required by older assemblersEygene Ryabinkin2008-09-041-1/+1
| | | | | | | | | | Explicitly state that we are using 32-bit addressing in 16-bit code. GNU as 2.15 (FreeBSD/amd64 7-STABLE) got confused that 32-bit registers are used in the code that was declared as 16-bit. Add explicit modifier 'addr32' to make assembler happy. Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
* [comboot] Add COMBOOT and COM32 supportDaniel Verkamp2008-08-2910-0/+1630
|
* [librm] Add rm stack copying functionsDaniel Verkamp2008-08-292-0/+48
|
* [librm] Make rm_sp and rm_ss globals againDaniel Verkamp2008-08-282-0/+4
|
* [libc] Mark setjmp and longjmp as __cdeclDaniel Verkamp2008-08-281-2/+2
|
* [pxe] Fill in UNDIROMID pointer in !PXE structureMichael Brown2008-08-284-6/+30
| | | | | | IBM's iSCSI Firmware Initiator checks the UNDIROMID pointer in the !PXE structure that gets created by the UNDI loader. We didn't previously fill this value in.
* [romprefix] Add UNDI ROMID structure bus type fieldMichael Brown2008-08-271-0/+1
| | | | | The IBM iSCSI Firmware Initiator complains that we don't have a bus type field in the UNDI ROMID structure, so include one.
* [romprefix] Preserve %edi when issuing INT 1A,B101Michael Brown2008-08-261-1/+3
| | | | INT 1A,B101 (get PCI BIOS version) will overwrite %edi.
* [romprefix] Add more diagnostic messages to ROM prefixMichael Brown2008-08-261-27/+28
| | | | | | | | | Include PMM allocation result in POST banner. Include full product string in "starting execution" message. Also mark ourselves as supporting DDIM in PnP header, for completeness.
* [romprefix] Fix regression in UNDI loaderMichael Brown2008-08-231-2/+2
| | | | | Commit 12f203c introduced a bug that caused the UNDI loader to attempt to load the UNDI code and data segments to incorrect addresses.
* [romprefix] On a PCI3.0, non-BBS system, use the correct %cs for INT19Michael Brown2008-08-221-26/+45
| | | | | | | | On a system that doesn't support BBS, we end up hooking INT19 to gain control of the boot process. If the system is PCI3.0, we must take care to use the runtime value for %cs, rather than the POST-time value, otherwise we end up pointing INT19 to the temporary option ROM POST scratch area.
* [elf] Add execution entry point debug messages for elf/multiboot imagesMichael Brown2008-08-222-0/+3
|
* [smbios] Print SMBIOS version number in debugging messagesMichael Brown2008-08-191-2/+2
|
* [pcbios] Support arbitrary splits of the e820 memory mapMichael Brown2008-08-184-350/+121Star
| | | | | | | | | | | | | | | | | | | | | | Allow for an arbitrary number of splits of the system memory map via INT 15,e820. Features of the new map-mangling algorithm include: Supports random access to e820 map entries. Requires only sequential access support from the underlying e820 map, even if our caller uses random access. Empty regions will always be stripped. Always terminates with %ebx=0, even if the underlying map terminates with CF=1. Allows for an arbitrary number of hidden regions, with underlying regions split into as many subregions as necessary. Total size increase to achieve this is 193 bytes.
* [pcbios] Prepare for multiple splits of hidden e820 memory regionsMichael Brown2008-08-182-2/+328
| | | | | | | | | | | | | | | | | | | Define a list of N allowed memory regions, and split each underlying e820 region into up to N subregions. Strip resulting empty regions out of the map, avoiding using the "return with CF set to strip last empty region" trick, because it seems that bootmgr.exe in Win2k8 gets upset if the memory map is terminated with CF set. This is an intermediate checkin that defines a single allowed memory region covering the entire 64-bit address space, and uses the existing map-mangling code on top of the new region-splitting code. This sanitises the memory map to the point that Win2k8 is able to boot even on a system that defines a final zero-length region at the 4GB mark. I'm checking this in because it may be useful for future debugging efforts to be able to run with the existing and known-working map mangling code together with the map sanitisation capabilities of the new map mangling code.
* [romprefix] Fix ROM image copy on PCI 3.0 BIOSesMichael Brown2008-08-061-1/+3
| | | | | | | Add the missing instructions to the code path that I never tested due to not having a PCI 3.0 system available. (D'oh)
* [romprefix] Update PCI ROM structure to PCI 3.0Michael Brown2008-07-301-20/+84
|
* [prefix] Reasonable value for lkrn initrd_addr_maxStefan Hajnoczi2008-07-301-2/+8
| | | | | | | | | | | H. Peter Anvin <hpa@zytor.com> sent word that Sergey Vlasov <vsu@altlinux.ru> discovered gPXE lkrn images fail to load in SYSLINUX 3.70 because we have initrd_addr_max zeroed. This patch sets the same value as the Linux kernel. Also change the header jmp instruction to use a hardcoded opcode value like Linux does. Just in case the assembler decides to use a three-byte instruction instead of the desired two-byte jmp.
* [smbios] Add named settings for manufacturer, product name, and serial no.Michael Brown2008-07-271-0/+28
|
* [iSCSI] Support Windows Server 2008 direct iSCSI installationMichael Brown2008-07-175-5/+5
| | | | | | | | | | | | | Add yet another ugly hack to iscsiboot.c, this time to allow the user to inhibit the shutdown/removal of the iSCSI INT13 device (and the network devices, since they are required for the iSCSI device to function). On the plus side, the fact that shutdown() now takes flags to differentiate between shutdown-for-exit and shutdown-for-boot means that another ugly hack (to allow returning via the PXE stack on BIOSes that have broken INT 18 calls) will be easier. I feel dirty.
* [int13] Pairwise swap drive numbers, instead of shifting all drive numbersMichael Brown2008-07-162-22/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shifting all INT13 drive numbers causes problems on systems that use a sparse drive number space (e.g. qemu BIOS, which uses 0xe0 for the CD-ROM drive). The strategy now is: Each drive is assigned a "natural" drive number, being the next available drive number in the system (based on the BIOS drive count). Each drive is accessed using its specified drive number. If the specified drive number is -1, the natural drive number will be used. Accesses to the specified drive number will be delivered to the emulated drive, masking out any preexisting drive using this number. Accesses to the natural drive number, if different, will be remapped to the masked-out drive. The overall upshot is that, for examples: System has no drives. Emulated INT13 drive gets natural number 0x80 and specified number 0x80. Accesses to drive 0x80 go to the emulated drive, and there is no remapping. System has one drive. Emulated INT13 drive gets natural number 0x81 and specified number 0x80. Accesses to drive 0x80 go to the emulated drive. Accesses to drive 0x81 get remapped to the original drive 0x80.
* [bzimage] Kill off the initrd image typeMichael Brown2008-07-081-3/+2Star
| | | | | | | We can just treat all non-kernel images as initrds, which matches our behaviour for multiboot kernels. This allows us to eliminate initrd as an image type, and treat the "initrd" command as just another synonym for "imgfetch".
* [i386] Change semantics of __from_data16 and __from_text16Michael Brown2008-07-016-22/+19Star
| | | | | | | | | __from_data16 and __from_text16 now take a pointer to a .data16/.text16 variable, and return the real-mode offset within the appropriate segment. This matches the use case for every occurrence of these macros, and prevents potential future bugs such as that fixed in commit d51d80f. (The bug arose essentially because "&pointer" is still syntactically valid.)
* [lkrnprefix] Make gPXE .lkrn images conform to the zImage 2.07 formatStefan Hajnoczi2008-06-301-39/+88
|
* [bzImage] Support loading zImage kernelsStefan Hajnoczi2008-06-301-1/+3
| | | | | zImage kernels require the real-mode portion to be loaded at 9000:0000 rather than 1000:0000.
* [GDB] Remove unused DR6 debug register variableStefan Hajnoczi2008-06-301-4/+3Star
|
* [GDB] Zero-extend 16-bit segment registersStefan Hajnoczi2008-06-301-6/+12
| | | | | | | When the 16-bit segment registers are accessed using 32-bit instructions the high order bytes are undefined on older CPUs. We now explicitly zero the high order bytes when snapshotting the CPU state. This ensures that the GDB stub reports consistent values for the segment registers.
* [GDB] Add copyright header for gdbmach.cStefan Hajnoczi2008-06-301-0/+24
|
* [GDB] Add watch and rwatch hardware watchpointsStefan Hajnoczi2008-06-303-1/+140
|
* [romprefix] Fix PMM detection start addressMichael Brown2008-06-291-1/+1
| | | | | | | | | Commit fd0aef9 introduced a typo that caused PMM detection to start at paragraph 0xe00 rather than 0xe000. (Detection would still work, since it would scan until it ran out of base memory, but it would end up scanning an unnecessarily large portion of base memory.) Spotted by Sebastian Herbszt <herbszt@gmx.de>.
* [a20] Send a null command to the KBC after changing A20H. Peter Anvin2008-06-271-0/+3
| | | | | | | | | | | | Send a null command, specifically "pulse outputs" with no outputs selected, to the KBC after changing A20. This was apparently done by DOS, presumably as a synchronization hack, and the authors of the UHCI spec thought it was inherent. Therefore, there are systems out there (e.g. HP DL360 G5) which will stop responsing to "legacy USB" unless they see the null command, 0xFF, written to port 0x64 at the end of the A20 toggling sequence. Signed-off-by: H. Peter Anvin <hpa@zytor.com>