david/ipxe
Archived
1
0
Commit Graph

371 Commits

Author SHA1 Message Date
Michael Brown
59e738d756 Prefix all the open()-family routines with xfer_, to disambiguate them
from the normal POSIX-style open()
2007-05-18 14:16:06 +00:00
Michael Brown
b1755462ab Do not hold self-references. This then avoids the problem of having to
ensure that we only drop our self-reference exactly once.

To maintain the guarantee that an object won't go out of scope
unexpectedly while one of its event handlers is being called, the
event-calling functions now automatically obtain and drop extra
references.
2007-05-15 16:53:46 +00:00
Michael Brown
5471bfbbbe Data-transfer interface should now be functionally complete. 2007-05-15 15:23:09 +00:00
Michael Brown
53da1f1402 Initial sketch for a downloader object 2007-05-01 00:09:19 +00:00
Michael Brown
e3dcb9a1ad Add start() event
Add "xfer" to all xfer functions and "job" to all job functions.
2007-05-01 00:07:57 +00:00
Michael Brown
a90a9adbd7 Clarify behaviour of plug() by using intf_put() and intf_get(). 2007-05-01 00:06:21 +00:00
Michael Brown
31f1bf4426 D'oh 2007-04-30 01:24:52 +00:00
Michael Brown
0898b0b3b1 Added plug_plug() 2007-04-30 01:23:01 +00:00
Michael Brown
d40761d725 Add (and use) generic reference counter, to improve signal:noise ratio
in code defining reference-counted objects.
2007-04-29 23:53:39 +00:00
Michael Brown
36bfb6edbb Skeleton job control interface 2007-04-29 02:08:39 +00:00
Michael Brown
280160139d Add seek()
Dehyphenate "data-transfer".
2007-04-29 02:03:58 +00:00
Michael Brown
ff1222a8d3 Preliminary support for opening data-transfer interfaces 2007-04-28 20:56:24 +00:00
Michael Brown
1c765b3988 Added deliver-as-iobuf/deliver-as-raw concepts. 2007-04-27 00:02:23 +00:00
Michael Brown
2575ddc889 Initial sketch for the generic data-transfer interface. 2007-04-26 22:44:52 +00:00
Anselm Martin Hoffmeister
ed7dc02a95 hoffmeis: Preparations for syslog support (LOGSERVER in DHCP, linewise
output buffering defintions and the like)
2007-04-09 18:01:43 +00:00
Michael Brown
abccb8b63c SSL requires inordinately large data storage 2007-02-01 07:22:13 +00:00
Michael Brown
2cf1e33df1 Split bootsector execution code out into bootsector.c.
Added basic El Torito ISO image boot capability
2007-01-29 04:21:38 +00:00
Michael Brown
bde8878eef Keep HTTP progress updated, and display a progress indicator during the
download
2007-01-29 04:19:45 +00:00
Michael Brown
1a79437888 Added async_block_progress() and default SIGUPDATE handler. 2007-01-29 04:15:24 +00:00
Michael Brown
c42a384709 Moved most buffer debug messages to DBG2.
Make expand_buffer() a non-inline function, so that we can add debug
messages.

Expandable buffers now don't *always* round up to the next power of two.
This allows e.g. loading a 137MB ISO image on a machine with only 256MB
RAM...
2007-01-29 04:12:29 +00:00
Michael Brown
6417a6adf0 Avoid barfing on gcc's implicit memcpy()s 2007-01-26 04:14:25 +00:00
Michael Brown
afe4e011ac Move tolower() etc to ctype.h as per ISO C 2007-01-26 03:25:19 +00:00
Michael Brown
13d9a660ca Zeroing out memory before using it can be so important. 2007-01-19 14:44:59 +00:00
Michael Brown
d6909f65f0 Actually, it's probably safer *not* to leave child processes hanging
around which still hold pointers to variables belonging to our parent...
2007-01-19 14:20:41 +00:00
Michael Brown
b6194b8cb9 Note that the SIGCHLD handler could be re-entered. 2007-01-19 14:10:13 +00:00
Michael Brown
1411876e26 Propagate return status code from last child to fail. 2007-01-19 14:00:51 +00:00
Michael Brown
4256b3338a Split random number generation out into core/random.c, and create the
correct prototypes for srandom(), rand() and srand().
2007-01-19 02:02:59 +00:00
Michael Brown
f4c1e564a1 vsprintf.h is gPXE-specific; move it to include/gpxe 2007-01-19 01:17:23 +00:00
Michael Brown
73b09ecba6 Use stdio.h instead of vsprintf.h 2007-01-19 01:13:12 +00:00
Michael Brown
4e3976711d A working name resolution framework 2007-01-18 22:38:13 +00:00
Michael Brown
8bb9f726a0 When an async operation dies, orphan its children. 2007-01-18 22:36:57 +00:00
Michael Brown
6d4e37cf42 Move include/malloc.h to include/gpxe/malloc.h, since everything in there
is now gPXE-specific.  (The standard malloc() et al have been in stdlib.h
for a while).

Add free memory counter.
2007-01-18 20:11:04 +00:00
Michael Brown
c8b3e969a0 Allow buffers to be pre-expanded on demand. 2007-01-18 15:13:41 +00:00
Michael Brown
08da93a311 Reorder functions to more closely reflect the flow of control 2007-01-18 13:10:26 +00:00
Michael Brown
35776f481c Don't always zero memory in malloc(). This saves around 2us on a
full-length PKB allocation.
2007-01-18 12:54:18 +00:00
Michael Brown
0b11733b75 Replacement for fetch() which operates asynchronously and identifies
protocols by URI scheme.
2007-01-18 03:37:05 +00:00
Michael Brown
6601a7da6a Added async_uninit() to simplify failure paths. 2007-01-18 03:29:40 +00:00
Michael Brown
5a807994d8 Add utility function to parse port from URI 2007-01-18 03:28:55 +00:00
Michael Brown
9828181e3b Obsolete 2007-01-18 01:05:09 +00:00
Michael Brown
544fa25928 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).
2007-01-16 08:36:42 +00:00
Michael Brown
4e20d73bb5 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.
2007-01-15 08:49:10 +00:00
Michael Brown
ec75b269d3 Add missing include 2007-01-15 08:44:05 +00:00
Michael Brown
26166cf5e0 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
2007-01-14 23:48:31 +00:00
Michael Brown
c1fd6e8dc7 Once image type has been set, do not autoprobe further 2007-01-14 15:25:23 +00:00
Michael Brown
7dc50167bb Allow load() and exec() methods to be NULL. 2007-01-14 14:59:36 +00:00
Michael Brown
b07161f397 Placeholder bzImage support 2007-01-14 04:27:25 +00:00
Michael Brown
98240d99f0 Do not go past the end of the argv[] array.
This bug found by setting read and write watchpoints at NULL in bochs.
2007-01-14 02:01:26 +00:00
Michael Brown
dca369ddc3 Call hide_etherboot() from startup(), rather than requiring the prefix to
do it.
2007-01-14 00:53:56 +00:00
Michael Brown
c2708df14a Make shutdown functions callable by OS image's exec methods. 2007-01-14 00:16:41 +00:00
Michael Brown
beb941ed81 Rename "boot" to "autoboot" 2007-01-14 00:06:23 +00:00
Michael Brown
f11900a9c6 I prefer IMAGE_XXX to XXX_IMAGE.
Add IMAGE_PXE to use the new image format framework.  "kernel pxelinux.0"
now works.
2007-01-13 17:28:51 +00:00
Michael Brown
3b77c7aa1b Hex dumps are now integrated into the DBG() framework. 2007-01-13 16:49:38 +00:00
Michael Brown
ca3db0bf11 Added isspace() and made strtoul() accept whitespace, as per POSIX. 2007-01-12 19:11:28 +00:00
Michael Brown
83b7933f8a 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.
2007-01-12 18:09:14 +00:00
Michael Brown
996b091b50 Added generic line-buffering code (a la stdio) 2007-01-12 17:08:37 +00:00
Michael Brown
5c72d9c4e0 Print image physical location in registration message. 2007-01-12 16:20:51 +00:00
Michael Brown
9952df9b52 Add "dhcp" command 2007-01-12 09:53:28 +00:00
Michael Brown
e2c0055e23 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.
2007-01-12 09:46:10 +00:00
Michael Brown
67aedf34fa Use systematic names for XXX_IMAGE.
Add scripts as an image format (since it's trivial to do).
2007-01-12 09:00:48 +00:00
Michael Brown
eba3609e7f Add debug message 2007-01-12 08:57:51 +00:00
Michael Brown
5162f30028 Ignore comment lines.
Avoid returning errors for comments and empty lines.
2007-01-12 08:56:48 +00:00
Michael Brown
475d6d1f7c fetch() now knows nothing about struct image; it simply loads a file and
returns the allocated buffer.
2007-01-12 08:02:27 +00:00
Michael Brown
742f242863 Add free_image 2007-01-12 06:26:59 +00:00
Michael Brown
9817f93094 Add basic "fetch" and "imgstat" commands. 2007-01-12 06:05:27 +00:00
Michael Brown
b9fea9cbac Added IMAGE_LOADED flag and find_image() 2007-01-12 06:03:02 +00:00
Michael Brown
f15482d85f Added basename() to make automatically naming images easier. 2007-01-12 05:24:51 +00:00
Michael Brown
29dadc5ec6 Build automatically expanding buffers from struct buffer and erealloc(). 2007-01-12 03:51:04 +00:00
Michael Brown
6c894c2a2e Fix typo 2007-01-12 01:37:38 +00:00
Michael Brown
7bf94b5ad6 Allow for named images. 2007-01-11 23:45:18 +00:00
Michael Brown
f59ad50504 Provide registration mechanism for loaded images, so that we can e.g.
refer to them by name from the command line, or build them into a
multiboot module list.

Use setting image->type to disambiguate between "not my image" and "bad
image"; this avoids relying on specific values of the error code.
2007-01-11 23:43:29 +00:00
Michael Brown
4fc9333159 Move include/image.h to include/gpxe/image.h 2007-01-11 16:04:36 +00:00
Michael Brown
d9204ef676 Use physical address in debug messages; they make more sense to read. 2007-01-11 15:08:58 +00:00
Michael Brown
3634e705b7 Remove osloader.c and replace with a prep_segment() that uses userptr_t
and get_memmap() in image/segment.c
2007-01-11 14:32:26 +00:00
Michael Brown
fbfed96965 buffer.c should be using copy_{to,from}_user, rather than
copy_{to,from}_phys.
2007-01-11 05:42:06 +00:00
Michael Brown
c0ef730ec4 Fix bug in buffer.c, add buffer mini-unit test. 2007-01-11 04:46:41 +00:00
Michael Brown
e2dcd05b67 Update buffer-handling code to enable expandable buffers. 2007-01-11 03:50:47 +00:00
Michael Brown
bb2024c6d6 Move include/buffer.h to include/gpxe/buffer.h 2007-01-11 01:47:26 +00:00
Michael Brown
d45c5e7ce7 Add "route" command (which currently only displays the routing table; it
can't modify it).
2007-01-10 20:51:14 +00:00
Michael Brown
77bb7b13a7 Having forced __table() to natural structure alignment, it now seems
that we *can* place arrays in tables, which means we can force the
order within a table without having to resort to explicitly numbered
sections on everything.
2007-01-10 05:08:05 +00:00
Michael Brown
dad5274522 Add "name" field to struct device to allow human-readable hardware device
names.

Add "dev" pointer in struct net_device to tie network interfaces back to a
hardware device.

Force natural alignment of data types in __table() macros.  This seems to
prevent gcc from taking the unilateral decision to occasionally increase
their alignment (which screws up the table packing).
2007-01-10 04:22:09 +00:00
Michael Brown
55e590ab3a Move header file for usr/autoboot.c to include/usr 2007-01-10 02:03:20 +00:00
Michael Brown
d24b80acf2 Added network interface management commands 2007-01-10 01:55:07 +00:00
Michael Brown
7b9617f5df Add device to hierarchy before calling the driver's probe() function; this
way everything remains consistent if the probe() ends up creating child
devices.
2007-01-08 01:29:51 +00:00
Michael Brown
0063725d28 Minimal hotplug support: provide a facility for notifying persistent
reference holders that their reference is about to become invalid.
2007-01-04 03:08:16 +00:00
Michael Brown
2494625702 Added auto-colourising DBGC() macro 2006-12-29 03:05:21 +00:00
Michael Brown
b6def29f2b Keep running the main processing loop while waiting for input. 2006-12-27 22:59:40 +00:00
Michael Brown
73e3e02367 Fix prototype of random() and move to stdlib.h 2006-12-22 01:44:51 +00:00
Michael Brown
fbc7b4dfa8 Add iSCSI initiator IQN as a setting 2006-12-21 16:08:37 +00:00
Michael Brown
839d425c6e Added missing header 2006-12-20 23:43:44 +00:00
Michael Brown
ae728f8d23 Some key sequences seem to end with a tilde 2006-12-20 22:12:25 +00:00
Michael Brown
791c7d3bf4 Added code to interpret ANSI keypress sequences into KEY_XXX constants. 2006-12-20 21:56:50 +00:00
Michael Brown
c21502acad No longer needed 2006-12-20 07:13:46 +00:00
Michael Brown
84202d89f0 Split the (quick hack) boot logic out from main.c to autoboot.c, add a
"boot" command to attempt booting from within the command shell, fall back
to shell if boot fails for any reason.
2006-12-20 07:04:08 +00:00
Michael Brown
8f9336e0c1 Add "config" command to access config UI 2006-12-20 05:37:33 +00:00
Michael Brown
2b97d2ebc5 8-bit integers are 1 byte long, not 8... 2006-12-20 05:04:17 +00:00
Michael Brown
b93ff48173 Added descriptive text for settings and setting types, and display it in
the option config UI.
2006-12-20 04:58:26 +00:00
Michael Brown
35edecac34 Move {show,set,clear}_setting() to {show,set,clear}_named_setting().
Introduce new {show,set,clear}_setting() that take a struct setting *
rather than a const char *.

set_setting() handles calling clear_setting() when appropriate, so that
individual setting types don't have to check for empty strings.
2006-12-20 04:20:13 +00:00
Michael Brown
7766e34ed1 Split strerror() out from errno.c 2006-12-20 03:49:36 +00:00
Michael Brown
84a2b886e1 Split error-message table portions of errno.h out to gpxe/errortab.h 2006-12-20 03:40:48 +00:00
Michael Brown
4f506328ad Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out of
memory" and "no space left for DHCP options"
2006-12-20 03:33:37 +00:00