Michael Brown
f8a0b5f682
Use internal 16-bit stack for added safety.
2008-02-11 15:06:26 +00:00
H. Peter Anvin
9aec835541
undiisr.S: save/restore upper half of %eflags
...
Since we don't know what the UNDI code does, it is safest to
save/restore %eflags even though the lower half of %eflags is
automatically saved by the interrupt itself.
2008-02-10 18:13:39 -08:00
H. Peter Anvin
621c2886aa
UNDI ISR: save and restore 32-bit registers
...
As written, if the if the UNDI ISR call clobbers the upper halves of
any of the GPRs (which by convention it is permitted to do, and by
paranoia should be expected to do) then nothing in the interrupt
handler will recover the state.
Additionally, save/restore %fs and %gs out of sheer paranoia - it's a
cheap enough operation, and may prevent problems due to poorly written
UNDI stacks.
2008-02-10 18:06:10 -08:00
Michael Brown
2c7a9e803c
Remove the (unused) option to override _prefix_link_addr,
...
_textdata_link_addr, _load_addr and _max_align in the linker scripts.
A bug in some versions of ld causes segfaults if the DEFINED() macro
is used in a linker script *and* the -Map option to ld is present.
We don't currently need to override any of these values; if we need to
do so in future then the solution will probably be to always specify
the values on the ld command line, and have the linker script not
define them at all.
2007-12-07 01:34:11 -06:00
Michael Brown
1949641d10
Fix compiler warnings that appear only on OpenBSD.
2007-12-06 14:16:46 -06:00
Michael Brown
26f3a09ccf
Add UUID to DHCP request as option 97 (if available).
2007-11-21 03:29:53 +00:00
Michael Brown
899f5b8ab2
Added definition of a UUID and uuid_ntoa() (for debugging), and
...
implemented smbios_get_uuid().
2007-11-21 02:27:07 +00:00
Michael Brown
68c438954d
Update SMBIOS internal API to be easier to use, and not to require
...
potentially exorbitant amounts of stack space.
2007-11-21 01:58:27 +00:00
Michael Brown
89eaab79c8
Replace "Etherboot" strings with "gPXE".
2007-11-20 02:00:54 +00:00
Michael Brown
755cb8379d
Allow space for the kernel's real-mode .bss. Previously we weren't
...
allowing any space for this, which makes it surprising that bzImage
loading ever worked.
2007-11-04 04:27:38 +00:00
Michael Brown
c482fef058
Add missing attribute(packed) to two structures.
2007-10-29 21:22:00 +00:00
Michael Brown
35ee7e4479
Ensure that empty e820 regions are skipped even at the end of the
...
memory map. (We achieve this by setting CF on the last entry if it is
zero-length; this avoids the need to look ahead to see at each entry
if the *next* entry would be both the last entry and zero-length).
This fixes the "0kB base memory" error message upon starting Windows
2003 on a SunFire X2100.
2007-10-10 20:13:34 +01:00
Michael Brown
56550e400e
Redefine bzimage_exec_context::mem_limit to be the highest permissible
...
byte, rather than the number of permissible bytes (i.e. subtract one
from the value under the previous definition to get the value under
the new definition).
This avoids integer overflow on 64-bit kernels, where
bzhdr.initrd_addr_max may be 0xffffffffffffffff; under the old
behaviour we set mem_limit equal to initrd_addr_max+1, which meant it
ended up as zero. Kernel loads would fail with ENOBUFS.
2007-09-28 01:23:06 +01:00
Michael Brown
881dd8e102
Switch rm_ss and rm_sp back to being words; it'll make it less
...
confusing to read the code.
2007-09-25 20:16:32 +01:00
Michael Brown
42d96bcb07
Don't use the "rep ss movsb" trick to copy the RM stack to the PM
...
stack; it breaks vmxassist.
2007-09-25 20:14:20 +01:00
Michael Brown
0ed066bc50
rm_ss, rm_sp, and pm_esp don't need to be accessed from anywhere
...
outside of librm.S.
2007-09-25 19:20:38 +01:00
Michael Brown
b8a8eea850
Minor refactoring to eliminate duplication.
2007-09-25 19:06:38 +01:00
Michael Brown
dec325fe43
Use full protected mode for access to high memory within prefix, to
...
work around limitations in real-mode virtualisation support on Intel
VT-capable chips.
2007-09-25 18:01:15 +01:00
Michael Brown
a7eee64506
Added more verbose memory-map debugging.
...
Added redundant call to get_memmap() in int13_boot() immediately
before jumping to boot sector, to assist in debugging.
2007-09-21 18:33:17 +01:00
Michael Brown
9c264faa0c
Add const attribute to byte-swapping functions
2007-09-21 01:15:06 +01:00
Michael Brown
a82e6ec2de
Added missing .kpxe prefix.
2007-09-06 15:08:41 +01:00
Michael Brown
01b755704a
Auto-assign drive number only if set to 0xff; almost all applications
...
require that we use drive 0x80, so it should probably be the default.
2007-08-23 20:50:24 +01:00
Michael Brown
eff8b06eff
Separate out arch-independent parts of stdint.h
2007-08-17 19:51:08 +01:00
Michael Brown
950057eeed
Add PXE FILE API.
2007-08-04 01:23:37 +01:00
Michael Brown
688bac1656
Place multiboot command lines in base memory; Xen won't pick them up
...
otherwise. :(
2007-08-02 23:09:03 +01:00
Michael Brown
d4947c05b2
Allow images to hold references to the originating URI.
...
Some shuffling around of the image management code; this needs tidying up.
2007-08-02 20:18:32 +01:00
Michael Brown
9fd6a0418f
Allowed zero-cost enforced ordering of features in startup banner
...
list.
Added FEATURE() macros to most relevant (non-driver) files.
2007-08-02 14:51:03 +01:00
Holger Lubitz
0ebf6cdef4
remove old minorversion!=4 check (added -march a second time)
2007-08-02 01:54:42 +01:00
Holger Lubitz
06eb725cd4
remove x86_64 comments from arch specific Config
...
options are in main makefile now
2007-08-02 01:48:28 +01:00
Michael Brown
726e366e8f
Add code for constructing single-file cpio archives on the fly
2007-08-01 23:10:30 +01:00
Michael Brown
24f32a1945
Initrd concatenation now working
2007-08-01 15:29:15 +01:00
Michael Brown
c5d9114064
Allow loading of multiple initramfs images.
2007-07-31 18:09:18 +01:00
Michael Brown
5e26df0325
Centralise construction of the DHCP request and response packets.
2007-07-31 03:02:21 +01:00
Michael Brown
4ce8d61a5c
Import various libgcc functions from syslinux.
...
Experimentation reveals that gcc ignores -mrtd for the implicit
arithmetic functions (e.g. __udivdi3), but not for the implicit
memcpy() and memset() functions. Mark the implicit arithmetic
functions with __attribute__((cdecl)) to compensate for this.
(Note: we cannot mark with with __cdecl, because we define __cdecl to
incorporate regparm(0) as well.)
2007-07-30 02:43:43 +01:00
Michael Brown
f62d6486d8
GCC's optimiser seems to screw up if this is left static...
2007-07-30 02:42:32 +01:00
Michael Brown
304d1e9fa5
Don't rely on retry.c's periodically calling currticks() in order to
...
allow the UNDI NIC interrupt to happen.
2007-07-29 15:27:47 +01:00
Michael Brown
a6a1052096
Applied a modified version of holger's regparm patches.
2007-07-29 00:17:25 +01:00
Holger Lubitz
0ae6c53bd9
Revert "make __udivmoddi4 static" - gcc links to it implicitly
...
This reverts commit 9e7b165017
.
2007-07-28 23:20:00 +02:00
Holger Lubitz
9a4790667a
make multiboot_load static
2007-07-27 22:01:23 +02:00
Holger Lubitz
dc38303ff9
make nbi_load static
2007-07-27 22:00:51 +02:00
Holger Lubitz
5ec4e2ad50
make eltorito_load static
2007-07-27 21:58:31 +02:00
Holger Lubitz
9e7b165017
make __udivmoddi4 static
2007-07-27 21:39:58 +02:00
Michael Brown
09118cd5bf
Don't overwrite %dl with a (potentially) modified drive number if we
...
already handled the INT13 call.
2007-07-25 02:03:29 +01:00
Michael Brown
d5e39286f7
We probably shouldn't leave interrupts disabled when starting an OS.
2007-07-25 02:02:24 +01:00
Michael Brown
9aa61ad5a2
Add per-file error identifiers
2007-07-24 17:11:31 +01:00
Michael Brown
75912b3b77
Remove some obsolete sections of librm.h and libkir.h.
...
Add some of the missing parts to libkir.h.
2007-07-24 12:46:07 +01:00
Michael Brown
07e11f8af9
Minor debug improvement
2007-07-19 17:01:21 +01:00
Michael Brown
2cfe0dee1f
Don't trash the %ecx value returned by relocate(). This was causing
...
us to round down the size for the relocation copy to the nearest 64kB
(+0x10 bytes); this just happened to work on most machines because the
last 64kB of the image is all-zeroes anyway (it's the .bss).
2007-07-19 16:07:31 +01:00
Michael Brown
a8111e8ab7
Remove INT 13,4b handler; it represents an incomplete feature (CD-ROM
...
emulation support) for an unknown purpose, and breaks grub.
2007-07-19 11:16:05 +01:00
Michael Brown
0d9d2ccbae
Completed definition of struct int13_cdrom_specification, and moved to
...
int13.h.
2007-07-19 11:15:01 +01:00
Michael Brown
013d381e3c
Real-mode code might set the direction flag, which would cause carnage.
2007-07-17 13:46:37 +01:00
Michael Brown
c94cdf2b7d
Move .zinfo to libprefix.S; it doesn't belong with the decompression code.
2007-07-17 12:52:54 +01:00
Michael Brown
dc52db4920
Removed dead code identified by symcheck
2007-07-17 01:43:19 +01:00
Michael Brown
38dbe14bbe
Kill off redundant references to the .zprefixes.
2007-07-16 17:26:07 +01:00
Michael Brown
84551d485e
Update all prefixes currently referring to _load_size to include a
...
compressor fixup section.
2007-07-16 17:17:26 +01:00
Michael Brown
0929142a15
Rename _rom_size to _load_size_sect, since hdprefix.S also uses it.
2007-07-16 17:03:19 +01:00
Michael Brown
048bbeeebc
Compressed ROM images now work.
2007-07-16 16:58:38 +01:00
Michael Brown
6d2e4e719c
Move uninitialised .data16 variables to .bss16; saves around 2000
...
bytes of useless zeroes in the final image.
2007-07-16 13:22:12 +01:00
Michael Brown
389204713f
Kill off some long-redundant CFLAGS
2007-07-16 13:15:12 +01:00
Michael Brown
833d6cc8ec
Add __bss16() macro, and allow use of .bss16 section by removing
...
link-time check for section overlaps. (In order to avoid wasting
space in the executable image, .bss16 will overlap with the following
section, which is .text).
2007-07-16 13:10:49 +01:00
Michael Brown
ab859a5355
Use a single _payload_offset linker-defined variable to locate the
...
start of the non-prefix blocks in the loaded image, and rely on the
image ordering. This should make introducing compression much easier.
2007-07-15 02:52:02 +01:00
Michael Brown
0b5059c40b
Skip the length field prepended by util/nrv2b.c
2007-07-15 02:01:17 +01:00
Michael Brown
b37e267d1b
Modified calling convention: we now update %esi and %edi just like a
...
"rep movsb".
2007-07-15 01:51:32 +01:00
Michael Brown
3feac9465e
"not" doesn't affect flags, "xor $-1" does.
2007-07-15 01:25:13 +01:00
Michael Brown
26473105cd
On advice of hpa: be more patient with the KBC and SCPA methods; retry
...
in a long loop before giving up on them. Record method which worked
and default to that method on next attempt.
2007-07-14 20:56:12 +01:00
Michael Brown
adf192f566
Shrink cpu.c and render it useful for our purposes.
2007-07-14 19:12:13 +01:00
Michael Brown
e330db3c74
Dead code removal.
...
Kill off use of etherboot.h outside drivers/net.
2007-07-14 15:42:26 +01:00
Michael Brown
95c07736cb
Be more aggressive in attempts to enable A20, now that we have the
...
optimisation of only trying to do so when necessary.
2007-07-14 14:21:18 +01:00
Michael Brown
8624fdc445
Kill off the enforced RX quota; it only seems to hurt on real hardware.
2007-07-14 00:30:11 +01:00
Michael Brown
57b5e227ff
Use fast in-situ test for gate A20 being set, to cut down on the
...
number of (potentially very slow) gateA20_set operations.
Die with a fatal error if we are unable to set gate A20; if this fails
then we are bound to experience memory corruption at a later stage,
and I'd prefer to pick it up early.
2007-07-13 13:32:49 +01:00
Michael Brown
2ac7694c3e
Improve error reporting for strange length combinations reported by
...
the UNDI stack.
Ignore obviously invalid length combinations (as returned by
e.g. VMWare's PXE stack).
Limit to one packet per poll to avoid memory exhaustion.
2007-07-10 20:59:21 +01:00
Michael Brown
efd322091d
Set up %ds *before* testing a value in our data segment (d'oh!).
...
Always send EOI; do not chain to BIOS's default interrupt handler.
They are just too unpredictable; at least VMware's seems to kill the
machine if you go anywhere near it.
Disable interrupts after return from PXENV_UNDI_ISR, just in case some
dumb PXE stack enables them.
2007-07-10 17:08:32 +01:00
Michael Brown
f6f9a3098d
Report RX errors via netdev_rx_err()
2007-07-10 17:01:18 +01:00
Michael Brown
fb16f90699
Dump first 64 bytes of chained ISR when debugging is enabled.
2007-07-10 16:57:55 +01:00
Michael Brown
edc4648c39
Protect ISR against failure to unhook.
2007-07-10 04:34:53 +01:00
Michael Brown
4e14b020a5
Master IRQ should be EOIed first, I think.
2007-07-10 04:33:59 +01:00
Michael Brown
19871cbb96
We probably ought not to call INT13 with interrupts disabled.
2007-07-10 04:32:30 +01:00
Michael Brown
027fed72c1
Working code to call the PXE stack from within the ISR.
2007-07-10 04:21:24 +01:00
Michael Brown
cd7e296cbe
Always increase number of BIOS drives when registering
2007-07-09 20:42:04 +01:00
Michael Brown
b90d321dfb
Change %dl fixup rules for INT13:
...
INT 13,08 : read number of drives from 40:75
INT 13,15 : do nothing
all others : restore original value of %dl
2007-07-09 20:37:39 +01:00
Michael Brown
c7d9fdb5b9
Proof of concept; works, but has several hard-coded hacks.
2007-07-09 20:28:40 +01:00
Michael Brown
8bce52d348
Set CF by default, clear on success (rather than clearing and setting
...
on failure).
2007-07-09 19:02:41 +01:00
Holger Lubitz
4ff85d9f15
Add -mpreferred-stack-boundary=2 to i386 CFLAGS as it's almost always a win.
2007-07-09 03:32:54 +01:00
Michael Brown
4c418d2100
Use net_device_operations structure and netdev_nullify() to allow for
...
safe dropping of the netdev ref by the driver while other refs still
exist.
Add netdev_irq() method. Net device open()/close() methods should no
longer enable or disable IRQs.
Remove rx_quota; it wasn't used anywhere and added too much complexity
to implementing correct interrupt-masking behaviour in pxe_undi.c.
2007-07-07 16:43:39 +01:00
Holger Lubitz
c7549bcebe
convert to zalloc
2007-07-06 20:19:06 +02:00
Holger Lubitz
bb61774ee4
convert to zalloc
2007-07-06 20:19:06 +02:00
Michael Brown
311637503d
Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe
2007-07-06 13:31:58 +01:00
Michael Brown
f660e8ef58
Add strlen_user() (will be needed for PXE API extensions)
2007-07-06 13:07:10 +01:00
Marty Connor
74a1c77820
Merge branch 'master' of /pub/scm/gpxe
2007-07-06 08:04:55 -04:00
Marty Connor
28d8d828b3
Rename .lilo extension to .lkrn and updated dependencies
2007-07-06 08:04:06 -04:00
Michael Brown
763a3eab8a
Add .pdsk target (padded .dsk, suitable for qemu).
2007-07-05 23:37:17 +01:00
Michael Brown
fbda4837b0
Allocate heap at first usage, rather than assuming we can fit it in
...
below _text. This should help with the gPXE-on-gPXE-via-PXE case.
2007-07-05 22:30:34 +01:00
Michael Brown
07ea125213
Use partition type 0xeb ("EtherBoot"), to avoid any attempts to mount
...
the Etherboot partition.
2007-07-05 14:20:55 +01:00
Michael Brown
6e082c9b81
Add .usb target
2007-07-05 14:15:43 +01:00
Michael Brown
a0f078d7f5
Working with multi-sector reads
2007-07-05 13:30:49 +01:00
Michael Brown
66208dd65d
hdprefix that works for LBA only
2007-07-05 12:58:16 +01:00
Michael Brown
839960276d
Miscellaneous efficiency improvements, and extend read_sectors to
...
handle multiple sectors.
2007-07-05 12:36:39 +01:00
Michael Brown
3c2d50e5de
Added active partition locator, and simple MBR built using it.
2007-07-05 00:21:01 +01:00
Michael Brown
738ebaf4a5
Revert "Added master boot record capable of locating active partition"
...
This reverts commit 844d088c51
.
2007-07-05 00:20:04 +01:00
Michael Brown
844d088c51
Added master boot record capable of locating active partition
...
(including logical partitions).
2007-07-05 00:05:26 +01:00