david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

20 Commits

Author SHA1 Message Date
Michael Brown 302f1eeb80 [time] Allow timer to be selected at runtime
Allow the active timer (providing udelay() and currticks()) to be
selected at runtime based on probing during the INIT_EARLY stage of
initialisation.

TICKS_PER_SEC is now a fixed compile-time constant for all builds, and
is independent of the underlying clock tick rate.  We choose the value
1024 to allow multiplications and divisions on seconds to be converted
to bit shifts.

TICKS_PER_MS is defined as 1, allowing multiplications and divisions
on milliseconds to be omitted entirely.  The 2% inaccuracy in this
definition is negligible when using the standard BIOS timer (running
at around 18.2Hz).

TIMER_RDTSC now checks for a constant TSC before claiming to be a
usable timer.  (This timer can be tested in KVM via the command-line
option "-cpu host,+invtsc".)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-01-26 08:17:37 +00:00
Michael Brown b6ee89ffb5 [legal] Relicense files under GPL2_OR_LATER_OR_UBDL
Relicense files for which I am the sole author (as identified by
util/relicense.pl).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02 14:17:31 +00:00
Michael Brown 92f3bd901e [build] Allow command help text URI to be customised via config/branding.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-02-11 14:11:28 +00:00
Michael Brown 43eba2f555 [cmdline] Generate command option help text automatically
Generate the command option help text automatically from the list of
defined options.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-07 17:00:51 +00:00
Michael Brown 3a67224c62 [parseopt] Add parse_netdev_configurator()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:30:20 +00:00
Michael Brown 5e1fa5cd40 [parseopt] Add parse_timeout()
Parsing a timeout value (specified in milliseconds) into an internal
timeout value measured in timer ticks is a common operation.  Provide
a parse_timeout() value to carry out this conversion automatically.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 02:26:19 +00:00
Michael Brown 564419c7e1 [params] Add support for the general concept of a form parameter list
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19 17:22:52 +01:00
Michael Brown 1625a8c05f [parseopt] Add parse_setting()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22 16:30:44 +01:00
Michael Brown 46433f9b5e [parseopt] Move parse_settings() to parseopt.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22 16:16:44 +01:00
Michael Brown b87020a090 [parseopt] Allow parsed option to be modified
Parsing a setting name requires the ability to modify the text being
parsed.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22 16:16:11 +01:00
Michael Brown c3b4860ce3 [legal] Update FSF mailing address in GPL licence texts
Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 19:55:45 +01:00
Michael Brown 3425726cf3 [menu] Add menu commands
Allow iPXE scripts to create menus.  For example:

    #!ipxe

    menu iSCSI boot demonstration
    item install         Install Fedora to ${root-path}
    item --default boot  Boot from ${root-path}
    item shell           Enter iPXE shell
    item exit            Exit to BIOS
    choose label && goto ${label}

    :boot
    sanboot ${root-path}

    :install
    sanhook ${root-path}
    chain http://${next-server}/fedora.ipxe

    :shell
    shell

    :exit

Inspired-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-29 14:02:02 +01:00
Michael Brown 0b1fe005b3 [parseopt] Allow "prompt" command to accept character literals for --key
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-29 00:21:19 +01:00
Michael Brown 1c127a6962 [image] Simplify image management commands and internal API
Remove the name, cmdline, and action parameters from imgdownload() and
imgdownload_string().  These functions now simply download and return
an image.

Add the function imgacquire(), which will interpret a "name or URI
string" parameter and return either an existing image or a newly
downloaded image.

Use imgacquire() to merge similar image-management commands that
currently differ only by whether they take the name of an existing
image or the URI of a new image to download.  For example, "chain" and
"imgexec" can now be merged.

Extend imgstat and imgfree commands to take an optional list of
images.

Remove the arbitrary restriction on the length of image names.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-24 23:12:04 +00:00
Michael Brown c49659c4f2 [parseopt] Disambiguate the various EINVAL errors
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-05-18 09:39:27 +01:00
Michael Brown 3ca5656208 [parseopt] Allow for pre-initialised option sets
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-04-24 15:32:06 +01:00
Michael Brown a246434299 [parseopt] Add support for boolean options
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-27 12:46:55 +01:00
Michael Brown 7d5dcc9299 [parseopt] Refer to online documentation for command help
The online documentation (e.g. http://ipxe.org/cmd/ifopen), though not
yet complete, is far more comprehensive than could be provided within
the iPXE binary.  Save around 200 bytes (compressed) by removing the
command descriptions from the interactive help, and instead referring
users directly to the web page describing the relevant command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-04 12:18:51 +00:00
Michael Brown 01df5c510f [parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued options
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-29 14:18:43 +00:00
Michael Brown 216fd0a5cf [parseopt] Add generic option-parsing library
Command implementations tend to include a substantial amount of common
boilerplate code revolving around the parsing of command-line options
and arguments.  This increases the size cost of each command.

Introduce an option-parsing library that abstracts out the common
operations involved in command implementations.  This enables the size
of each individual command to be reduced, and also enhances
consistency between commands.

Total size of the library is 704 bytes, to be amortised across all
command implementations.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-11-21 20:38:26 +00:00