david/ipxe
Archived
1
0
Commit Graph

560 Commits

Author SHA1 Message Date
Michael Brown
d6866202f9 Until we have a functioning UDP stack and PXE API again, there's not much
point trying to use the old boot sequence.  Replaced with a call to the
AoE demo code, so that people can at least build and try something useful.
2006-06-01 11:07:31 +00:00
Michael Brown
cf96d325d8 Missing from previous checkin.
This is the core portion of the async I/O interface.
2006-05-31 18:45:43 +00:00
Michael Brown
1dbafa8950 Tidied up debugging messages 2006-05-27 13:38:49 +00:00
Michael Brown
0479e9f541 relocate.o is now dragged in by the objects that require it; there is no
need for a CONFIG_RELOCATE.
2006-05-25 01:34:13 +00:00
Dan Lynch
bef8874842 - implemented printw (formatted string output, a la printf)
- implemented hline/vline (part of wborder family)
- screen cursor now relocates at same time as window cursor when
  restoring after a non-wrapping function
2006-05-22 17:03:41 +00:00
Michael Brown
84a493b88d Allow vcprintf() to be called by external code such as the curses library.
Also trim another eight bytes from vsprintf.o.  :)
2006-05-22 15:41:01 +00:00
Dan Lynch
f778500739 - fixes to _wputch to get positioning and wrap working properly
- fixes to wborder (same)
- addition of a few minor functions
2006-05-22 13:10:19 +00:00
Dan Lynch
d166dc57ab - made _wputch wrap lines as well as cols (wraps back to line 0, as we have not way to scroll...)
- implemented color_content, wborder, wblrtobot, wclrtoeol, wcolor_set and several small functions
- added rest of expected global variables
2006-05-19 16:18:08 +00:00
Dan Lynch
2814681d20 all window primitives implemented 2006-05-18 17:51:19 +00:00
Michael Brown
a4143e8c87 Split debug functions out into core/debug.c, so that they can be
automatically linked in on demand.

Corrected warnings in misc.c.  strtoul() really should be
  unsigned long strtoul ( const char *p, const char **endp, int base )
but such is not the ANSI standard.
2006-05-17 17:16:24 +00:00
Michael Brown
15ee09ed10 Restructured PCI subsystem to fit the new device model.
Generic PCI code now handles 64-bit BARs correctly when setting
"membase"; drivers should need to call pci_bar_start() only if they want
to use BARs other than the first memory or I/O BAR.

Split rarely-used PCI functions out into pciextra.c.

Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4).
284 bytes of this saving comes from the pci/pciextra split.

Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to
match the names used in Linux).
2006-05-16 15:12:06 +00:00
Michael Brown
0afa9db2de Tear out old heap code, replace with code that simply allocates memory
for use by malloc().

This breaks the image-loading code (which previously used the heap to
allocate the buffer for downloading the image), but that's not a major
concern since I'm going to tear out all the image formats within the next
couple of days anyway.  Byebye, NBI!  :)
2006-05-16 15:00:36 +00:00
Michael Brown
689218618f Fix typo 2006-05-16 14:42:43 +00:00
Michael Brown
ceba6ecb75 Added generic device model. 2006-05-16 14:10:21 +00:00
Dan Lynch
a2799051b0 fixed build error (danjlynch, repeat: this is *not* perl, this is *not* perl...) 2006-05-15 09:34:27 +00:00
Dan Lynch
dccc6aed3a lightweight xcurses implementation for etherboot (Michael made me do it...) 2006-05-15 09:29:48 +00:00
Michael Brown
eb6b8e8d70 Handle the '"%c", 0' case correctly. 2006-05-14 11:55:30 +00:00
Michael Brown
efd6281a35 Correctly handle zero-length buffers. 2006-05-14 11:18:42 +00:00
Michael Brown
25f5d114a0 Updated documentation.
Shaved around 100 bytes off vsprintf.o.  It's now 50 bytes smaller than
the old implementation and provides much more conformant semantics,
including the ability to return the number of characters that would have
been printed to the string had the buffer been big enough.  (iSCSI needs
this functionality).
2006-05-14 03:31:20 +00:00
Michael Brown
2421723a15 Rewrote printf and friends to better support standard C semantics. 2006-05-14 02:51:55 +00:00
Michael Brown
f99e7a375e At least cope with "%llx" by reading the correct-sized va_arg from the
stack, even if we don't yet print it out.

At some point, vsprintf() needs to be fixed up so that it can correctly
cope with limited-sized buffers (i.e. vsnprintf), long longs, and
standard format specifiers (e.g. "%04x").  We should also remove the
special types (MAC addresses and IP addresses).  This would then enable
us to use gcc's ability to type-check printf format strings.
2006-05-13 11:50:52 +00:00
Michael Brown
f8f75cef5b BSS is now zeroed by libprefix (along with the otherwise non-zeroable
portions such as the stack) during the installation process.

init_fns() are called from main().  We need to think about initial
control flow some more.
2006-05-02 21:10:45 +00:00
Michael Brown
a42092d2a0 Add a temporary snprintf, so that safely-written code can at least
compile, even if it won't yet be safe.
2006-04-30 12:01:31 +00:00
Michael Brown
8df7e74990 Fix up prototype of strtoul() to match POSIX. 2006-04-30 11:45:38 +00:00
Michael Brown
352bf1bda2 Move init.h to gpxe/init.h. 2006-04-30 01:08:52 +00:00
Michael Brown
23c494d14e Added basic code for implementing co-operative multitasking.
Yes, you really can do it in 65 bytes.
2006-04-29 16:42:09 +00:00
Michael Brown
51feeab445 Add an explicit failure debug message 2006-04-28 14:07:41 +00:00
Michael Brown
cfae86f6c8 Glenn managed to shrink .text by 5 more bytes. 2006-04-25 21:48:16 +00:00
Michael Brown
face774c4c Fixed erroneous comparison 2006-04-25 11:54:58 +00:00
Michael Brown
95f8a42930 Removed incorrect comment; malloc() is inefficient only when the
alignment and size are both powers of two, and there's no way to
specify an alignment through the malloc() interface anyway.
2006-04-25 10:41:49 +00:00
Michael Brown
4e92f29c9e Now passes trivial tests. free_memblock() needs neatening up. 2006-04-25 04:01:58 +00:00
Michael Brown
b601a7d355 Updated memory allocator to improve support for unaligned or partially
aligned blocks.

Moved header to include/malloc.h, since we now also provide the
POSIX-like malloc()/free() pair.

Not yet tested.
2006-04-25 03:30:46 +00:00
Michael Brown
832e86246b gcc is rather over-aggressive about optimising out static data structures
even when __atribute__ (( unused )) is correctly set...
2006-04-24 18:31:37 +00:00
Michael Brown
824d6ffa7f Header rearrangement.
I want to get to the point where any header in include/ reflects a
standard user-level header (e.g. a POSIX header), while everything that's
specific to gPXE lives in include/gpxe/.  Headers that reflect a Linux
header (e.g. if_ether.h) should also be in include/gpxe/, with the same
name as the Linux header and, preferably, the same names used for the
definitions.
2006-04-24 15:42:49 +00:00
Michael Brown
b6b6a0b5fe First draft of a dynamic memory allocator 2006-04-24 15:21:18 +00:00
Michael Brown
d24042f0bb Update now that if_ether.h has moved. 2006-04-19 01:56:10 +00:00
Michael Brown
49f933fbc3 Moved if_ether.h and if_arp.h to include/gpxe, for consistency with Linux
kernel.

Removed obsolete struct arprequest from if_arp.h and put it in nic.c so
that nic.c will still compile.  ARP will very shortly be handled by
net/arp.c instead.
2006-04-19 01:52:41 +00:00
Michael Brown
af23ff8a24 Assertions are now handled via the POSIX-like <assert.h>. 2006-03-23 19:33:57 +00:00
Michael Brown
bb7394b041 Merge from Etherboot 5.4 2006-03-16 17:59:51 +00:00
Michael Brown
708bbc43bc Merge from Etherboot 5.4 2006-03-16 17:40:55 +00:00
Michael Brown
df9cbc23cc Added documentation and ASSERT() statements. 2005-06-06 12:01:19 +00:00
Michael Brown
33dbdda28e Allow data blocks to be less than sizeof ( struct buffer_free_block ) in
size.  (The restriction on the size of free blocks remains.)
2005-06-06 11:42:14 +00:00
Michael Brown
cbed5ed9ad Always include code for sending multicast packets. 2005-06-02 10:14:26 +00:00
Michael Brown
be7897523d IGMP protocol now uses the generic background protocol mechanism. 2005-06-01 22:22:14 +00:00
Michael Brown
85a380530d Add generic mechanism for background protocols (e.g. ARP, IGMP) 2005-06-01 22:18:38 +00:00
Geert Stappers
5265975334 patch of Helge Wagner 2005-05-31 11:32:45 +00:00
Michael Brown
0e494614b5 Some versions of doxygen seem to object to "@ret None" or similar. 2005-05-24 00:11:25 +00:00
Michael Brown
809933d9f7 Split PXE code into preboot, udp, tftp, undi and loader units.
PXE code now compiles without errors (though it won't actually work).
2005-05-23 23:32:56 +00:00
Michael Brown
8fcb6448bd Moved pxe_errors.c to pxe/interface/ 2005-05-23 22:47:21 +00:00
Michael Brown
6bcd74b65c Moved pxe_export.c to pxe.c, since the old pxe.c no longer exists. 2005-05-20 15:32:41 +00:00
Michael Brown
a96759f9c8 Use "#var" rather than "@c var" for doxygen. 2005-05-20 10:27:02 +00:00
Michael Brown
bf32da87f0 Doxygenation 2005-05-20 10:24:11 +00:00
Michael Brown
8bc4551f5e API docs to .h 2005-05-19 18:41:54 +00:00
Michael Brown
2ddbac101e Move API docs to buffer.h, implementation to buffer.c. 2005-05-19 18:32:04 +00:00
Michael Brown
4e87543c74 Synced across updates from Etherboot 5.4 tree 2005-05-19 16:47:19 +00:00
Michael Brown
d0c9183903 Doxygenation 2005-05-19 14:51:37 +00:00
Michael Brown
eff1cd867b errno.h now required in order to compile. 2005-05-19 14:49:56 +00:00
Michael Brown
e911a74724 More documentation 2005-05-19 11:54:41 +00:00
Michael Brown
a2915ad06d Added preliminary doxygen documentation 2005-05-19 00:17:48 +00:00
Michael Brown
0e921cdd9e More doxygen docs 2005-05-18 15:28:33 +00:00
Michael Brown
d04b607eb9 Add doxygen documentation 2005-05-18 14:44:38 +00:00
Michael Brown
127362581f Document %m 2005-05-18 14:44:05 +00:00
Michael Brown
307cf36fca Linker symbols no longer defined in etherboot.h
Use %m to print error
2005-05-18 14:43:27 +00:00
Michael Brown
ab07740755 First version 2005-05-17 18:39:27 +00:00
Michael Brown
ff9104e029 Added errno, strerror and the "%m" printf metacharacter. These will allow
us to return proper PXE status codes, while simultaneously allowing for
more consistent error reporting (complete with verbose error messages as a
build-time option).
2005-05-17 18:26:41 +00:00
Michael Brown
40c7b127aa Added const to fill_buffer 2005-05-17 14:34:46 +00:00
Michael Brown
022661283a Load buffer is now handled by the autoload() function. 2005-05-17 13:44:08 +00:00
Michael Brown
510de6cb8c Restructured to allow per-object image formats 2005-05-17 13:40:31 +00:00
Michael Brown
0571dcdb05 Added print_images() and autoload(). 2005-05-17 13:38:24 +00:00
Michael Brown
9968c9513e Moved find_segment into elf_loader.c 2005-05-17 13:37:29 +00:00
Michael Brown
3ce6504f14 Use shared symbols for heap_ptr and heap_end 2005-05-17 13:35:43 +00:00
Michael Brown
6e8f29d3cb Image formats moved into the new config system 2005-05-17 13:33:49 +00:00
Michael Brown
5c8ea0b93a Add realloc, since the load buffer code requires it. 2005-05-13 13:20:16 +00:00
Michael Brown
59a1662978 Added debugging 2005-05-13 11:24:02 +00:00
Michael Brown
42250e9b1a Tidied up init_heap() 2005-05-13 11:16:14 +00:00
Michael Brown
f0d048bf91 Added ASSERT() macro 2005-05-13 10:18:21 +00:00
Michael Brown
eff4fa5a04 Merged the unaligned and aligned heap APIs and simplified the code. 2005-05-12 16:34:57 +00:00
Michael Brown
a5a14dc05d Use the global load_buffer, and the boot_image function. 2005-05-09 18:10:04 +00:00
Michael Brown
73429d6da1 Make "struct buffer"s reusable between sessions. 2005-05-09 18:03:44 +00:00
Michael Brown
58ee2c4b2e First versions 2005-05-09 18:01:50 +00:00
Michael Brown
0fe74493f4 Protocols now load data into a buffer; they don't execute it. 2005-05-09 14:27:29 +00:00
Michael Brown
bab2924e89 Return -1 to indicate buffer overflow. Allow buffer fill level to be read
easily from struct buffer.
2005-05-09 14:26:10 +00:00
Michael Brown
a89651f3bb Added debugging 2005-05-09 13:47:04 +00:00
Michael Brown
b2869ed6b8 Added explanatory comment. 2005-05-09 13:25:43 +00:00
Michael Brown
e75b7480d0 Modified to use physical addresses, and to not assume that we can directly
refer to data outside of our data or stack segments.
2005-05-09 13:24:01 +00:00
Michael Brown
ef05a27f25 Start of an implementation using doubly-linked lists and virtual
addresses.  This will have to be reworked to use physical addresses thanks
to the PXE spec.
2005-05-09 10:11:11 +00:00
Michael Brown
462234f373 Make vga_font const to avoid warning about large symbol 2005-05-03 13:17:08 +00:00
Michael Brown
a918abc036 Split TCP code out into proto/tcp.c 2005-05-02 12:07:47 +00:00
Michael Brown
cc980d1c94 Moved DOWNLOAD_PROTO_XXX options to config.h 2005-05-02 11:13:47 +00:00
Michael Brown
f9f1d2c84c More URL parsing moved into url.c 2005-05-01 23:58:45 +00:00
Michael Brown
d5bf9e71ea http.h obsoleted (no content) 2005-05-01 23:58:20 +00:00
Michael Brown
63482e4fe9 Made parse_url do more of the processing, to avoid duplicating parts of
nic.c in http.c
2005-05-01 19:10:04 +00:00
Michael Brown
2227a711fd umountall() handled by nfs.c's reset function 2005-05-01 15:08:19 +00:00
Michael Brown
85d9eae44e Moved protocols to proto/ 2005-05-01 14:04:11 +00:00
Michael Brown
e1d6f3a8ac Add NMB_RESOLVER 2005-05-01 10:58:49 +00:00
Michael Brown
552f33c663 Always request DNS server. DHCP handling will be generalised in future. 2005-04-30 19:39:50 +00:00
Michael Brown
78cdb1da8b DNS resolver rewritten, moved to proto/dns.c 2005-04-30 14:50:33 +00:00
Michael Brown
d817e60d21 "dns_resolver" changed to "dns" 2005-04-30 14:49:41 +00:00
Michael Brown
167c26c92b tftp functions moved to proto/tftp.c 2005-04-30 14:46:49 +00:00
Michael Brown
1644238813 Added debugging. 2005-04-30 14:41:37 +00:00
Michael Brown
6cd0fa5807 Added DNS resolver configuration option. 2005-04-30 14:39:21 +00:00
Michael Brown
0780ecf1b6 TFTP API changed. 2005-04-30 14:27:17 +00:00
Michael Brown
56825df041 loadkernel renamed to download_url, substantially restructured, and moved
to nic.c
2005-04-30 13:52:27 +00:00
Michael Brown
e68378fd62 loadkernel renamed to download_url and moved to nic.c 2005-04-30 13:51:49 +00:00
Michael Brown
903ddd9878 inet_aton doesn't overwrite the IP address unless it is valid. 2005-04-30 13:50:34 +00:00
Michael Brown
044b20385b parse_url() is void. 2005-04-30 13:24:26 +00:00
Michael Brown
65dc273d78 First version 2005-04-29 13:26:31 +00:00
Michael Brown
e4131ebb84 First version 2005-04-29 13:17:25 +00:00
Michael Brown
c1253d2219 Much, much smaller. :) 2005-04-28 13:20:02 +00:00
Michael Brown
6791aeb024 First version: far too large (408 bytes!!!) 2005-04-28 12:12:11 +00:00
Michael Brown
f37e0a06d7 dev.c uses the new tables infrastructure. 2005-04-27 12:20:54 +00:00
Michael Brown
3e5bf5fb06 console.c uses the generic table mechanism 2005-04-27 11:38:43 +00:00
Michael Brown
241f426a85 Use new generic tables infrastructure 2005-04-27 11:25:21 +00:00
Michael Brown
fda36a0c1a Added back in the actual call to load(). 2005-04-26 17:12:07 +00:00
Michael Brown
f5dde85e16 Improved debug messages 2005-04-25 19:28:49 +00:00
Michael Brown
8cd0693396 s/{name,describe}/{name,describe}_device/ 2005-04-25 19:27:53 +00:00
Michael Brown
3b14360f5c Renamed describe to describe_device for consistency 2005-04-25 19:27:25 +00:00
Michael Brown
b18e419a81 Updated debug messages 2005-04-22 16:02:12 +00:00
Michael Brown
98ff29345e Created a bus/device API that allows for the ROM prefix to specify an
initial device, and will also allow for e.g. a device menu to be presented
to the user.
2005-04-21 18:18:29 +00:00
Michael Brown
e02c699a05 Fix endianness of dhcp device id structure. 2005-04-18 14:38:51 +00:00
Michael Brown
ffe77e0683 This is, of course, the neater and much more obvious way to do it. 2005-04-18 12:45:31 +00:00
Michael Brown
cf79681b80 Fix BUILD_SERIAL.
Change from using #if to #ifdef, since #if can't cope with string
constants.
2005-04-18 12:43:18 +00:00
Michael Brown
85b00c4b72 Move RELOCATE into config.h
Move ISA probe address logic from config.c into isa.c, create header file
config/isa.h.
2005-04-18 11:00:42 +00:00
Michael Brown
de965fde64 Whoops 2005-04-17 16:16:02 +00:00
Michael Brown
64e1df4af6 Allow serial port options to be specified in a relatively friendly format. 2005-04-17 16:15:46 +00:00
Michael Brown
c9d35daffe Re-add the "." progress indicator. 2005-04-17 11:40:24 +00:00
Michael Brown
664ffea697 Gave vsprintf.c its own header file, and made console.h include it. 2005-04-17 10:44:26 +00:00
Michael Brown
f25383f4c4 Add ISA_PROBE_ADDRS list. 2005-04-16 09:35:17 +00:00
Michael Brown
f04b9cd3ea Leave some time to see what's going on. 2005-04-15 17:06:54 +00:00
Michael Brown
c41e89af41 Fixed debug message 2005-04-15 16:58:08 +00:00
Michael Brown
f78fd79c16 Moved core/isapnp.c to drivers/bus/isapnp.c 2005-04-14 22:42:57 +00:00
Michael Brown
ce8dea0dff Separate out bus-scanning and device-probing logic. 2005-04-14 13:33:03 +00:00
Michael Brown
44c7cc8c12 Standardised debug mechanism in place now. 2005-04-14 11:55:57 +00:00
Michael Brown
75d864432c Use the magic of common symbols to allow struct dev to effectively grow at
link time to accommodate whatever bus objects are included.
2005-04-14 10:10:54 +00:00
Michael Brown
e27ebad4b2 Whoops 2005-04-13 02:05:43 +00:00
Michael Brown
f16ac2d87e Fix type of dummy_irq() 2005-04-13 01:28:43 +00:00
Michael Brown
6e8878c1fa Avoid compiler warnings. 2005-04-13 00:19:01 +00:00
Michael Brown
266dae4034 Use NIC's connect method. 2005-04-13 00:18:35 +00:00
Michael Brown
241fb0f3cd Use dev's print_info method to print standardised information about
the boot device.
2005-04-12 22:44:02 +00:00
Michael Brown
d9f34bfdfc Add dummy_connect and dummy_irq 2005-04-12 19:11:13 +00:00
Michael Brown
762fa9a478 Fix up find_pci_device so that it can be used for scanning for devices
*other* than the main boot device.
2005-04-12 18:04:03 +00:00
Michael Brown
1434e8d68d struct nic is now part of struct dev, rather than the other way around.
Tie into new boot device framework.
2005-04-12 16:52:59 +00:00
Michael Brown
31410b1b5d Needs to be updated to new probe logic. 2005-04-12 16:51:26 +00:00
Michael Brown
236a195257 All code related to the device probe logic is ifdeffed 0 out. 2005-04-12 16:49:59 +00:00
Michael Brown
bb293ca5c2 Global struct dev is now in main.c 2005-04-12 16:49:11 +00:00
Michael Brown
6f37dc410a print_drivers() is now unified. 2005-04-12 16:48:45 +00:00
Michael Brown
daad093c40 Now obsolete. :) 2005-04-12 16:46:57 +00:00
Michael Brown
3901d197f7 Replaced main loop with a trivial implementation so that we can try
out the new probing logic.
2005-04-12 16:43:18 +00:00
Michael Brown
5e807dffe6 Obsoleted by new device probing mechanism. 2005-04-12 16:38:38 +00:00
Michael Brown
17c1ca90e7 New device probing mechanism 2005-04-12 16:38:23 +00:00
Michael Brown
67f122c645 Removed pci_find_device_x; it was too ugly to live. 2005-04-12 12:59:21 +00:00
Michael Brown
7172d4abfb Moved functions that we want to keep to drivers/bus/pci.c 2005-04-11 13:45:00 +00:00
Michael Brown
95f755ad7f Renamed pci.c to pci_legacy.c in preparation for new bus managment
infrastructure.
2005-04-11 13:25:41 +00:00
Michael Brown
87508aa0b2 arch_initialise() is now sufficiently generic that we may as well just
call it initialise() and place it in main.c.  :)
2005-04-10 18:30:34 +00:00
Michael Brown
1937b39079 Drag in relocate unless NORELOCATE is defined, since it's now called
only via the initialisation function table.
2005-04-10 18:19:05 +00:00
Michael Brown
9abceef561 Removed obsolete initialisation calls. 2005-04-10 18:13:24 +00:00
Michael Brown
64d3886c1d relocate() is called by arch_initialise(). 2005-04-09 13:23:49 +00:00
Michael Brown
a4920c16bd Moved relocate.c to arch-specific dir, since it involves arch-specific
logic (e.g. avoiding memory regions with A20=0).
2005-04-09 10:49:26 +00:00
Michael Brown
0ff80b477d Merged mcb30-realmode-redesign back to HEAD 2005-04-08 15:01:17 +00:00
Michael Brown
3d6123e69a Initial revision 2005-03-08 18:53:11 +00:00