people/mcb30/gpxe.git
13 years agoUse -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out of
Michael Brown [Wed, 20 Dec 2006 03:33:37 +0000 (03:33 +0000)]
Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out of
memory" and "no space left for DHCP options"

13 years agoFix prototype of sleep() and move it to unistd.h
Michael Brown [Wed, 20 Dec 2006 03:14:59 +0000 (03:14 +0000)]
Fix prototype of sleep() and move it to unistd.h

13 years agoAdd (partly-functional) user interface for editing configuration settings
Michael Brown [Wed, 20 Dec 2006 03:04:07 +0000 (03:04 +0000)]
Add (partly-functional) user interface for editing configuration settings

13 years agoDon't automatically redraw the edit box; this allows better inheritance.
Michael Brown [Wed, 20 Dec 2006 02:09:41 +0000 (02:09 +0000)]
Don't automatically redraw the edit box; this allows better inheritance.

13 years agoEditable text box widget based on mucurses and edit_string.
Michael Brown [Wed, 20 Dec 2006 01:40:57 +0000 (01:40 +0000)]
Editable text box widget based on mucurses and edit_string.

13 years agoReset screen on exit as well as entry
Michael Brown [Wed, 20 Dec 2006 01:30:40 +0000 (01:30 +0000)]
Reset screen on exit as well as entry

13 years agoAdd "exit --help" to preempt the pedants.
Michael Brown [Wed, 20 Dec 2006 00:44:16 +0000 (00:44 +0000)]
Add "exit --help" to preempt the pedants.

13 years agoRemove obsolete mechanism for including nvo_cmd.o
Michael Brown [Wed, 20 Dec 2006 00:39:52 +0000 (00:39 +0000)]
Remove obsolete mechanism for including nvo_cmd.o

13 years agoSelect required commands via config.h
Michael Brown [Wed, 20 Dec 2006 00:39:06 +0000 (00:39 +0000)]
Select required commands via config.h

13 years agoRemove warning (at least on platforms with uint32_t == unsigned long).
Michael Brown [Wed, 20 Dec 2006 00:34:53 +0000 (00:34 +0000)]
Remove warning (at least on platforms with uint32_t == unsigned long).

13 years agoMove nvo_cmd.c to hci/commands.
Michael Brown [Wed, 20 Dec 2006 00:31:34 +0000 (00:31 +0000)]
Move nvo_cmd.c to hci/commands.

13 years agoFunctionality now replaced by a combination of readline() and system().
Michael Brown [Wed, 20 Dec 2006 00:27:11 +0000 (00:27 +0000)]
Functionality now replaced by a combination of readline() and system().

13 years agoUse new minimal shell
Michael Brown [Wed, 20 Dec 2006 00:26:01 +0000 (00:26 +0000)]
Use new minimal shell

13 years agoSeparated out (and tidied up) shell banner code
Michael Brown [Wed, 20 Dec 2006 00:24:13 +0000 (00:24 +0000)]
Separated out (and tidied up) shell banner code

13 years agoMinimal shell implementation using readline() and system().
Michael Brown [Tue, 19 Dec 2006 23:55:05 +0000 (23:55 +0000)]
Minimal shell implementation using readline() and system().

13 years agoUse stdlib.h for malloc() instead of malloc.h.
Michael Brown [Tue, 19 Dec 2006 23:42:46 +0000 (23:42 +0000)]
Use stdlib.h for malloc() instead of malloc.h.

13 years agoExplicitly print out-of-memory message to avoid tricking the user into
Michael Brown [Tue, 19 Dec 2006 23:37:51 +0000 (23:37 +0000)]
Explicitly print out-of-memory message to avoid tricking the user into
thinking that a command executed successfully.

13 years agoFunctioning readline()
Michael Brown [Tue, 19 Dec 2006 23:25:44 +0000 (23:25 +0000)]
Functioning readline()

13 years agoProvide an edit history to allow caller to efficiently update display.
Michael Brown [Tue, 19 Dec 2006 23:24:16 +0000 (23:24 +0000)]
Provide an edit history to allow caller to efficiently update display.

13 years agoExplicitly move cursor to top-left of screen, in case the clear screen
Michael Brown [Tue, 19 Dec 2006 22:37:12 +0000 (22:37 +0000)]
Explicitly move cursor to top-left of screen, in case the clear screen
call doesn't do it.

13 years agoSkeletal (non-echoing) version of readline()
Michael Brown [Tue, 19 Dec 2006 22:35:10 +0000 (22:35 +0000)]
Skeletal (non-echoing) version of readline()

13 years agoCatch attempts to print NULL strings
Michael Brown [Tue, 19 Dec 2006 22:33:42 +0000 (22:33 +0000)]
Catch attempts to print NULL strings

13 years agoStart of generic editable string support
Michael Brown [Tue, 19 Dec 2006 19:28:12 +0000 (19:28 +0000)]
Start of generic editable string support

13 years agoUse common symbols to avoid dragging in getopt.o unless a getopt-using
Michael Brown [Tue, 19 Dec 2006 16:27:15 +0000 (16:27 +0000)]
Use common symbols to avoid dragging in getopt.o unless a getopt-using
command is linked in.

13 years agoUse current attributes when erasing.
Michael Brown [Tue, 19 Dec 2006 01:17:10 +0000 (01:17 +0000)]
Use current attributes when erasing.

13 years agoAssume a 24-line screen, since we can't (easily) avoid scrolling after
Michael Brown [Tue, 19 Dec 2006 01:16:43 +0000 (01:16 +0000)]
Assume a 24-line screen, since we can't (easily) avoid scrolling after
printing in the bottom-right position.

13 years agoOptimise bios_putchar for speed(!) by avoiding two separate real-mode
Michael Brown [Tue, 19 Dec 2006 01:15:05 +0000 (01:15 +0000)]
Optimise bios_putchar for speed(!) by avoiding two separate real-mode
calls.  This does make a visible difference when clearing the screen with
werase() inside bochs or qemu.

13 years agoAvoid cursor move on every single character
Michael Brown [Tue, 19 Dec 2006 00:51:32 +0000 (00:51 +0000)]
Avoid cursor move on every single character

13 years agoObsolete, and no longer functions
Michael Brown [Tue, 19 Dec 2006 00:34:54 +0000 (00:34 +0000)]
Obsolete, and no longer functions

13 years agoUse ANSI escape sequence to reset and clear terminal, rather than using
Michael Brown [Tue, 19 Dec 2006 00:33:36 +0000 (00:33 +0000)]
Use ANSI escape sequence to reset and clear terminal, rather than using
the (slow) werase().

13 years agoNow basically functioning on ANSI-supporting consoles.
Michael Brown [Tue, 19 Dec 2006 00:27:25 +0000 (00:27 +0000)]
Now basically functioning on ANSI-supporting consoles.

13 years agoAdjusted to use the normal internal mucurses API rather than accessing
Michael Brown [Mon, 18 Dec 2006 21:44:44 +0000 (21:44 +0000)]
Adjusted to use the normal internal mucurses API rather than accessing
stdscr directly.

13 years agoRemove more dynamic allocation
Michael Brown [Mon, 18 Dec 2006 21:28:35 +0000 (21:28 +0000)]
Remove more dynamic allocation

13 years agoThere seems to be no reason why pos_x is static...
Michael Brown [Mon, 18 Dec 2006 21:12:58 +0000 (21:12 +0000)]
There seems to be no reason why pos_x is static...

13 years agoRemove some unnecessary use of calloc() for tiny memory areas.
Michael Brown [Mon, 18 Dec 2006 21:11:30 +0000 (21:11 +0000)]
Remove some unnecessary use of calloc() for tiny memory areas.

13 years agoConvert _{store,restore}_cursor_pos to static inlines.
Michael Brown [Mon, 18 Dec 2006 20:46:41 +0000 (20:46 +0000)]
Convert _{store,restore}_cursor_pos to static inlines.

13 years agowmove() is part of the public curses API, and already defined in curses.h
Michael Brown [Mon, 18 Dec 2006 20:38:07 +0000 (20:38 +0000)]
wmove() is part of the public curses API, and already defined in curses.h

13 years agoRenamed core.h to mucurses.h
Michael Brown [Mon, 18 Dec 2006 16:52:21 +0000 (16:52 +0000)]
Renamed core.h to mucurses.h

13 years agoRename core.c->mucurses.c; bin/core.o is too generic to belong to mucurses.
Michael Brown [Mon, 18 Dec 2006 16:50:02 +0000 (16:50 +0000)]
Rename core.c->mucurses.c; bin/core.o is too generic to belong to mucurses.

13 years agoUse int rather than short for bool; it will give more efficient code.
Michael Brown [Mon, 18 Dec 2006 16:48:09 +0000 (16:48 +0000)]
Use int rather than short for bool; it will give more efficient code.

13 years agoUse iskey() and getchar() to interact with console, rather than object
Michael Brown [Mon, 18 Dec 2006 16:46:25 +0000 (16:46 +0000)]
Use iskey() and getchar() to interact with console, rather than object
abstraction.

13 years agoThe "increment MAC address by port number" hack applies only to EF1.
Michael Brown [Mon, 18 Dec 2006 15:28:34 +0000 (15:28 +0000)]
The "increment MAC address by port number" hack applies only to EF1.

13 years agoPrint welcome banner in bold (which will come out as bright white text
Michael Brown [Mon, 18 Dec 2006 01:31:33 +0000 (01:31 +0000)]
Print welcome banner in bold (which will come out as bright white text
on the BIOS console, or genuine bold font on a xterm "serial" console),
just to prove the concept of the ANSI escape sequence handling.

13 years agoAdd basic ANSI escape sequence support to BIOS console
Michael Brown [Mon, 18 Dec 2006 01:19:38 +0000 (01:19 +0000)]
Add basic ANSI escape sequence support to BIOS console

13 years agoAdded support for interpreting ANSI escape sequences on behalf of
Michael Brown [Mon, 18 Dec 2006 00:01:30 +0000 (00:01 +0000)]
Added support for interpreting ANSI escape sequences on behalf of
non-ANSI-capable consoles.

13 years agoFix building on gas versions that don't auto-insert addr32 prefixes
Michael Brown [Tue, 12 Dec 2006 19:07:18 +0000 (19:07 +0000)]
Fix building on gas versions that don't auto-insert addr32 prefixes

13 years agoAutomatically select between the "10" and "16" variants of command set,
Michael Brown [Tue, 12 Dec 2006 18:54:35 +0000 (18:54 +0000)]
Automatically select between the "10" and "16" variants of command set,
based on the device size.

13 years agoCatch SCSI errors, and work around the start-of-day CHECK CONDITION
Michael Brown [Tue, 12 Dec 2006 18:18:54 +0000 (18:18 +0000)]
Catch SCSI errors, and work around the start-of-day CHECK CONDITION
that some targets send.

13 years agoTypo
Michael Brown [Tue, 12 Dec 2006 16:18:42 +0000 (16:18 +0000)]
Typo

13 years agoRequest all the options that we're prepared to do anything with.
Michael Brown [Tue, 12 Dec 2006 16:18:20 +0000 (16:18 +0000)]
Request all the options that we're prepared to do anything with.

13 years agoAdded "clear" command
Michael Brown [Tue, 12 Dec 2006 15:52:19 +0000 (15:52 +0000)]
Added "clear" command

13 years agoAdded clear_setting()
Michael Brown [Tue, 12 Dec 2006 15:49:46 +0000 (15:49 +0000)]
Added clear_setting()

13 years agoCope with system("").
Michael Brown [Fri, 8 Dec 2006 17:07:12 +0000 (17:07 +0000)]
Cope with system("").

13 years agoAdded "priority" and "root-path" options
Michael Brown [Fri, 8 Dec 2006 16:30:14 +0000 (16:30 +0000)]
Added "priority" and "root-path" options

13 years agoAdd placeholder ibft.h
Michael Brown [Fri, 8 Dec 2006 16:16:21 +0000 (16:16 +0000)]
Add placeholder ibft.h

13 years agoUse root-path option (as per RFC 4173) rather than filename option to
Michael Brown [Fri, 8 Dec 2006 15:53:49 +0000 (15:53 +0000)]
Use root-path option (as per RFC 4173) rather than filename option to
determine iSCSI boot parameters.

13 years agoAlso request root-path.
Michael Brown [Fri, 8 Dec 2006 15:49:46 +0000 (15:49 +0000)]
Also request root-path.

13 years agoIncluding the final (char *)NULL is the responsibility of the caller
Michael Brown [Fri, 8 Dec 2006 09:15:12 +0000 (09:15 +0000)]
Including the final (char *)NULL is the responsibility of the caller
of execl().

13 years agoD'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh
Michael Brown [Fri, 8 Dec 2006 03:07:15 +0000 (03:07 +0000)]
D'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh

13 years agoAdded "exit" back in as a standardised command.
Michael Brown [Fri, 8 Dec 2006 01:40:06 +0000 (01:40 +0000)]
Added "exit" back in as a standardised command.

13 years agocmdlinelib.c now calls system() rather than doing its own tokenisation
Michael Brown [Fri, 8 Dec 2006 01:26:11 +0000 (01:26 +0000)]
cmdlinelib.c now calls system() rather than doing its own tokenisation
(which was extremely heavy on calls to malloc()).

Moved include/command.h to include/gpxe/command.h, since it's
gPXE-specific.

13 years agoAdded execv() and system().
Michael Brown [Fri, 8 Dec 2006 01:23:11 +0000 (01:23 +0000)]
Added execv() and system().

13 years agoAdded missing include of stdint.h
Michael Brown [Fri, 8 Dec 2006 01:21:13 +0000 (01:21 +0000)]
Added missing include of stdint.h

13 years agoAdded strdup()
Michael Brown [Fri, 8 Dec 2006 00:34:47 +0000 (00:34 +0000)]
Added strdup()

13 years agoAdded missing prototype
Michael Brown [Fri, 8 Dec 2006 00:21:08 +0000 (00:21 +0000)]
Added missing prototype

13 years agoAdded a functional version of getopt() and getopt_long(), ready for use
Michael Brown [Thu, 7 Dec 2006 03:54:57 +0000 (03:54 +0000)]
Added a functional version of getopt() and getopt_long(), ready for use
in our commands.

13 years agoAdd support for non-volatile stored options in the RTL8139 EEPROM.
Michael Brown [Wed, 6 Dec 2006 20:45:44 +0000 (20:45 +0000)]
Add support for non-volatile stored options in the RTL8139 EEPROM.

13 years agoinet_aton() has a non-traditional return value
Michael Brown [Wed, 6 Dec 2006 20:44:29 +0000 (20:44 +0000)]
inet_aton() has a non-traditional return value

13 years agoA cleaner method of handling login redirection; just use the existing
Michael Brown [Wed, 6 Dec 2006 19:53:56 +0000 (19:53 +0000)]
A cleaner method of handling login redirection; just use the existing
reconnection mechanism.  This avoids the problems of trying to reuse
the TCP connection structure before the old connection has cleanly exited.

13 years agoAdded write support for three-wire devices (e.g. the RTL8139 EEPROM)
Michael Brown [Wed, 6 Dec 2006 19:51:58 +0000 (19:51 +0000)]
Added write support for three-wire devices (e.g. the RTL8139 EEPROM)

13 years agoVerify data after writing
Michael Brown [Wed, 6 Dec 2006 18:51:31 +0000 (18:51 +0000)]
Verify data after writing

13 years agoWork around another confused-by-RST bug
Michael Brown [Wed, 6 Dec 2006 18:09:33 +0000 (18:09 +0000)]
Work around another confused-by-RST bug

13 years agoSupport PXE and iSCSI by default
Michael Brown [Tue, 5 Dec 2006 23:26:07 +0000 (23:26 +0000)]
Support PXE and iSCSI by default

13 years agoWork around another instance of the port re-use bug.
Michael Brown [Tue, 5 Dec 2006 23:15:35 +0000 (23:15 +0000)]
Work around another instance of the port re-use bug.

13 years agoTweaked retry messages
Michael Brown [Tue, 5 Dec 2006 23:12:54 +0000 (23:12 +0000)]
Tweaked retry messages

13 years agoAdded debug messages
Michael Brown [Tue, 5 Dec 2006 22:53:49 +0000 (22:53 +0000)]
Added debug messages

13 years agoCall closed() method only when the connection is genuinely in the
Michael Brown [Tue, 5 Dec 2006 22:53:28 +0000 (22:53 +0000)]
Call closed() method only when the connection is genuinely in the
TCP_CLOSED state (i.e. after the final FIN/ACK exchange), and has been
removed from the list of TCP connections.

13 years agoEnsure that tcp_rx() always frees its received packet buffer.
Michael Brown [Tue, 5 Dec 2006 21:23:23 +0000 (21:23 +0000)]
Ensure that tcp_rx() always frees its received packet buffer.

13 years agoKilled off spurious <stdio.h> inclusion
Michael Brown [Tue, 5 Dec 2006 21:16:52 +0000 (21:16 +0000)]
Killed off spurious <stdio.h> inclusion

13 years agoAvoid calling NULL methods!
Michael Brown [Tue, 5 Dec 2006 21:09:37 +0000 (21:09 +0000)]
Avoid calling NULL methods!

13 years agoUpdate ftp.c to work with Nikhil's TCP stack.
Michael Brown [Tue, 5 Dec 2006 19:07:47 +0000 (19:07 +0000)]
Update ftp.c to work with Nikhil's TCP stack.

Remove the now-totally-obsolete sockaddr_in field from tcp.h.

13 years agoThe VPD engine is broken and can't actually handle placing VPD
Michael Brown [Tue, 5 Dec 2006 17:56:13 +0000 (17:56 +0000)]
The VPD engine is broken and can't actually handle placing VPD
anywhere other than offset 0 within the EEPROM, so we have to put our
settings at 0x100 instead.

13 years agoAdjust EEPROM/flash detection to fit expected manufacturing practice.
Michael Brown [Tue, 5 Dec 2006 16:00:06 +0000 (16:00 +0000)]
Adjust EEPROM/flash detection to fit expected manufacturing practice.

13 years agoAdded options listed in
Michael Brown [Tue, 5 Dec 2006 15:40:28 +0000 (15:40 +0000)]
Added options listed in
http://www.microsoft.com/whdc/winlogo/hwrequirements.mspx as required
for iSCSI boot.  Note that options 204-206 are listed in the document
but don't seem to be defined anywhere on the web.

13 years agoTidy up some more output. The command-line code needs some severe
Michael Brown [Tue, 5 Dec 2006 10:27:16 +0000 (10:27 +0000)]
Tidy up some more output.  The command-line code needs some severe
overhauling, but this is not the time to do it.

13 years agoSlightly tidied up console messages.
Michael Brown [Tue, 5 Dec 2006 10:14:58 +0000 (10:14 +0000)]
Slightly tidied up console messages.

13 years agoChange some debugging messages to use DBG()
Michael Brown [Tue, 5 Dec 2006 10:01:00 +0000 (10:01 +0000)]
Change some debugging messages to use DBG()

13 years agoAvoid draining the keyboard buffer during gateA20_set(). It shouldn't
Michael Brown [Tue, 5 Dec 2006 09:45:39 +0000 (09:45 +0000)]
Avoid draining the keyboard buffer during gateA20_set().  It shouldn't
technically be necessary, because the "enable A20" command requires
only that the keyboard controller is ready to accept input (i.e. that
its input buffer is empty), and shouldn't also require that the
keyboard is ready to send output (i.e. that its output buffer is also
empty).  See http://www.smsc.com/main/tools/io-bios/42i.pdf section
3.1 ("Command Invocation") for a justification.

gateA20_set() is called on every real-mode transition (in case some
idiot piece of external code such as Intel's PXE stack decided it
would be fun to re-disable A20), so draining the keyboard buffer means
that we end up losing keypresses on some systems.  In particular, this
makes typing at the command line almost impossible, and causes
Etherboot to ignore Ctrl-Alt-Del.

We should really implement a gateA20_test() function to verify that
gate A20 has been correctly enabled, and think about adding other
commonly-used methods such as Fast Gate A20.

13 years agoTied NVO commands into the human-interactable settings code that I
Michael Brown [Tue, 5 Dec 2006 02:40:03 +0000 (02:40 +0000)]
Tied NVO commands into the human-interactable settings code that I
completely forgot I'd written ages ago.

13 years agoHandle TargetAddress
Michael Brown [Tue, 5 Dec 2006 01:41:32 +0000 (01:41 +0000)]
Handle TargetAddress

13 years agoHandle strings as complete units, instead of a byte at a time.
Michael Brown [Tue, 5 Dec 2006 01:08:56 +0000 (01:08 +0000)]
Handle strings as complete units, instead of a byte at a time.

13 years agoAdd iscsi_rx_buffered_data() and supporting infrastructure.
Michael Brown [Tue, 5 Dec 2006 00:39:05 +0000 (00:39 +0000)]
Add iscsi_rx_buffered_data() and supporting infrastructure.

13 years agoAdded more debug messages
Michael Brown [Mon, 4 Dec 2006 23:47:44 +0000 (23:47 +0000)]
Added more debug messages

13 years agoAdded quick and dirty commands for testing the new NVO code.
Michael Brown [Mon, 4 Dec 2006 23:40:35 +0000 (23:40 +0000)]
Added quick and dirty commands for testing the new NVO code.

13 years agoAdded debug statements
Michael Brown [Mon, 4 Dec 2006 23:20:56 +0000 (23:20 +0000)]
Added debug statements

13 years agoAdded nvs_write(). This shares a lot of code in common with nvs_read();
Michael Brown [Mon, 4 Dec 2006 22:06:54 +0000 (22:06 +0000)]
Added nvs_write().  This shares a lot of code in common with nvs_read();
this can probably be optimised down quite a lot.

13 years agoAdded nvo_save()
Michael Brown [Mon, 4 Dec 2006 22:04:10 +0000 (22:04 +0000)]
Added nvo_save()

13 years agoAdd the concept of a fragment list for non-volatile stored options.
Michael Brown [Mon, 4 Dec 2006 21:46:13 +0000 (21:46 +0000)]
Add the concept of a fragment list for non-volatile stored options.

13 years agoFixed two logic errors that were cancelling each other out.
Michael Brown [Mon, 4 Dec 2006 21:12:52 +0000 (21:12 +0000)]
Fixed two logic errors that were cancelling each other out.

13 years agoMigrated etherfabric driver to using generic SPI layer.
Michael Brown [Mon, 4 Dec 2006 20:47:51 +0000 (20:47 +0000)]
Migrated etherfabric driver to using generic SPI layer.