people/meteger/gpxe.git
13 years agoInclude stdlib.h rather than malloc.h
Michael Brown [Thu, 18 Jan 2007 20:06:03 +0000 (20:06 +0000)]
Include stdlib.h rather than malloc.h

13 years agoconsole.h is no longer needed for debugging
Michael Brown [Thu, 18 Jan 2007 19:13:25 +0000 (19:13 +0000)]
console.h is no longer needed for debugging

13 years agoAllow truly arbitrary debug levels to be specified via DEBUG=
Michael Brown [Thu, 18 Jan 2007 19:00:09 +0000 (19:00 +0000)]
Allow truly arbitrary debug levels to be specified via DEBUG=

13 years agoDeclaring the CPU architecture in the middle of an assembly file is
Michael Brown [Thu, 18 Jan 2007 18:53:32 +0000 (18:53 +0000)]
Declaring the CPU architecture in the middle of an assembly file is
somewhat redundant, and also causes gas to complain when we include
the profiling code (which uses an i586 instruction).

13 years agoAdd DBGLVL_PROFILE
Michael Brown [Thu, 18 Jan 2007 17:59:59 +0000 (17:59 +0000)]
Add DBGLVL_PROFILE

13 years agoRemove the one-packet-per-poll-cycle limit; it seems to no longer be
Michael Brown [Thu, 18 Jan 2007 16:50:35 +0000 (16:50 +0000)]
Remove the one-packet-per-poll-cycle limit; it seems to no longer be
needed now that performance is up.

13 years agoIncrease window size to 64kB. Line rate downloads on a 100Mbps link,
Michael Brown [Thu, 18 Jan 2007 16:39:55 +0000 (16:39 +0000)]
Increase window size to 64kB.  Line rate downloads on a 100Mbps link,
anyone?

13 years agoAccelerate memcpy() by around 32% on large, dword-aligned copies.
Michael Brown [Thu, 18 Jan 2007 15:18:02 +0000 (15:18 +0000)]
Accelerate memcpy() by around 32% on large, dword-aligned copies.

13 years agoAllow buffers to be pre-expanded on demand.
Michael Brown [Thu, 18 Jan 2007 15:13:41 +0000 (15:13 +0000)]
Allow buffers to be pre-expanded on demand.

13 years agoPresize the download buffer when we see the Content-Length header;
Michael Brown [Thu, 18 Jan 2007 13:26:57 +0000 (13:26 +0000)]
Presize the download buffer when we see the Content-Length header;
this saves around 70us per received packet (which is around 50% of the
overall packet processing time).

13 years agoReorder functions to more closely reflect the flow of control
Michael Brown [Thu, 18 Jan 2007 13:10:26 +0000 (13:10 +0000)]
Reorder functions to more closely reflect the flow of control

13 years agoDon't always zero memory in malloc(). This saves around 2us on a
Michael Brown [Thu, 18 Jan 2007 12:54:18 +0000 (12:54 +0000)]
Don't always zero memory in malloc().  This saves around 2us on a
full-length PKB allocation.

13 years agoSwitch from calloc() to malloc()+memset() to match the practices used
Michael Brown [Thu, 18 Jan 2007 12:45:58 +0000 (12:45 +0000)]
Switch from calloc() to malloc()+memset() to match the practices used
almost everywhere else.

13 years agoRespect the RX quota. This improves poll time by about 0.7us when the
Michael Brown [Thu, 18 Jan 2007 12:34:12 +0000 (12:34 +0000)]
Respect the RX quota.  This improves poll time by about 0.7us when the
quota is 1.

13 years agoHTTP/DNS now working fully asynchronously. HTTP/IP addresses and any
Michael Brown [Thu, 18 Jan 2007 03:39:45 +0000 (03:39 +0000)]
HTTP/DNS now working fully asynchronously.  HTTP/IP addresses and any
other protocol won't work at the moment.

13 years agoReplacement for fetch() which operates asynchronously and identifies
Michael Brown [Thu, 18 Jan 2007 03:37:05 +0000 (03:37 +0000)]
Replacement for fetch() which operates asynchronously and identifies
protocols by URI scheme.

13 years agoUse struct sockaddr rather than struct sockaddr_tcpip
Michael Brown [Thu, 18 Jan 2007 03:35:00 +0000 (03:35 +0000)]
Use struct sockaddr rather than struct sockaddr_tcpip

Tidy up code

13 years agoAdded async_uninit() to simplify failure paths.
Michael Brown [Thu, 18 Jan 2007 03:29:40 +0000 (03:29 +0000)]
Added async_uninit() to simplify failure paths.

13 years agoAdd utility function to parse port from URI
Michael Brown [Thu, 18 Jan 2007 03:28:55 +0000 (03:28 +0000)]
Add utility function to parse port from URI

13 years agoEnsure that struct sockaddr is long enough...
Michael Brown [Thu, 18 Jan 2007 03:28:29 +0000 (03:28 +0000)]
Ensure that struct sockaddr is long enough...

13 years agoObsolete
Michael Brown [Thu, 18 Jan 2007 01:05:09 +0000 (01:05 +0000)]
Obsolete

13 years agoRename e{malloc,realloc,free} to u{malloc,realloc,free}, to more obviously
Michael Brown [Tue, 16 Jan 2007 08:36:42 +0000 (08:36 +0000)]
Rename e{malloc,realloc,free} to u{malloc,realloc,free}, to more obviously
reflect the fact that they allocate and deallocate user memory (i.e.
things reached through a userptr_t).

13 years agoCreate and use async_block() macro; it cuts down on the visual overhead
Michael Brown [Tue, 16 Jan 2007 08:10:54 +0000 (08:10 +0000)]
Create and use async_block() macro; it cuts down on the visual overhead
of blocking on asynchronous operations, when that isn't an important
aspect of the code.

13 years agoWhen a network device is specified to tcpip_tx() or it's children, treat
Michael Brown [Tue, 16 Jan 2007 04:09:13 +0000 (04:09 +0000)]
When a network device is specified to tcpip_tx() or it's children, treat
it as a fallback network device rather than an explicitly forced network
device.

Clear routing table entries before re-attempting DHCP.

13 years agoImprove debugging
Michael Brown [Tue, 16 Jan 2007 03:29:15 +0000 (03:29 +0000)]
Improve debugging

13 years agoImprove debug messages
Michael Brown [Tue, 16 Jan 2007 03:19:40 +0000 (03:19 +0000)]
Improve debug messages

13 years agoImproved debugging
Michael Brown [Tue, 16 Jan 2007 03:10:37 +0000 (03:10 +0000)]
Improved debugging

13 years agoQuickly hack in DNS resolution as a proof of concept
Michael Brown [Mon, 15 Jan 2007 17:32:52 +0000 (17:32 +0000)]
Quickly hack in DNS resolution as a proof of concept

13 years agoA working DNS resolver (not yet tied in to anything)
Michael Brown [Mon, 15 Jan 2007 17:31:35 +0000 (17:31 +0000)]
A working DNS resolver (not yet tied in to anything)

13 years agoUpdate TFTP and FTP to take the same temporary URI scheme as HTTP
Michael Brown [Mon, 15 Jan 2007 09:58:26 +0000 (09:58 +0000)]
Update TFTP and FTP to take the same temporary URI scheme as HTTP

13 years agoProtocol's get() method no longer takes ownership of the URI. HTTP is the
Michael Brown [Mon, 15 Jan 2007 09:18:06 +0000 (09:18 +0000)]
Protocol's get() method no longer takes ownership of the URI.  HTTP is the
exception rather than the rule; we may as well keep things clean for other
protocols.

13 years agoMust free http on the error path; nothing else will do it
Michael Brown [Mon, 15 Jan 2007 09:08:40 +0000 (09:08 +0000)]
Must free http on the error path; nothing else will do it

13 years agoUnmaintained example code is probably worse than useless.
Michael Brown [Mon, 15 Jan 2007 09:06:12 +0000 (09:06 +0000)]
Unmaintained example code is probably worse than useless.

13 years agoGave asynchronous operations approximate POSIX signal semantics. This
Michael Brown [Mon, 15 Jan 2007 08:49:10 +0000 (08:49 +0000)]
Gave asynchronous operations approximate POSIX signal semantics.  This
will enable us to cascade async operations, which is necessary in order to
properly support DNS.  (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).

Anything other than HTTP is probably broken right now; I'll fix the others
up asap.

13 years agoAdd missing include
Michael Brown [Mon, 15 Jan 2007 08:44:05 +0000 (08:44 +0000)]
Add missing include

13 years agoAdd ETIMEDOUT
Michael Brown [Mon, 15 Jan 2007 02:46:56 +0000 (02:46 +0000)]
Add ETIMEDOUT

13 years agoAdded a URI parser that should be standards conformant. (It can certainly
Michael Brown [Sun, 14 Jan 2007 23:48:31 +0000 (23:48 +0000)]
Added a URI parser that should be standards conformant.  (It can certainly
handle something as convoluted as

  ftp://joe:secret@insecure.org:8081/hidden/path/to?what=is#this

13 years agoSplit DBG() statement containing two inet_ntoa() statements; they
Michael Brown [Sun, 14 Jan 2007 19:58:41 +0000 (19:58 +0000)]
Split DBG() statement containing two inet_ntoa() statements; they
return a static buffer.

13 years agoDump buffer and packet information in PXENV_UDP_READ as well
Michael Brown [Sun, 14 Jan 2007 18:22:37 +0000 (18:22 +0000)]
Dump buffer and packet information in PXENV_UDP_READ as well

13 years agoMake TCP give up immediately when it receives -ENETUNREACH from
Michael Brown [Sun, 14 Jan 2007 16:47:03 +0000 (16:47 +0000)]
Make TCP give up immediately when it receives -ENETUNREACH from
tcpip_tx().  This avoids the irritating wait when you accidentally type
"kernel pxelinux.0" before bringing up the network interface.

Add ENETUNREACH to strerror()'s list.

13 years agoUse -ENETUNREACH to mean "no reachable network device exists, don't bother
Michael Brown [Sun, 14 Jan 2007 16:22:10 +0000 (16:22 +0000)]
Use -ENETUNREACH to mean "no reachable network device exists, don't bother
retrying".

13 years agoAdd the "initrd" command
Michael Brown [Sun, 14 Jan 2007 16:09:48 +0000 (16:09 +0000)]
Add the "initrd" command

13 years agoWe can now load an initrd as well as a kernel
Michael Brown [Sun, 14 Jan 2007 16:09:01 +0000 (16:09 +0000)]
We can now load an initrd as well as a kernel

13 years agoMake the getmemsize() prototype available in memsizes.h, for code that
Michael Brown [Sun, 14 Jan 2007 15:32:25 +0000 (15:32 +0000)]
Make the getmemsize() prototype available in memsizes.h, for code that
doesn't want to go to the hassle of processing a full memory map.

13 years agoOnce image type has been set, do not autoprobe further
Michael Brown [Sun, 14 Jan 2007 15:25:23 +0000 (15:25 +0000)]
Once image type has been set, do not autoprobe further

13 years agoTypo
Michael Brown [Sun, 14 Jan 2007 15:13:33 +0000 (15:13 +0000)]
Typo

13 years agoActually, the initrd image should be architecture-independent.
Michael Brown [Sun, 14 Jan 2007 15:07:11 +0000 (15:07 +0000)]
Actually, the initrd image should be architecture-independent.

13 years agoAdd dummy "initrd" image format, just so that images can be marked as
Michael Brown [Sun, 14 Jan 2007 15:03:39 +0000 (15:03 +0000)]
Add dummy "initrd" image format, just so that images can be marked as
initrds.

13 years agoAllow load() and exec() methods to be NULL.
Michael Brown [Sun, 14 Jan 2007 14:59:36 +0000 (14:59 +0000)]
Allow load() and exec() methods to be NULL.

13 years agoCopy command line at execution time rather than load time.
Michael Brown [Sun, 14 Jan 2007 14:29:30 +0000 (14:29 +0000)]
Copy command line at execution time rather than load time.

Parse command line for "vga=" and "mem=" parameters

13 years agoSplit bzimage_load into separate functions
Michael Brown [Sun, 14 Jan 2007 13:36:33 +0000 (13:36 +0000)]
Split bzimage_load into separate functions

13 years agoCan start a Linux kernel directly (albeit with no initrd support)
Michael Brown [Sun, 14 Jan 2007 12:34:35 +0000 (12:34 +0000)]
Can start a Linux kernel directly (albeit with no initrd support)

13 years agoRemove some references to no-longer-existent source files.
Michael Brown [Sun, 14 Jan 2007 11:52:22 +0000 (11:52 +0000)]
Remove some references to no-longer-existent source files.

Add a path for isolinux.bin that is correct on my system; hopefully it
will work on others too.

13 years ago.lilo and derived targets (e.g. .iso) now load properly.
Michael Brown [Sun, 14 Jan 2007 11:50:44 +0000 (11:50 +0000)]
.lilo and derived targets (e.g. .iso) now load properly.

13 years agoObsoleted by arch/i386/image/multiboot.c
Michael Brown [Sun, 14 Jan 2007 11:45:28 +0000 (11:45 +0000)]
Obsoleted by arch/i386/image/multiboot.c

13 years agoCan almost start a kernel now. It dies with "No setup signature found"
Michael Brown [Sun, 14 Jan 2007 06:36:20 +0000 (06:36 +0000)]
Can almost start a kernel now.  It dies with "No setup signature found"

13 years agoObsolete
Michael Brown [Sun, 14 Jan 2007 04:28:42 +0000 (04:28 +0000)]
Obsolete

13 years agoPlaceholder bzImage support
Michael Brown [Sun, 14 Jan 2007 04:27:25 +0000 (04:27 +0000)]
Placeholder bzImage support

13 years agoReplace image->entry with image->priv.
Michael Brown [Sun, 14 Jan 2007 04:04:28 +0000 (04:04 +0000)]
Replace image->entry with image->priv.

13 years agoMostly updated. Won't work yet.
Michael Brown [Sun, 14 Jan 2007 03:49:07 +0000 (03:49 +0000)]
Mostly updated.  Won't work yet.

13 years agoObsolete for some time
Michael Brown [Sun, 14 Jan 2007 02:24:41 +0000 (02:24 +0000)]
Obsolete for some time

13 years agoFill in BufferSize in PXENV_GET_CACHED_INFO
Michael Brown [Sun, 14 Jan 2007 02:21:02 +0000 (02:21 +0000)]
Fill in BufferSize in PXENV_GET_CACHED_INFO

13 years agoSelect a PXE network device before starting PXE NBP.
Michael Brown [Sun, 14 Jan 2007 02:20:10 +0000 (02:20 +0000)]
Select a PXE network device before starting PXE NBP.

Move pxe_boot() code to pxe_image.c

13 years agoDo not go past the end of the argv[] array.
Michael Brown [Sun, 14 Jan 2007 02:01:26 +0000 (02:01 +0000)]
Do not go past the end of the argv[] array.

This bug found by setting read and write watchpoints at NULL in bochs.

13 years agoUse debug autocolourisation.
Michael Brown [Sun, 14 Jan 2007 00:57:43 +0000 (00:57 +0000)]
Use debug autocolourisation.

Shut down before jumping to the multiboot image.

13 years agoCall hide_etherboot() from startup(), rather than requiring the prefix to
Michael Brown [Sun, 14 Jan 2007 00:53:56 +0000 (00:53 +0000)]
Call hide_etherboot() from startup(), rather than requiring the prefix to
do it.

13 years agoMake shutdown functions callable by OS image's exec methods.
Michael Brown [Sun, 14 Jan 2007 00:16:41 +0000 (00:16 +0000)]
Make shutdown functions callable by OS image's exec methods.

13 years agoMake "boot" a synonym for "imgexec", to match grub
Michael Brown [Sun, 14 Jan 2007 00:08:13 +0000 (00:08 +0000)]
Make "boot" a synonym for "imgexec", to match grub

13 years agoRename "boot" to "autoboot"
Michael Brown [Sun, 14 Jan 2007 00:06:23 +0000 (00:06 +0000)]
Rename "boot" to "autoboot"

13 years agoUse _text, rather than assuming _text==0.
Michael Brown [Sun, 14 Jan 2007 00:03:07 +0000 (00:03 +0000)]
Use _text, rather than assuming _text==0.

13 years agoUse {get,set}_fbms() so that allocated base memory is correctly hidden.
Michael Brown [Sun, 14 Jan 2007 00:01:16 +0000 (00:01 +0000)]
Use {get,set}_fbms() so that allocated base memory is correctly hidden.

13 years agoProvide {get,set}_fbms() in basemem.h.
Michael Brown [Sat, 13 Jan 2007 23:57:31 +0000 (23:57 +0000)]
Provide {get,set}_fbms() in basemem.h.

set_fbms() will also update the E820 hidden region.

13 years agoSome operating systems get a nasty shock if a region of the E820 map seems
Michael Brown [Sat, 13 Jan 2007 23:38:33 +0000 (23:38 +0000)]
Some operating systems get a nasty shock if a region of the E820 map seems
to start on a non-page boundary.  Make life safer by rounding out our
edited regions.

13 years agoAdd some trace messages for important events
Michael Brown [Sat, 13 Jan 2007 17:54:41 +0000 (17:54 +0000)]
Add some trace messages for important events

13 years agoAdvertise a larger MSS to improve TCP performance.
Michael Brown [Sat, 13 Jan 2007 17:36:17 +0000 (17:36 +0000)]
Advertise a larger MSS to improve TCP performance.

13 years agoI prefer IMAGE_XXX to XXX_IMAGE.
Michael Brown [Sat, 13 Jan 2007 17:28:51 +0000 (17:28 +0000)]
I prefer IMAGE_XXX to XXX_IMAGE.

Add IMAGE_PXE to use the new image format framework.  "kernel pxelinux.0"
now works.

13 years agoAdd header for pxe_boot()
Michael Brown [Sat, 13 Jan 2007 17:23:44 +0000 (17:23 +0000)]
Add header for pxe_boot()

13 years agoPick up the return status code from the correct place now that we
Michael Brown [Sat, 13 Jan 2007 16:55:57 +0000 (16:55 +0000)]
Pick up the return status code from the correct place now that we
don't overwrite the parameter block until *after* the debug code.

13 years agoWhen an UNDI API call fails, print everything there is to know about it.
Michael Brown [Sat, 13 Jan 2007 16:53:55 +0000 (16:53 +0000)]
When an UNDI API call fails, print everything there is to know about it.

13 years agoHex dumps are now integrated into the DBG() framework.
Michael Brown [Sat, 13 Jan 2007 16:49:38 +0000 (16:49 +0000)]
Hex dumps are now integrated into the DBG() framework.

13 years agoAlways send EOI. We can't feasibly share interrupts (since we have no
Michael Brown [Sat, 13 Jan 2007 14:45:26 +0000 (14:45 +0000)]
Always send EOI.  We can't feasibly share interrupts (since we have no
clue what the "previous" interrupt handler will do, which could range
from "just an iret" to "disable the interrupt"), and that means that
we have to take responsibility for ACKing all interrupts.  Joy.

13 years agoDamn Broadcom and their damned incorrect assumptions about x86 memory
Michael Brown [Sat, 13 Jan 2007 01:48:12 +0000 (01:48 +0000)]
Damn Broadcom and their damned incorrect assumptions about x86 memory
allocation.

13 years agoAdd HTTP test support
Michael Brown [Fri, 12 Jan 2007 19:19:59 +0000 (19:19 +0000)]
Add HTTP test support

13 years agoFixed HTTP
Michael Brown [Fri, 12 Jan 2007 19:18:13 +0000 (19:18 +0000)]
Fixed HTTP

13 years agoWhitespace fix
Michael Brown [Fri, 12 Jan 2007 19:17:25 +0000 (19:17 +0000)]
Whitespace fix

13 years agoAdded ENOENT, since HTTP 404 translates to it
Michael Brown [Fri, 12 Jan 2007 19:14:01 +0000 (19:14 +0000)]
Added ENOENT, since HTTP 404 translates to it

13 years agoAdded isspace() and made strtoul() accept whitespace, as per POSIX.
Michael Brown [Fri, 12 Jan 2007 19:11:28 +0000 (19:11 +0000)]
Added isspace() and made strtoul() accept whitespace, as per POSIX.

13 years agoDamn it; my lovely resilient scheme falls down when you have a protocol
Michael Brown [Fri, 12 Jan 2007 18:09:14 +0000 (18:09 +0000)]
Damn it; my lovely resilient scheme falls down when you have a protocol
that switches from line-oriented to byte-oriented partway through, such as
HTTP.

13 years agoNo need to maintain a received byte count; we always fill in sequential
Michael Brown [Fri, 12 Jan 2007 17:16:46 +0000 (17:16 +0000)]
No need to maintain a received byte count; we always fill in sequential
order so we can just use buffer->fill.

13 years agoAdded generic line-buffering code (a la stdio)
Michael Brown [Fri, 12 Jan 2007 17:08:37 +0000 (17:08 +0000)]
Added generic line-buffering code (a la stdio)

13 years agoPlace multiboot tables in base memory; at least some OSes won't see it
Michael Brown [Fri, 12 Jan 2007 16:25:05 +0000 (16:25 +0000)]
Place multiboot tables in base memory; at least some OSes won't see it
if we don't.

13 years agoPrint image physical location in registration message.
Michael Brown [Fri, 12 Jan 2007 16:20:51 +0000 (16:20 +0000)]
Print image physical location in registration message.

13 years agoEnsure multiboot modules are in ascending order of memory start
Michael Brown [Fri, 12 Jan 2007 12:03:19 +0000 (12:03 +0000)]
Ensure multiboot modules are in ascending order of memory start
address, to work around OS bugs.

13 years agoFix the memory map.
Michael Brown [Fri, 12 Jan 2007 11:38:04 +0000 (11:38 +0000)]
Fix the memory map.

13 years agoCode used for load buffer and multiboot image testing
Michael Brown [Fri, 12 Jan 2007 10:12:11 +0000 (10:12 +0000)]
Code used for load buffer and multiboot image testing

13 years agoUse dhcp(), imgfetch() etc. to boot rather than dhcp_test().
Michael Brown [Fri, 12 Jan 2007 10:08:27 +0000 (10:08 +0000)]
Use dhcp(), imgfetch() etc. to boot rather than dhcp_test().

13 years agoAdded missing declaration.
Michael Brown [Fri, 12 Jan 2007 10:07:56 +0000 (10:07 +0000)]
Added missing declaration.

13 years agoMake DEBUG=script echo the commands as they are executed
Michael Brown [Fri, 12 Jan 2007 10:06:59 +0000 (10:06 +0000)]
Make DEBUG=script echo the commands as they are executed

13 years agoAdd "dhcp" command
Michael Brown [Fri, 12 Jan 2007 09:53:28 +0000 (09:53 +0000)]
Add "dhcp" command

13 years agoLet ifmgmt.c take care of calling efree(), since it's the once which
Michael Brown [Fri, 12 Jan 2007 09:46:10 +0000 (09:46 +0000)]
Let ifmgmt.c take care of calling efree(), since it's the once which
took out the contract to eventually call efree() when it called fetch().

Maintain the most recently loaded image at the start of the list, so that
imgautoselect() will pick it.