david/ipxe
Archived
1
0
Commit Graph

1153 Commits

Author SHA1 Message Date
Michael Brown
aa2468babe Added abstraction layer for a three-wire serial device (e.g. the EEPROM
used on RTL8139 cards).
2006-05-26 15:39:24 +00:00
Michael Brown
9f86754f90 Updated to work with libprefix. 2006-05-25 22:04:47 +00:00
Michael Brown
29340d7728 Documented the fact that the prefix can prot_call(main) without
worrying about its stack being destroyed during the Etherboot run.
2006-05-25 22:04:17 +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
Michael Brown
3204a1e941 Removed some obsolete INIT_XXX constants. 2006-05-25 01:09:06 +00:00
Michael Brown
d82f71efd0 Also hide base memory region from E820 map. 2006-05-25 00:10:58 +00:00
Michael Brown
89da833c5d init_librm() and prot_call() are now real-mode far calls.
install() now calls relocate(), moves the protected-mode code to the new
location, and calls hide_etherboot().
2006-05-25 00:06:45 +00:00
Michael Brown
4d81b48504 Has been obsolete for a while. 2006-05-25 00:04:37 +00:00
Michael Brown
1966945a5d Update relocate() to work with get_memmap().
Change semantics; relocate() now just finds a suitable location; it
doesn't actually perform the relocation itself.  Code in libprefix does
the copy in flat real mode.
2006-05-25 00:04:13 +00:00
Michael Brown
f939ff7cb5 Fix printf format warning error 2006-05-25 00:02:27 +00:00
Michael Brown
3bd3c13c7b Why should pushal/popal put the registers on the stack in a logical
order?
2006-05-25 00:01:46 +00:00
Michael Brown
dd75965057 Typo. 2006-05-25 00:00:53 +00:00
Michael Brown
e4f8d6eed7 Add a "count" field to struct memory_map. 2006-05-25 00:00:30 +00:00
Michael Brown
986f6ffff1 Define a struct memory_map with a fixed number of entries, rather than
requiring each caller to decide how many entries it wants to permit.
2006-05-24 14:41:27 +00:00
Michael Brown
edcf89e2b0 Remove the automatic segment register save and restore; most users of
REAL_CODE() don't need it.
2006-05-24 14:11:36 +00:00
Michael Brown
02cf755f3f Removed REAL_EXEC(); there is no longer any code using it. 2006-05-24 14:10:15 +00:00
Michael Brown
103aff3ae2 Added potentially required "\n\t" on the end of asm_code_str 2006-05-24 14:06:28 +00:00
Michael Brown
190276a8b6 NBI is due for removal 2006-05-24 13:53:35 +00:00
Michael Brown
52125e158c Will be replaced with a block-device implementation. 2006-05-24 13:52:46 +00:00
Michael Brown
8110f9b082 Updated to REAL_CODE() 2006-05-24 13:50:40 +00:00
Michael Brown
595f161b51 Updated to REAL_CODE().
int13_boot() now does its own segment register save and restore, ready
for the removal of segment register restoration from the libkir
generic code.
2006-05-24 13:48:16 +00:00
Michael Brown
e8550035af Updated to REAL_CODE() 2006-05-24 13:28:39 +00:00
Michael Brown
c4d688c005 Updated to REAL_CODE(). 2006-05-24 13:24:22 +00:00
Michael Brown
04d6005d77 Update to REAL_CODE() 2006-05-24 12:45:50 +00:00
Michael Brown
6631f46999 Updated to REAL_CODE(). 2006-05-24 12:32:57 +00:00
Michael Brown
53935e9dc6 Set carry flag before calling INT 15,e801 and INT 15,e820.
Ignore carry flag for INT 15,88; the Ralf Brown interrupt list says
that CF is unreliable for this call.
2006-05-24 12:19:16 +00:00
Michael Brown
7a53d07027 Split out REAL_CODE() from REAL_EXEC(), preparatory to removing REAL_EXEC
completely.
2006-05-24 09:51:04 +00:00
Michael Brown
83d80d9e79 Remove references to obsoleted REAL_CALL from documentation. 2006-05-24 09:16:48 +00:00
Michael Brown
3b525385af Removed REAL_FRAGMENT and REAL_CALL, and left just REAL_EXEC (which is
the only one we actually use).  This allows REAL_EXEC fragments to
contain proper references to constraints (e.g. "%w0"), rather than having
to force the use of specific registers.

Note that the "num_constraints" parameter is now completely obsolete, and
that we can probably reduce the syntax to something like
  __asm__ __volatile__ ( REAL_CODE ( "asm statements" )
                         : output constraints
                         : input constraints
                         : clobber );
which would look much more natural, and avoid the need to always specify
a clobber list.


Add userptr_t to libkir.h, to allow it to at least compile.
2006-05-24 09:14:44 +00:00
Michael Brown
77a65075a6 Replaced memsizes.c with smaller memmap.c, taking advantage of __data16,
and creating a memory map that's easier to work with than the E820 map.
2006-05-24 01:37:46 +00:00
Michael Brown
5e80847827 Code to install the new E820 mangler (which doesn't require copying
down to base memory, since it is now in the base-memory-resident
.text16 section).
2006-05-23 23:47:05 +00:00
Michael Brown
897313007b Add __{text,data}16_array, since there's no way I can see to make the
usual __{text,data}16 trick work with arrays.  gcc seems to accept the
__asm__ ( asmlabel ) only after the [] of the array declaration, not
before.
2006-05-23 23:42:45 +00:00
Michael Brown
5ec2b2c251 Cope with regions bigger than 4GB.
We now split e820 regions around ourselves, rather than just
truncating the e820 region.  This avoids the worst-case scenario of
losing all memory over 4GB.

It's more important to get the memory map right now that we're
expecting to still be loaded when the OS starts in several situations
(e.g. Linux with UNDI driver, any OS with iSCSI/AoE boot, etc.).
2006-05-23 23:33:37 +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
Michael Brown
95956443e1 Fixed debug code 2006-05-21 16:04:41 +00:00
Michael Brown
9dfb9d84b4 Made the LBA48 example clearer. 2006-05-21 16:02:38 +00:00
Michael Brown
80958ff69c Added (untested) support for ATA devices. This code should be generic
enough to support both real IDE chipsets and AoE.
2006-05-21 16:01:23 +00:00
Michael Brown
ca2519cea3 Refactored to reduce code size; now down from 1304 to 1105 bytes.
Tidied up debug messages; the log now contains one line per INT 13
operation, looking like

 INT 13,08 (80): Get drive parameters
 INT 13,02 (80): Read: C/H/S 0/47/14 = LBA 0xb9e <-> 1084:0000 (count 106)
2006-05-20 15:33:32 +00:00
Michael Brown
af4aacb978 Added missing @file block 2006-05-20 13:25:07 +00:00
Michael Brown
4d0a0f822d Use insb/outsb; it's marginally faster. 2006-05-20 12:28:44 +00:00
Michael Brown
402ba15c64 READ CAPACITY (16) turns out to be an optional command (even though
READ(16) is mandatory); we must use READ CAPACITY (10) first and then
use READ CAPACITY (16) if the READ CAPACITY (10) returns "out of range".
2006-05-19 18:54:38 +00:00
Michael Brown
444b885a7d Add EOVERFLOW==ERANGE 2006-05-19 18:53:12 +00:00
Michael Brown
b9cbae58fa Expert advice tells me that we *do* have to explicitly state the
options even when we want to use the defaults.
2006-05-19 17:50:49 +00:00
Dan Lynch
acf572905c - made some of the bit shifting attribute access simpler (in my mind)
- added extern declarations for global vars
- removed comments from static inlines (too time consuming to do them
  all, considering all so far have been due to the ridiculous amount of
  redundancy within the API spec)
- removed a few more extern func decls for funcs that cannot be
  implemented at this time
2006-05-19 16:22:10 +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
Michael Brown
d48d0fb1bb Add the concept of a "user pointer" (similar to the void __user * in
the kernel), which encapsulates the information needed to refer to an
external buffer.  Under normal operation, this can just be a void *
equivalent, but under -DKEEP_IT_REAL it would be a segoff_t equivalent.

Use this concept to avoid the need for bounce buffers in int13.c,
which reduces memory usage and opens up the possibility of using
multi-sector reads.

Extend the block-device API and the SCSI block device implementation
to support multi-sector reads.

Update iscsi.c to use user buffers.

Move the obsolete portions of realmode.h to old_realmode.h.

MS-DOS now boots an order of magnitude faster over iSCSI (~10 seconds
from power-up to C:> prompt in bochs).
2006-05-19 15:06:51 +00:00
Michael Brown
0ab92faedb Use typeof(sizeof(...)) to define a size_t. This stops gcc complaining
about format errors for %zX arguments.
2006-05-19 14:51:59 +00:00
Michael Brown
c69c1ec540 Documented login parameters that we negotiate. 2006-05-19 00:31:42 +00:00
Michael Brown
a280587cde iSCSI writes seem to be working (at least, the ethereal trace shows no
errors; still need to verify data integrity).

SCSI response PDUs are handled: status and sense data (if available) are
returned via the scsi_command structure.

Updated iSCSI session parameter usage.
2006-05-19 00:20:08 +00:00
Michael Brown
b531bd2bda All uses iscsi_state were removed some time ago; removing the
declaration.
2006-05-18 21:38:16 +00:00
Michael Brown
53b682f3a2 Re-enable -Wformat, since our printf() is now more standards-conformant. 2006-05-18 21:23:38 +00:00
Dan Lynch
2814681d20 all window primitives implemented 2006-05-18 17:51:19 +00:00
Michael Brown
813a052dc3 Set ErrorRecoveryLevel=0 (we don't want to have to handle it). 2006-05-17 17:41:50 +00:00
Michael Brown
61d7b8a5ef Added missing drivers/scsi 2006-05-17 17:31:18 +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
6b6096d28b Strip down i386 PCI configuration space I/O to the bare minimum. A
typical build will now include 880 bytes of PCI support code, compared to
2327 bytes in Etherboot 5.4.

(There is a slight cost of around 5 extra bytes per access to a
non-constant config space address; this should be an overall win.
Driver-specific accesses will usually be to constant addresses, for
which there is no additional cost.)
2006-05-17 01:12:11 +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
fcdab6299c Missed a reference to heap.h. 2006-05-16 15:01:26 +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
441189c6f8 Kill off the "all devices are boot devices" idea 2006-05-16 14:42:15 +00:00
Michael Brown
7cd0390013 Add list_for_each_entry_safe. 2006-05-16 14:14:31 +00:00
Michael Brown
ceba6ecb75 Added generic device model. 2006-05-16 14:10:21 +00:00
Michael Brown
6b514393d3 Change movetoyx(), putc() and getc() to methods of the screen. 2006-05-15 09:51:18 +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
295e11b2b0 Add INT 13,41 (extensions installation check). LILO's MBR now uses
linear calls to load the MS-DOS boot sector in my test setup.
2006-05-14 23:46:28 +00:00
Michael Brown
f25731d08f Split "iSCSI as a SCSI device" out from "iSCSI as a TCP protocol". 2006-05-14 23:29:16 +00:00
Michael Brown
29fb77b0a4 Fix a couple of minor typos. 2006-05-14 18:17:29 +00:00
Michael Brown
6e42cb95bd Also capture INT 19 as a failure path, to allow for boot sectors that
don't conform to BBS (e.g. the one created by mkdosfs).
2006-05-14 14:13:55 +00:00
Michael Brown
4435667a00 Add int13_boot(), to allow booting from INT 13 emulated drives. 2006-05-14 13:44:47 +00:00
Michael Brown
b4f941b257 Specify attributes on .text16. 2006-05-14 13:39:27 +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
21493646c2 Moved to net/tcp/iscsi.c. 2006-05-13 11:45:49 +00:00
Michael Brown
5080668704 Provide access to rm_cs and rm_ds from protected-mode code. 2006-05-13 11:45:31 +00:00
Michael Brown
dc8d429ec6 Provide a global counter for the number of interrupts hooked. 2006-05-13 11:44:53 +00:00
Michael Brown
63499e9cfd Allow re-entrancy and provide a global counter of the number of
interrupts hooked.
2006-05-13 11:44:11 +00:00
Michael Brown
d822b3d4cd Define BIOS data segment in bios.h 2006-05-13 11:43:07 +00:00
Michael Brown
a27defa483 Add flag definitions. 2006-05-13 11:42:07 +00:00
Michael Brown
d2c22ec9bb Add INT 13 emulation layer (which provides an interface to gPXE block
devices).
2006-05-13 11:41:36 +00:00
Michael Brown
1ad72e0e79 Add 64-bit byte-swapping operations. 2006-05-13 11:40:39 +00:00
Michael Brown
5009f8d6a2 Provide a SCSI device interface to the iSCSI protocol 2006-05-13 11:39:46 +00:00
Michael Brown
f33f01c126 Defined SCSI device interface, and added SCSI block device
implementation.
2006-05-13 11:37:50 +00:00
Michael Brown
8638a5e471 Defined a block device interface. 2006-05-13 11:36:30 +00:00
Michael Brown
1838b58c3f Add drivers/block and arch/i386/interface/pcbios 2006-05-13 11:35:29 +00:00
Michael Brown
568cad0ddc (Redoing check-in lost by SourceForge's failure.) 2006-05-13 11:30:03 +00:00
Michael Brown
8a229a16f6 (Redoing check-in lost by SourceForge's failure.)
Moved to net/
2006-05-13 11:24:25 +00:00
Michael Brown
847f38f4ac (Redoing check-in lost by SourceForge's failure.)
Add method for hooking real-mode interrupt vectors.
2006-05-13 11:19:06 +00:00
Michael Brown
f7b963da51 (Redoing check-in lost by SourceForge's failure.)
Use .text16.data section with "aw" attributes, to avoid section type
conflicts when placing both code and data into .text16.

Add __from_{text16,data16}.
2006-05-13 11:11:55 +00:00
Michael Brown
97d265f8dc (Redoing check-in lost by SourceForge's failure.)
Avoid optimisation errors under -fstrict-aliasing.
2006-05-13 11:10:24 +00:00
Michael Brown
fdb983d473 Preserve the whole of %esp across prot_call(). We have to split this
between the low half stored in the static variable rm_sp, and the high
half stored on the prot_call() stack, because:

  Just using the stack would screw up when a prot_call()ed routine
  executes a real_call(); it would have no way to find the current top of
  the RM stack.

  Extending rm_sp to rm_esp would not be safe, because the guarantee that
  rm_sp must return to the correct value by the time an external
  real-mode call returns applies only to %sp, not to %esp.
2006-05-06 19:44:23 +00:00
Michael Brown
f8e087767b Allow access to variables in .text16 as well as .data16. Chained
interrupt vectors, for example, will be easiest to handle if placed in
.text16.
2006-05-06 18:57:31 +00:00
Michael Brown
c10d1aa9d7 Preserve GDT across prot_call(). 2006-05-06 18:52:27 +00:00
Michael Brown
dcc1b0054e This line should not have been checked in 2006-05-04 23:22:42 +00:00
Michael Brown
832807726a Add infrastructure to support access to .data16 (and .text16) variables
from protected-mode code.

Set up %ds to point to .data16 in prot_to_real, so that code specified
via REAL_EXEC() and friends can access variables in .data16.

Move most real-mode librm variables from .text16 to .data16.
2006-05-04 23:14:06 +00:00
Michael Brown
f4429533a6 Added methods for efficiently declaring and accessing variables in
.data16.  librm will need to supply "char *data16", i.e. the virtual
address of the start of .data16.
2006-05-04 17:00:20 +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
cc23057b59 Typo 2006-05-02 21:09:29 +00:00
Michael Brown
10c28a51bd Create two easy-to-use entry points in libprefix: install and
install_prealloc.  I *think* these will suffice for all the 16-bit
prefixes.
2006-05-02 20:51:07 +00:00
Michael Brown
9e1dd6402d <name>_size variable is no longer needed, since we don't copy the code.
However, it's worth adding a .size directive so that objdump reports the
correct sizes for the code fragments.
2006-05-02 16:38:46 +00:00
Michael Brown
9fcded3d23 Towards a(nother) new real-mode infrastructure, in which we take
advantage of the fact that we have to have a permanently-resident block
in base memory.
2006-05-02 15:41:21 +00:00
Michael Brown
8f62b39c03 Move stack out to separate object, so that having a stack doesn't drag in
setup.S.
2006-05-02 14:57:48 +00:00
Michael Brown
5463169c1a Verified as working 2006-05-02 14:04:21 +00:00
Michael Brown
d081d65d48 This should be much more elegant: we use flat real mode for the
highmem data, so decompress16 will be able to unpack blocks bigger
than 64kB.
2006-05-01 22:35:19 +00:00
Michael Brown
cc8821a443 Checking in because I don't want to lose this rather neat code for
running the decompresser in 16:16 protected mode using the real-mode
stack.  However, there's an even simpler way to do it...
2006-05-01 21:26:44 +00:00
Michael Brown
2462047128 Typo 2006-04-30 18:19:39 +00:00
Michael Brown
9e1becaf8a Merge TCP aborted(), timedout() and closed() methods into a single
closed() method with a reason code.
2006-04-30 16:59:45 +00:00
Michael Brown
8afb6303fb Half-way tidy 2006-04-30 15:23:29 +00:00
Michael Brown
04b6a1e004 Make all TCP methods optional; at least FTP data is a read-only
connection and so legitimately ignores acked() and senddata().
2006-04-30 13:20:40 +00:00
Michael Brown
aec0e127d2 Proof-of-concept FTP implementation 2006-04-30 12:02:07 +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
01bd78d62a Created net/tcp and moved hello.c there 2006-04-30 09:34:11 +00:00
Michael Brown
7af478b30d Make tcp_connect() void; it will eventually have no failure case. 2006-04-30 02:13:52 +00:00
Michael Brown
9c9208a132 Put the TCP connection periodic processing in tcp.c, where it belongs. 2006-04-30 02:08:42 +00:00
Michael Brown
178b0a7e5e Consistency 2006-04-30 01:35:01 +00:00
Michael Brown
592a5a99c8 Moved uIP and tcp.c from proto/ to net/ 2006-04-30 01:16:37 +00:00
Michael Brown
352bf1bda2 Move init.h to gpxe/init.h. 2006-04-30 01:08:52 +00:00
Michael Brown
bac97eb979 Change semantics of network API so that packet-absorbing calls *always*
take ownership of the packet, rather than doing so only if they return
success.  This breaks semantic compatibility with Linux's
hard_start_xmit() method, but means that we don't have to worry so much
about error cases.

Split mechanism of processing received packets (net_rx_process()) out
from policy (net_step()), preparatory to putting net_step() in a separate
object.
2006-04-29 17:17:43 +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
5fe31f1014 Give uIP a static IP address for proof-of-concept testing 2006-04-28 14:15:21 +00:00
Michael Brown
129c6c3968 Network layer now works as a proof of concept 2006-04-28 14:13:50 +00:00
Michael Brown
1488cd3b73 Fix a couple of broken assertions, and align the buffer correctly. 2006-04-28 14:09:31 +00:00
Michael Brown
79f64eea55 Transmit the buffer contents, not the buffer descriptor... 2006-04-28 14:08:41 +00:00
Michael Brown
51feeab445 Add an explicit failure debug message 2006-04-28 14:07:41 +00:00
Michael Brown
084f6b18f7 Exclude bin directory from tags generation.
Create something that might be usable as a symbol list for bochs'
internal debugger.
2006-04-28 14:07:08 +00:00
Michael Brown
d8e99bf28f Gave up on adding POSIX errno's as required, and just added (almost) all
of them in one go.

EBADIMG has been replaced by ENOEXEC, and EIMGRET by ECANCELED.
2006-04-28 13:44:34 +00:00
Michael Brown
cfae86f6c8 Glenn managed to shrink .text by 5 more bytes. 2006-04-25 21:48:16 +00:00
Michael Brown
fee8b91015 D'oh 2006-04-25 12:56:18 +00:00
Michael Brown
7a82c3eca3 Added missing ssize_t 2006-04-25 12:55:23 +00:00
Michael Brown
cf3783b4ca Actually, it's probably a good idea to have packet buffers avoid 4kB
crossings.
2006-04-25 12:11:36 +00:00
Michael Brown
00a1de964d Update to use POSIX-like API. 2006-04-25 12:04:07 +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
2f0d412210 Add __constant_flsl(), because it's useful for finding out the next
power-of-two up from a given constant via
  ( 1 << fls ( constant - 1 ) )

fls(), flsl(), ffs() and ffsl() appear in strings.h according to
POSIX.
2006-04-24 23:00:32 +00:00
Michael Brown
a81f96998b Added missing headers required for compilation in Etherboot. 2006-04-24 19:35:10 +00:00
Michael Brown
455b76980f Added pkb_reserve(). 2006-04-24 19:34:51 +00:00
Michael Brown
26749951dc We have our own ARP layer now. 2006-04-24 19:19:13 +00:00
Michael Brown
fcf765e42d Add missing {register,free}_netdev().
Tie into existing driver API; we'll fix that up soon.
2006-04-24 18:44:50 +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
4c4e4de18f (librm_base-1b) is already an offset; no need to apply OFFSET().
Doing so, in fact, seems to expose an assembler bug; (a-b-0) is
apparently not the same as (a-b).  Go figure.
2006-04-24 18:29:47 +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
53f78346bf Network API now allows for multiple network devices (although the
implementation allows for only one, and does so without compromising on
the efficiency of static allocation).

Link-layer protocols are cleanly separated from the device drivers.

Network-layer protocols are cleanly separated from individual network
devices.

Link-layer and network-layer protocols are cleanly separated from each
other.
2006-04-24 15:38:53 +00:00
Michael Brown
fdc2ee79db Network API now allows for multiple network devices (although the
implementation allows for only one, and does so without compromising on
the efficiency of static allocation).

Link-layer protocols are cleanly separated from the device drivers.

Network-layer protocols are cleanly separated from individual network
devices.

Link-layer and network-layer protocols are cleanly separated from each
other.
2006-04-24 15:33:06 +00:00
Michael Brown
0d97f0d482 Obviate uip_init(); our bss is zeroed at startup already. 2006-04-24 15:31:02 +00:00
Michael Brown
5423f876fb Don't bother poisoning lists; it costs code size. 2006-04-24 15:28:56 +00:00
Michael Brown
1d7cfd5acf Prototype now clashes with the macro in arch/i386. 2006-04-24 15:27:58 +00:00
Michael Brown
510ccb2900 Added __constant_memcpy() based on version in Linux's string.h.
Added memswap().
2006-04-24 15:25:25 +00:00
Michael Brown
b6b6a0b5fe First draft of a dynamic memory allocator 2006-04-24 15:21:18 +00:00
Michael Brown
e323d1a29b Add "net" directory.
Avoid including debug information in bin/%.s output, since the whole
point is to have easy-to-read assembler.
2006-04-24 15:20:01 +00:00
Michael Brown
6209bd873a First sketch of a new net device API. 2006-04-19 12:07:46 +00:00
Michael Brown
bdc8190c8d Remove the concept of the media-independent link-layer header and replace
it with metadata in the pkb structure.  This is required since UNDI will
want to be able to parse the link-layer header without destroying it.
2006-04-19 11:32:24 +00:00
Michael Brown
b89ccac02d Updated to remove obsolete constants 2006-04-19 02:11:56 +00:00
Michael Brown
3ca7dbe7ca Added the concept of a network interface (a network-layer concept) as
separate from a network device (a link-layer concept).
2006-04-19 02:09:08 +00:00
Michael Brown
d65a66606b Typo 2006-04-19 02:08:27 +00:00
Michael Brown
2558439ce4 First version, based on include/linux/list.h, stripped down to just
those functions we are likely to need.

Still need to come up with a way of getting the linker to create
static lists using this linking mechanism.
2006-04-19 02:05:50 +00:00
Michael Brown
d24042f0bb Update now that if_ether.h has moved. 2006-04-19 01:56:10 +00:00
Michael Brown
4f3581e99c Added ENOENT and EAFNOSUPPORT 2006-04-19 01:54:53 +00:00
Michael Brown
ab139ceda9 Added pkb_unput() and pkb_len(). 2006-04-19 01:54:24 +00:00
Michael Brown
744b895077 Make flags more efficient.
Add 'raw' net_addr facility (needed for ARP).
2006-04-19 01:53:49 +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
9f67ad9db0 First version. ARP protocol independence in less than the size of uIP's
Ethernet-and-IPv4-only ARP module.  :)
2006-04-19 01:43:56 +00:00
Michael Brown
363905e1b6 Add missing prototype 2006-04-19 01:42:33 +00:00
Michael Brown
02d342f38f First version 2006-04-19 01:42:03 +00:00
Michael Brown
0b561ce972 First sketch 2006-04-18 17:52:51 +00:00
Michael Brown
42b659f926 First version 2006-04-18 17:49:51 +00:00
Michael Brown
0864a73347 First version, based on the concepts in linux/skbuff.h 2006-04-18 17:47:01 +00:00
Michael Brown
1a60444fe4 Added netmask and gateway global options.
Added iSCSI testing.
2006-04-05 11:46:18 +00:00
Michael Brown
6446767258 First draft of iSCSI protocol support. Is capable of retrieving disk
blocks.
2006-04-05 11:44:56 +00:00
Michael Brown
9ea782d339 Make pcap_inject non-static, so that its prototype doesn't conflict with
the real pcap_inject in the case where we do have it.
2006-04-05 11:44:05 +00:00
Michael Brown
c8a7133e9f Added tcp_buffer, to give applications a zero-cost place to build data to
be transmitted.
2006-04-05 11:43:01 +00:00
Michael Brown
988bb50979 Added set_netmask() and set_gateway() 2006-04-05 11:41:15 +00:00
Michael Brown
ee058362fa We don't need to know anything about ARP 2006-03-24 17:39:05 +00:00
Michael Brown
90892d5ec7 Allow specifying the local IP address via --from. 2006-03-24 17:28:40 +00:00
Michael Brown
b44332eb7d Split non-TCP portions of the stack out into ip.[ch].
Added set_ipaddr().
2006-03-24 17:22:09 +00:00
Michael Brown
1c607470e3 Put in a substitute pcap_inject() function, since earlier versions of
libpcap are lacking the function.  For now, we always use the
substitute version, since there's no easy way to determine whether or
not we need it.
2006-03-24 16:43:12 +00:00
Michael Brown
7e61f38799 Moved "hello world" protocol implementation out of prototester.c and into
the first standalong uIP-based protocol module.
2006-03-23 22:37:05 +00:00
Michael Brown
508dcdb303 Added container_of(). This seems about the best place to put it, since
the definition of it uses offsetof(), and the two concepts are related.
2006-03-23 22:07:21 +00:00
Michael Brown
99032becce Pick up the gPXE include files when building prototester. 2006-03-23 21:35:20 +00:00
Michael Brown
2299435f1c Added prototype for inet_ntoa, even though we don't have the function
yet, in order to allow prototester.c to compile.  It might be worth
changing all the uses of "%@" in printf to use "%s" and inet_ntoa
instead, in order to improve the portability of our code.
2006-03-23 21:34:25 +00:00
Michael Brown
a4a0244aa3 Moved uIP wrapper out of prototester.c and into proto/tcp.c. 2006-03-23 21:32:03 +00:00
Michael Brown
17c0253ca0 Add include/gpxe as a directory to scan.
Exclude proto/uip, since uip.c and uip_arp.c both have global variables
called "c", which screws up doxygen's auto-generation of links to file
documentation when it encounters a file name such as "hello.c".
2006-03-23 21:06:36 +00:00
Michael Brown
2bc7c746a6 Updated with "doxygen -u" from doxygen 1.4.4 2006-03-23 20:39:26 +00:00
Michael Brown
05b284399e Moved old tcp.h to old_tcp.h, to avoid name clash with new (uIP-based)
tcp.h.
2006-03-23 20:34:08 +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
55497b3402 Added missing #endif 2006-03-23 19:23:25 +00:00
Michael Brown
cb8e89de15 Added assert.h, with assert() defined (almost) as per POSIX, and
linker_assert() defined as gPXE-specific.
2006-03-23 17:28:51 +00:00
Michael Brown
531371efa2 Removed to make way for the uIP-based tcp.c. 2006-03-23 16:59:25 +00:00
Michael Brown
dde1c5ad18 Moved include/in.h to include/gpxe/in.h, so that it can be included by
prototester.
2006-03-23 16:45:01 +00:00
Michael Brown
eaf40883ff Add Makefile for hijack and prototester utilities. 2006-03-23 13:11:41 +00:00
Michael Brown
21c58729ae Add debug symbols to objects. (They will be stripped out of the final
-Obinary build anyway, so it doesn't waste any space).
2006-03-23 13:09:29 +00:00
Michael Brown
b2c94b32fc Make the application state a void *. 2006-03-23 13:08:06 +00:00
Michael Brown
218c26ff2b Can now also print data sent by the remote side. 2006-03-23 13:06:08 +00:00
Michael Brown
0d506a5c6a Now capable of sending "Hello world!" via TCP. 2006-03-23 12:25:28 +00:00
Michael Brown
911486fe41 Added basic http-specific option parsing 2006-03-22 22:35:32 +00:00
Michael Brown
5263a5abf4 Started adding structure to allow for separate protocol tests, with
individual options.

Created the embryonic beginnings of a cleanly separated driver and
protocol stack API.
2006-03-22 21:25:35 +00:00
Michael Brown
c32e83ad8d Skeleton version: contains device driver (connecting to network via
hijack daemon) and a functional but very ugly and very primitive
wrapper around uIP.

This passes proof-of-concept testing; it successfully initiates a TCP
connection and responds to pings.
2006-03-22 02:23:20 +00:00
Michael Brown
bb37bd47f8 Added from uip-0.9/uip/uip_arp.[ch] 2006-03-22 02:14:55 +00:00
Michael Brown
417e896f0a Remove htons(); it is provided elsewhere in Etherboot 2006-03-22 01:25:43 +00:00
Michael Brown
1c7c24f21f Basic, functional-but-extremely-pessimal versions (taken from
uip-0.9/unix/uip_arch.c).
2006-03-22 01:24:13 +00:00
Michael Brown
c5a9c38606 Terminate cleanly on SIGINT or SIGHUP 2006-03-21 17:48:33 +00:00
Michael Brown
e072baeb8c Use libpcap API to send/receive packets.
Include automatic filtering (based on source MAC address of first
transmitted packet).

Proven to successfully elicit a ping response from a remote host.
2006-03-21 16:50:25 +00:00
Michael Brown
4485df516c Basic structure in place: can daemonise, listen on a Unix domain
socket, accept new connections, open a network interface using libpcap
and forward (all) traffic.
2006-03-21 02:25:30 +00:00
Michael Brown
013ee958a1 These can come back when someone wants to support them 2006-03-17 14:16:05 +00:00
Michael Brown
7be870acd3 More purging 2006-03-17 14:14:36 +00:00
Michael Brown
b2909e547d They can come back when they have someone to support them. 2006-03-17 14:13:09 +00:00
Michael Brown
a2b15fd1fe GPXE code cleanup and purge. 2006-03-17 14:09:45 +00:00
Michael Brown
cdf1511d3e Prefix semantics have changed 2006-03-16 19:28:38 +00:00
Michael Brown
0e611719d2 Add uip on HEAD; it's safe to build, since nothing links against it at the
moment.
2006-03-16 19:18:12 +00:00
Michael Brown
d08ce741a4 Build in gpxe 2006-03-16 19:09:31 +00:00
Michael Brown
0806436d99 Remove accidental duplicate arising from merge 2006-03-16 19:04:19 +00:00
Michael Brown
239579efcf Build under gpxe 2006-03-16 19:02:18 +00:00
Michael Brown
d0777627c6 Back out duplication arising from the merge 2006-03-16 18:56:16 +00:00
Michael Brown
c4f25b637c Fix to compile under gpxe 2006-03-16 18:54:57 +00:00
Michael Brown
4ee0e0f85e Merge from Etherboot 5.4 2006-03-16 18:51:23 +00:00
Michael Brown
46e7bd5b52 Merge from Etherboot 5.4 2006-03-16 18:44:31 +00:00
Michael Brown
7e0a7a2e08 Merge from Etherboot 5.4 2006-03-16 18:30:54 +00:00
Michael Brown
28cefdccc4 Merge from Etherboot 5.4 2006-03-16 18:30:46 +00:00
Michael Brown
9b18017296 Merge from Etherboot 5.4 2006-03-16 18:15:48 +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
9c8a69b673 Merge from Etherboot 5.4 2006-03-16 17:31:29 +00:00
Michael Brown
9b320c1ca4 Merge from Etherboot 5.4 2006-03-16 17:11:36 +00:00
Michael Brown
c3d5d01832 Merge from Etherboot 5.4 2006-03-16 17:05:38 +00:00
Michael Brown
5d28bae0f1 Fix up building with gcc 4.0.1 / gas 2.16.91 2006-01-17 01:47:41 +00:00
George Baum
bd9d4e0bd7 Reorder functions to match the linux driver.
No code changes apart from commenting one unused function out.
2005-07-11 19:26:12 +00:00
Timothy Legge
4184dc5c6a Fix COMET TxUnderrun issue 2005-06-17 20:11:10 +00:00
Geert Stappers
9dc2515d7e no need for depending on build library ("blib")
when make is invoked without arguments
2005-06-14 20:16:03 +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
65a731bed5 Reduce BACKOFF_LIMIT to a hopefully more reasonable value. 2005-06-02 10:16:05 +00:00
Michael Brown
7d8adc25bc In multicast operation, the client still has a unicast local port. 2005-06-02 10:15:40 +00:00
Michael Brown
cbed5ed9ad Always include code for sending multicast packets. 2005-06-02 10:14:26 +00:00
Timothy Legge
95967adc8c Jan Kiszka provided a patch for the smc9000 for missing phy-setup 2005-06-02 01:26:37 +00:00
Michael Brown
f242f56a73 Rewritten to use the functions in tftpcore.c.
Works with a non-multicast TFTP server (i.e. the fallback path works
fine).
2005-06-01 22:26:48 +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
Michael Brown
e0cf144218 IGMP functions separated out from nic.c 2005-06-01 21:18:31 +00:00
Michael Brown
698e87277f Don't try to fetch another packet once we've reached EOF. 2005-06-01 19:13:06 +00:00
Michael Brown
fa17bf0917 Make rfc2090 multicast option optional 2005-06-01 19:10:25 +00:00
Michael Brown
55771a462d Re-order functions for more logical documentation 2005-06-01 18:02:24 +00:00
Michael Brown
f2198e8a65 Don't choke on duplicate OACK packets.
Make await_tftp() static and create tftp_get() for fetching the next TFTP
packet instead.
2005-06-01 18:00:01 +00:00
Michael Brown
378e922f8f Remove prototypes for obsolete functions 2005-06-01 17:57:27 +00:00
Michael Brown
c8d6c4864f Doxygenation 2005-06-01 13:28:07 +00:00
Michael Brown
53a4436d94 TFTP upgraded to use a core function library (in tftpcore.c) which will be
shared between TFTP, TFTM and MTFTP protocols.
2005-06-01 13:13:05 +00:00
Michael Brown
0b048e9cfb Now have enough functions to implement a standard TFTP client in around 50
lines of code.
2005-06-01 11:01:59 +00:00
Michael Brown
7d63b39e3d Add tftp_ack() and tftp_error() 2005-05-31 15:21:33 +00:00
Michael Brown
8ae966720d First version 2005-05-31 14:47:58 +00:00
Geert Stappers
5265975334 patch of Helge Wagner 2005-05-31 11:32:45 +00:00
Michael Brown
59582db29d Documented remainder of PXE TFTP API calls. 2005-05-27 16:47:45 +00:00
Michael Brown
92f1a5c677 Documented the purpose of the two timeout fields in
s_PXENV_TFTP_READ_FILE.
2005-05-27 16:47:16 +00:00
Michael Brown
2ffc960e67 Added diatribe about the mismatch between the PXE spec and the TFTP
protocol, and how we will work around it.
2005-05-27 11:44:46 +00:00
Michael Brown
97675c7129 Refer to implementation note on IP routing. 2005-05-27 11:37:09 +00:00
Michael Brown
6e74dc3460 Added implementation note on IP routing.
Added reason for min value of 512 on s_PXENV_TFTP_OPEN::PacketSize.
2005-05-27 11:36:36 +00:00
Michael Brown
aeb984a1a9 Thoughts on how to coerce the PXE TFTP API into something resembling
the TFTP protocol.
2005-05-26 18:52:12 +00:00
Michael Brown
572483cc59 Separate out the documentation of the PXE API from the documentation of
the Etherboot implementation (i.e. don't do what Intel did).
2005-05-24 17:00:55 +00:00
Michael Brown
2579442865 Remove the annoying #include lines 2005-05-24 00:25:50 +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
7b423c0988 Fixes for gcc >= 3.2 from Georg Baum 2005-05-23 23:47:54 +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
13de295b56 Added interface/pxe directory 2005-05-23 23:31:59 +00:00
Michael Brown
079b5d5527 Moved pxe_loader.c to pxe_image.c to avoid name clash 2005-05-23 23:05:45 +00:00
Michael Brown
8fcb6448bd Moved pxe_errors.c to pxe/interface/ 2005-05-23 22:47:21 +00:00
Michael Brown
8becf0f65f Rearranging PXE header files 2005-05-23 22:45:48 +00:00
George Baum
c4c05bbbf7 the uncontroversal gcc 4.0 compilation fixes 2005-05-23 19:30:37 +00:00
Michael Brown
fd49648a35 Separated out the Etherboot-specific parts of the old pxe.h header. 2005-05-23 16:37:05 +00:00
Michael Brown
b9c7468dea Added PXENV+ and !PXE structures, and the loader API. 2005-05-23 16:26:49 +00:00
Michael Brown
442ba12b9e Finished documenting the UNDI API. 2005-05-23 13:57:23 +00:00
Michael Brown
cd9742e054 Documented up to PXENV_UNDI_CLOSE 2005-05-23 11:00:09 +00:00
Michael Brown
3503941582 Documented Preboot, TFTP and UDP data structures 2005-05-23 10:02:44 +00:00
Michael Brown
eb40aac2b4 Documented PXENV_GET_CACHED_INFO structures 2005-05-22 23:00:56 +00:00
Michael Brown
acb9d42cf8 Add UDP parameter structures 2005-05-22 02:57:50 +00:00
Michael Brown
22b7f0ec74 Define PXE types in terms of other PXE types where possible 2005-05-22 02:57:14 +00:00
Michael Brown
1e0a5d8b30 Worked out a sensible doxygen grouping 2005-05-22 00:59:09 +00:00
Michael Brown
29733a153d Added all API codes and basic prototypes. 2005-05-21 17:19:57 +00:00
Michael Brown
8355ce8a32 Documented the basic PXE data types 2005-05-21 15:15:10 +00:00
Michael Brown
d8f187dc6a Documented the UDP API calls. 2005-05-20 17:50:37 +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
93bb763ade Documented the link stages 2005-05-20 13:35:39 +00:00
Michael Brown
a177c012c1 Documented the compilation stages 2005-05-20 12:44:14 +00:00
Michael Brown
3f4387a6db Enable latex output 2005-05-20 11:52:16 +00:00
Michael Brown
eb28a68831 Add doc/ directory and .S files. 2005-05-20 11:38:48 +00:00
Michael Brown
d5789ff4a2 Doxygenation 2005-05-20 11:28:27 +00:00
Michael Brown
d3dec7c331 Update to cope with changes in registers.h 2005-05-20 11:23:51 +00:00
Michael Brown
5231b858c9 Don't use anonymous entries in a struct; it seems to aggravate gcc 3.4.3. 2005-05-20 11:22:09 +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
7a4b45d3b0 Don't include etherboot.h; we get a circular dependency 2005-05-19 23:21:18 +00:00
Michael Brown
a9fabe7546 Doxygenation 2005-05-19 19:00:21 +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
e14c739d2d Imported from Etherboot 5.4 tree 2005-05-19 16:51:32 +00:00
Michael Brown
4e87543c74 Synced across updates from Etherboot 5.4 tree 2005-05-19 16:47:19 +00:00
Michael Brown
c0a94944fc Added FSP 2005-05-19 16:10:52 +00:00
Michael Brown
1a44618859 Version increased to 5.5.0 2005-05-19 16:07:13 +00:00
Michael Brown
f88c0d42d5 Doxygenation 2005-05-19 15:35:47 +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
dd475a9b8c Add a const to avoid a warning 2005-05-19 13:02:38 +00:00
Michael Brown
2930fe846e Add image formats (didn't check in properly to gpxe for some reason) 2005-05-19 12:58:23 +00:00
Michael Brown
c18ea5282c Doxygenated 2005-05-19 12:53:59 +00:00
Michael Brown
e911a74724 More documentation 2005-05-19 11:54:41 +00:00
Michael Brown
a135024626 load_buffer is now handled via load_buffer.h 2005-05-19 00:19:07 +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
b115d1655c Add include directories as source dirs 2005-05-18 15:24:35 +00:00
Michael Brown
a28b779e71 Only produce documentation where documentation actually exists. 2005-05-18 15:07:19 +00:00
Michael Brown
484d6e7d24 __attribute__ does not need to be treated as a variadic macro, since
it is always used as __attribute__((...)).  Since variadic macros seem
to confuse poor doxygen, change it to a single-valued macro.
2005-05-18 15:02:23 +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
5a0f1bf421 doxygen docs go in bin/doc 2005-05-18 14:43:02 +00:00
Michael Brown
75a90cb143 Hide __attribute__ from doxygen 2005-05-18 14:42:02 +00:00
Michael Brown
0eb4d9973c Add EBADIMG, EIMGRET, ETIMEDOUT and EINVAL 2005-05-18 14:41:53 +00:00
Michael Brown
8e1d7b8a4a doxygen.cfg also references ARCH 2005-05-18 14:39:31 +00:00
Michael Brown
6b01ed0c95 Working to produce reasonably pretty code 2005-05-18 14:38:26 +00:00
Michael Brown
f888bd589d doxygen doesn't allow us to do the --include compiler.h trick... 2005-05-18 14:26:35 +00:00
Michael Brown
783e9ca396 Added doxygen comments and errno values. 2005-05-18 13:22:45 +00:00
Michael Brown
8bf7902141 Added rules to generate documentation using doxygen 2005-05-18 11:13:34 +00:00
Michael Brown
2d9fa8a1d9 Add DOXYGEN definition, comment out reference to not-yet-existent "image"
directory.
2005-05-18 11:12:17 +00:00
Michael Brown
fac5f28d7e There is no arch/i386/firmware/linuxbios directory 2005-05-18 11:11:57 +00:00
Michael Brown
06b2be03c8 All files in here are auto-generated 2005-05-18 10:52:25 +00:00
Michael Brown
7f1901860d Error numbers moved to errno.h 2005-05-18 09:55:38 +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
75a5374d79 Quickly hacked to use a buffer rather than a processor.
These don't yet take advantage of the buffer functionality.
2005-05-17 14:49:46 +00:00
Michael Brown
5fce946de4 Update to use buffer rather than processor 2005-05-17 14:35:20 +00:00
Michael Brown
40c7b127aa Added const to fill_buffer 2005-05-17 14:34:46 +00:00
Michael Brown
5ae60bd95d Updated to use buffer rather than processor 2005-05-17 14:26:14 +00:00
Michael Brown
022661283a Load buffer is now handled by the autoload() function. 2005-05-17 13:44:08 +00:00
Michael Brown
205a7ad5e0 Moved NBI support to nbi.c, modified to work with new load mechanism 2005-05-17 13:42:20 +00:00
Michael Brown
9c832a6a69 First version 2005-05-17 13:41:00 +00:00
Michael Brown
510de6cb8c Restructured to allow per-object image formats 2005-05-17 13:40:31 +00:00
Michael Brown
7205f0846c Heap function prototypes moved to heap.h 2005-05-17 13:39:27 +00:00
Michael Brown
a5f2942587 Add twiddle() so that progress is visible. 2005-05-17 13:39:00 +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
9a413cfea1 Moved os_regs into start32.S 2005-05-17 13:37:01 +00:00
Michael Brown
a76b9c3f19 Added debug messages 2005-05-17 13:36:12 +00:00
Michael Brown
3ce6504f14 Use shared symbols for heap_ptr and heap_end 2005-05-17 13:35:43 +00:00
Michael Brown
479fb900a1 Added copy_phys_to_phys 2005-05-17 13:34:57 +00:00
Michael Brown
4f27994980 Added "image" directory 2005-05-17 13:34:25 +00:00
Michael Brown
6e8f29d3cb Image formats moved into the new config system 2005-05-17 13:33:49 +00:00
Michael Brown
3bbf5f28a3 Use __unused instead of __used for static data structures.
Remove compiler.h defines from osdep.h
2005-05-17 12:16:28 +00:00
Michael Brown
301b2d40f0 Use the heap functions to allocate a load buffer. 2005-05-13 13:30:51 +00:00
Michael Brown
c695c75b01 First version 2005-05-13 13:29:15 +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
94d512b979 Added old allot/forget calls for backwards compatibility. 2005-05-12 16:38:07 +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
f649a4d0fd Add INIT_LOADBUF 2005-05-09 18:04:20 +00:00
Michael Brown
73429d6da1 Make "struct buffer"s reusable between sessions. 2005-05-09 18:03:44 +00:00
Michael Brown
b94def2088 Include string.h, because we need to define copy_{to,from}_phys 2005-05-09 18:03:14 +00:00
Michael Brown
9fc97f8513 First version 2005-05-09 18:02:22 +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
116f17f605 off_t should be signed. 2005-05-09 14:26:25 +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
e3f2aa7b4d Add off_t and physaddr_t, and the copy_{to,from}_phys helper routines. 2005-05-09 13:21:56 +00:00
Michael Brown
dc0aa58fb2 Add memcpy 2005-05-09 12:48:00 +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
e91c65bea1 Make PCI ID tables const so as not to trigger a warning about a large
symbol.
2005-05-03 12:36:06 +00:00
Michael Brown
cc73bba7ba Allow read-only symbols to be large 2005-05-03 12:34:52 +00:00
Michael Brown
24c0498cbc Move tulip_private structure into shared data. 2005-05-03 12:29:32 +00:00
Michael Brown
7df2857248 Reduce large symbol warning threshold, now that most of the really
large symbols have been fixed.
2005-05-03 12:24:52 +00:00
Michael Brown
42eb786ced D'oh 2005-05-03 12:18:31 +00:00
Michael Brown
4bcd42699b Use __shared 2005-05-03 12:16:49 +00:00
Michael Brown
303ff86c75 Added example of how to use __shared.
Moved transmit before poll, since typically transmit will be implemented first.
2005-05-03 12:14:29 +00:00
Michael Brown
ff8e46f2f3 #if 0 out the whole file for now; it cannot be linked because the base
memory interface has changed.
2005-05-03 11:56:33 +00:00
Michael Brown
0174310f38 Re-add the "etherboot.%" all-drivers image. 2005-05-03 11:51:19 +00:00
Michael Brown
c112f12c5b Symbol fixups 2005-05-03 11:29:33 +00:00
Michael Brown
3c2851e563 Arbitrary alignment is now available.
Use shared symbols.
Correct other symbol violations.
2005-05-03 09:56:57 +00:00
Michael Brown
68e90c75b6 Removed spurious semicolon 2005-05-03 09:02:24 +00:00
Michael Brown
ee15c47cb5 Use shared symbols 2005-05-02 17:45:24 +00:00
Michael Brown
3267ca5568 Use shared symbols to save space 2005-05-02 16:35:44 +00:00
Michael Brown
60b82eb5cd Moved definition of __shared into compiler.h 2005-05-02 16:21:52 +00:00
Michael Brown
a1f50f27b0 Correct symbol violations reported by "make symcheck" 2005-05-02 15:22:32 +00:00
Michael Brown
35ab3bf808 Report on misuses of shared symbols, and excessively large static symbols. 2005-05-02 15:21:12 +00:00
Michael Brown
734d2e9f2d First version 2005-05-02 14:43:15 +00:00
Michael Brown
88baf7a383 Tweaked to read more information (including symbol size) from blib.a 2005-05-02 13:49:54 +00:00
Michael Brown
48e40e933f Add DOWNLOAD_PROTO_XXX options. 2005-05-02 12:45:23 +00:00
Michael Brown
4ed412f1c2 Updated to use new URL parser and new protocol API.
Sort of works; the HTTP stuff is fine but the TCP code seems to be
broken; it doesn't ACK the packets and just hands us the retransmitted
packets instead.
2005-05-02 12:10:14 +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
f14af3d95c Protocol structure can now specify the default port. 2005-05-01 23:57:09 +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
17bb10479d Protocol names are x-slam and x-tftm 2005-05-01 15:50:08 +00:00
Michael Brown
6afffc0771 Updated to protocol API 2005-05-01 15:36:39 +00:00
Michael Brown
5c2e5557f0 Updated to protocol API 2005-05-01 15:26:44 +00:00
Michael Brown
1fdbbaa237 Removed obsolete prototypes. 2005-05-01 15:14:22 +00:00
Michael Brown
3af0af65a0 Updated to new protocol API, made to compile. 2005-05-01 15:08:39 +00:00
Michael Brown
2227a711fd umountall() handled by nfs.c's reset function 2005-05-01 15:08:19 +00:00
Michael Brown
d727e144c1 nfs prototypes no longer required. 2005-05-01 15:07:55 +00:00
Michael Brown
52b3c8babe Add INIT_RPC 2005-05-01 15:07:35 +00:00
Michael Brown
85d9eae44e Moved protocols to proto/ 2005-05-01 14:04:11 +00:00
Michael Brown
0cfcd91558 Abort immediately if no nameserver is present. 2005-05-01 13:59:34 +00:00
Michael Brown
bcedad4708 Add debugging for CNAME records.
Allow routines to be called by nmb.c
2005-05-01 11:30:26 +00:00
Michael Brown
3ae7a3d1f0 NMB packets are so similar to DNS packets; we may as well add NMB as a
name resolution method.
2005-05-01 11:10:17 +00:00
Michael Brown
e1d6f3a8ac Add NMB_RESOLVER 2005-05-01 10:58:49 +00:00
Michael Brown
89f4fe4a8a Do not include etherboot.h 2005-05-01 10:40:12 +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
138c987738 Straightforward A record resolution now known working. 2005-04-30 19:38:51 +00:00
Michael Brown
3b59bf559c ttl is a uint32_t 2005-04-30 19:38:31 +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
5f45f14b5f tftp moved to separate file. 2005-04-30 14:46:18 +00:00
Michael Brown
06634dc386 Protocols get passed a pointer to the filename portion as well as just the
URL.
2005-04-30 14:45:51 +00:00
Michael Brown
5bec933c66 tftp prototypes moved to tftp.h 2005-04-30 14:45:33 +00:00
Michael Brown
95946c6f56 Added "proto" directory 2005-04-30 14:45:09 +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
332b40b986 loadkernel no longer exists; it is now download_url and lives in nic.c. 2005-04-30 13:51:18 +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
55ae308821 Protocols also take a pointer to a sockaddr_in. 2005-04-30 13:50:01 +00:00
Michael Brown
00b78f73a4 Use struct in_addr rather than just "in_addr".
Add struct sockaddr_in.
2005-04-30 13:49:28 +00:00
Michael Brown
70567c51a2 Moved strtoul prototype into stdlib.h for consistency 2005-04-30 13:48:48 +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
754cef922d First version 2005-04-28 13:47:36 +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
282b6f1a1a isa.c uses the new table infrastructure. 2005-04-27 12:24:38 +00:00
Michael Brown
f37e0a06d7 dev.c uses the new tables infrastructure. 2005-04-27 12:20:54 +00:00
Michael Brown
c08671e5fc Missing include 2005-04-27 12:17:09 +00:00
Michael Brown
b9e72856b6 Post-relocation functions use the generic table mechanism. 2005-04-27 12:10:24 +00:00
Michael Brown
d2d4978f4f Use PREFIX_OBJECT to give the init_fn table variables meaningful names. 2005-04-27 12:08:52 +00:00
Michael Brown
c8fc121890 Special handling for symbols of the form "xxx_end", to make table end
markers appear before the symbols that immediately follow the table.
2005-04-27 12:08:13 +00:00
Michael Brown
1ddcdb0524 Added PREFIX_OBJECT() function to be able to easily prepend any string
to the object name in order to generate e.g. per-file variables.
2005-04-27 11:59:37 +00:00