diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/errdb/errdb.pl ipxe-1.0.1~lliurex1505/contrib/errdb/errdb.pl
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/errdb/errdb.pl 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/errdb/errdb.pl 2012-01-06 23:49:04.000000000 +0000
@@ -73,7 +73,6 @@
while ( <> ) {
chomp;
( my $errno, my $filename, my $line, my $description ) = split ( /\t/ );
- $errno = substr ( $errno, 0, 6 ) unless $errno =~ /^7f/;
$errors->{$errno} = $description;
$xrefs->{$errno} ||= {};
$xrefs->{$errno}->{$filename} ||= {};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/bottom.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/bottom.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/bottom.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/bottom.php 2012-01-06 23:49:04.000000000 +0000
@@ -1,4 +1,4 @@
-.
@@ -53,7 +53,7 @@
- Please email ">
+ Please email "> echo "${webmaster_email}"?>
with questions or comments about this website.
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/build.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/build.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/build.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/build.php 2012-01-06 23:49:04.000000000 +0000
@@ -179,12 +179,7 @@
// Make the requested image. $status is set to 0 on success
$make_target = "bin/${nic}.${fmt_extension}";
-$gitversion = exec('git describe --always --abbrev=1 --match "" 2>/dev/null');
-if ($gitversion) {
- $gitversion = "GITVERSION=$gitversion";
-}
-
-$make_cmd = "make -C '$build_dir' '$make_target' $gitversion $emb_script_cmd 2>&1";
+$make_cmd = "make -C '$build_dir' '$make_target' $emb_script_cmd 2>&1";
exec ( $make_cmd, $maketxt, $status );
@@ -244,7 +239,7 @@
// Delete build directory as soon as it is not needed
rm_build_dir ();
- $output_filename = preg_replace('/[^a-z0-9\+\.\-]/i', '', "ipxe-${version}-${nic}.${fmt_extension}");
+ $output_filename = "ipxe-${version}-${nic}.${fmt_extension}";
// Try to force IE to handle downloading right.
Header ( "Cache-control: private");
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/customize-flags.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/customize-flags.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/customize-flags.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/customize-flags.php 2012-01-06 23:49:04.000000000 +0000
@@ -34,30 +34,30 @@
?>
-
+ include_once $bottom_inc; ?>
// For emacs:
//
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/directions.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/directions.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/directions.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/directions.php 2012-01-06 23:49:04.000000000 +0000
@@ -1,4 +1,4 @@
-.
@@ -21,12 +21,12 @@
?>
- Choose an output format:
- Choose a NIC type:
@@ -40,11 +40,11 @@
here.
- PCI VENDOR CODE:
- PCI DEVICE CODE:
Please note for ROM images:
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/flag-table.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/flag-table.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/flag-table.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/flag-table.php 2012-01-06 23:49:04.000000000 +0000
@@ -109,16 +109,6 @@
"cfgsec" => "console"
),
- "LOG_LEVEL"
- => array (
- "flag" => "LOG_LEVEL",
- "type" => "choice",
- "options" => array("LOG_NONE","LOG_EMERG","LOG_ALERT","LOG_CRIT","LOG_ERR",
- "LOG_WARNING","LOG_NOTICE","LOG_INFO","LOG_DEBUG","LOG_ALL"),
- "value" => "LOG_NONE",
- "cfgsec" => "console"
- ),
-
// End Console Options
// Begin Network Protocol Options:
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/index.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/index.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/index.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/index.php 2012-01-06 23:49:04.000000000 +0000
@@ -27,10 +27,10 @@
?>
-
+ include_once $bottom_inc ?>
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/top.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/top.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/top.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/top.php 2012-01-06 23:49:04.000000000 +0000
@@ -1,6 +1,6 @@
-.
@@ -25,17 +25,17 @@
- ">
+ ">
-
-
+ echo $header_title ?>
+
-
+ echo "$html_title" ?>
-
+ echo "$html_tagline" ?>
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/utils.php ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/utils.php
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/rom-o-matic/utils.php 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/rom-o-matic/utils.php 2012-01-06 23:49:04.000000000 +0000
@@ -1,4 +1,4 @@
-.
@@ -131,8 +131,7 @@
if ( strpos ( $first_eight_chars, "family" ) === 0 ) {
// get pathname of NIC driver
- #list ( $dummy, $nic ) = split( "[ \t]+", $line );
- list ( $dummy, $nic ) = explode("\t", $line);
+ list ( $dummy, $nic ) = split( "[ \t]+", $line );
settype ( $nic, "string" );
// extract filename name of driver from pathname
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/contrib/vm/bochsrc.txt ipxe-1.0.1~lliurex1505/contrib/vm/bochsrc.txt
--- ipxe-1.0.0+git-20131111.c3d1e78/contrib/vm/bochsrc.txt 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/contrib/vm/bochsrc.txt 2012-01-06 23:49:04.000000000 +0000
@@ -2,28 +2,14 @@
# your pathname includes spaces.
#=======================================================================
-# PLUGIN_CTRL:
-# Controls the presence of optional device plugins. These plugins are loaded
-# directly with this option and some of them install a config option that is
-# only available when the plugin device is loaded. The value "1" means to load
-# the plugin and "0" will unload it (if loaded before).
-# These plugins are currently supported: 'biosdev', 'e1000', 'es1370',
-# 'extfpuirq', 'gameport', 'iodebug', 'ne2k', 'parallel', 'pcidev', 'pcipnic',
-# 'sb16', 'serial', 'speaker', 'unmapped', 'usb_ohci', 'usb_uhci' and 'usb_xhci'.
-#=======================================================================
-plugin_ctrl: unmapped=1, biosdev=1, speaker=1, e1000=1, parallel=1, serial=1
-
-#=======================================================================
# CONFIG_INTERFACE
#
# The configuration interface is a series of menus or dialog boxes that
# allows you to change all the settings that control Bochs's behavior.
-# Depending on the platform there are up to 3 choices of configuration
-# interface: a text mode version called "textconfig" and two graphical versions
-# called "win32config" and "wx". The text mode version uses stdin/stdout and
-# is always compiled in, unless Bochs is compiled for wx only. The choice
-# "win32config" is only available on win32 and it is the default there.
-# The choice "wx" is only available when you use "--with-wx" on the configure
+# There are two choices of configuration interface: a text mode version
+# called "textconfig" and a graphical version called "wx". The text
+# mode version uses stdin/stdout and is always compiled in. The graphical
+# version is only available when you use "--with-wx" on the configure
# command. If you do not write a config_interface line, Bochs will
# choose a default for you.
#
@@ -31,7 +17,6 @@
# the "wx" display library.
#=======================================================================
#config_interface: textconfig
-#config_interface: win32config
#config_interface: wx
#=======================================================================
@@ -48,6 +33,7 @@
# x use X windows interface, cross platform
# win32 use native win32 libraries
# carbon use Carbon library (for MacOS X)
+# beos use native BeOS libraries
# macintosh use MacOS pre-10
# amigaos use native AmigaOS libraries
# sdl use SDL library, cross platform
@@ -61,23 +47,18 @@
# the "wx" display library.
#
# Specific options:
-# Some display libraries now support specific options to control their
-# behaviour. These options are supported by more than one display library:
-#
-# "gui_debug" - use GTK debugger gui (sdl, x) / Win32 debugger gui (win32)
-# "hideIPS" - disable IPS output in status bar (sdl, wx, x)
-# "nokeyrepeat" - turn off host keyboard repeat (sdl, win32, x)
-#
-# See the examples below for other currently supported options.
+# Some display libraries now support specific option to control their
+# behaviour. See the examples below for currently supported options.
#=======================================================================
#display_library: amigaos
+#display_library: beos
#display_library: carbon
#display_library: macintosh
#display_library: nogui
#display_library: rfb, options="timeout=60" # time to wait for client
#display_library: sdl, options="fullscreen" # startup in fullscreen mode
#display_library: term
-#display_library: win32
+#display_library: win32, options="legacyF12" # use F12 to toggle mouse
#display_library: wx
#display_library: x
@@ -86,245 +67,67 @@
# The ROM BIOS controls what the PC does when it first powers on.
# Normally, you can use a precompiled BIOS in the source or binary
# distribution called BIOS-bochs-latest. The ROM BIOS is usually loaded
-# starting at address 0xf0000, and it is exactly 64k long. Another option
-# is 128k BIOS which is loaded at address 0xe0000.
+# starting at address 0xf0000, and it is exactly 64k long.
# You can also use the environment variable $BXSHARE to specify the
# location of the BIOS.
# The usage of external large BIOS images (up to 512k) at memory top is
# now supported, but we still recommend to use the BIOS distributed with
-# Bochs. The start address optional, since it can be calculated from image size.
+# Bochs. Now the start address can be calculated from image size.
#=======================================================================
-#romimage: file=$BXSHARE/BIOS-bochs-latest
-#romimage: file=bios/seabios-1.6.3.bin
+romimage: file=bochs/bios/BIOS-bochs-latest, address=0xe0000
#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top
-romimage: file=bochs/bios/BIOS-bochs-latest
+#romimage: file=mybios.bin # calculate start address from image size
#=======================================================================
# CPU:
# This defines cpu-related parameters inside Bochs:
#
-# MODEL:
-# Selects CPU configuration to emulate from pre-defined list of all
-# supported configurations. When this option is used, the CPUID option
-# has no effect anymore.
-#
-# CPU configurations that can be selected:
-# -----------------------------------------------------------------
-# pentium_mmx Intel Pentium MMX
-# amd_k6_2_chomper AMD-K6(tm) 3D processor (Chomper)
-# p2_klamath Intel Pentium II (Klamath)
-# p3_katmai Intel Pentium III (Katmai)
-# p4_willamette Intel(R) Pentium(R) 4 (Willamette)
-# core_duo_t2400_yonah Intel(R) Core(TM) Duo CPU T2400 (Yonah)
-# atom_n270 Intel(R) Atom(TM) CPU N270
-# athlon64_clawhammer AMD Athlon(tm) 64 Processor 2800+ (Clawhammer)
-# athlon64_venice AMD Athlon(tm) 64 Processor 3000+ (Venice)
-# turion64_tyler AMD Turion(tm) 64 X2 Mobile TL-60 (Tyler)
-# phenom_8650_toliman AMD Phenom X3 8650 (Toliman)
-# p4_prescott_celeron_336 Intel(R) Celeron(R) 336 (Prescott)
-# core2_penryn_t9600 Intel Mobile Core 2 Duo T9600 (Penryn)
-# corei5_lynnfield_750 Intel(R) Core(TM) i5 750 (Lynnfield)
-# corei5_arrandale_m520 Intel(R) Core(TM) i5 M 520 (Arrandale)
-# corei7_sandy_bridge_2600k Intel(R) Core(TM) i7-2600K (Sandy Bridge)
-# corei7_ivy_bridge_3770k Intel(R) Core(TM) i7-3770K CPU (Ivy Bridge)
-#
# COUNT:
-# Set the number of processors:cores per processor:threads per core
-# when Bochs is compiled for SMP emulation.
-# Bochs currently supports up to 8 threads running simultaniosly.
-# If Bochs is compiled without SMP support, it won't accept values
-# different from 1.
-#
-# QUANTUM:
-# Maximum amount of instructions allowed to execute by processor before
-# returning control to another cpu. This option exists only in Bochs
-# binary compiled with SMP support.
+# Set the number of processors:cores per processor:threads per core
+# when Bochs is compiled for SMP emulation.
+# Bochs currently supports up to 8 threads running simultaniosly.
+# If Bochs is compiled without SMP support, it won't accept values
+# different from 1.
#
# RESET_ON_TRIPLE_FAULT:
-# Reset the CPU when triple fault occur (highly recommended) rather than
-# PANIC. Remember that if you trying to continue after triple fault the
-# simulation will be completely bogus !
-#
-# CPUID_LIMIT_WINNT:
-# Determine whether to limit maximum CPUID function to 2. This mode is
-# required to workaround WinNT installation and boot issues.
-#
-# MSRS:
-# Define path to user CPU Model Specific Registers (MSRs) specification.
-# See example in msrs.def.
-#
-# IGNORE_BAD_MSRS:
-# Ignore MSR references that Bochs does not understand; print a warning
-# message instead of generating #GP exception. This option is enabled
-# by default but will not be avaiable if configurable MSRs are enabled.
-#
-# MWAIT_IS_NOP:
-# When this option is enabled MWAIT will not put the CPU into a sleep state.
-# This option exists only if Bochs compiled with --enable-monitor-mwait.
+# Reset the CPU when triple fault occur (highly recommended) rather than
+# PANIC. Remember that if you trying to continue after triple fault the
+# simulation will be completely bogus !
#
# IPS:
-# Emulated Instructions Per Second. This is the number of IPS that bochs
-# is capable of running on your machine. You can recompile Bochs with
-# --enable-show-ips option enabled, to find your host's capability.
-# Measured IPS value will then be logged into your log file or shown
-# in the status bar (if supported by the gui).
-#
-# IPS is used to calibrate many time-dependent events within the bochs
-# simulation. For example, changing IPS affects the frequency of VGA
-# updates, the duration of time before a key starts to autorepeat, and
-# the measurement of BogoMips and other benchmarks.
+# Emulated Instructions Per Second. This is the number of IPS that bochs
+# is capable of running on your machine. You can recompile Bochs with
+# --enable-show-ips option enabled, to find your workstation's capability.
+# Measured IPS value will then be logged into your log file or status bar
+# (if supported by the gui).
+#
+# IPS is used to calibrate many time-dependent events within the bochs
+# simulation. For example, changing IPS affects the frequency of VGA
+# updates, the duration of time before a key starts to autorepeat, and
+# the measurement of BogoMips and other benchmarks.
#
# Examples:
-#
-# Bochs Machine/Compiler Mips
-# ______________________________________________________________________
-# 2.4.6 3.4Ghz Intel Core i7 2600 with Win7x64/g++ 4.5.2 85 to 95 Mips
-# 2.3.7 3.2Ghz Intel Core 2 Q9770 with WinXP/g++ 3.4 50 to 55 Mips
-# 2.3.7 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 38 to 43 Mips
-# 2.2.6 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 21 to 25 Mips
-# 2.2.6 2.1Ghz Athlon XP with Linux 2.6/g++ 3.4 12 to 15 Mips
-#=======================================================================
-cpu: model=core2_penryn_t9600, count=1, ips=50000000, reset_on_triple_fault=1, ignore_bad_msrs=1, msrs="msrs.def"
-cpu: cpuid_limit_winnt=0
-
-#=======================================================================
-# CPUID:
-#
-# This defines features and functionality supported by Bochs emulated CPU.
-# The option has no offect if CPU model was selected in CPU option.
-#
-# MMX:
-# Select MMX instruction set support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 5.
-#
-# APIC:
-# Select APIC configuration (LEGACY/XAPIC/XAPIC_EXT/X2APIC).
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 5.
-#
-# SEP:
-# Select SYSENTER/SYSEXIT instruction set support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# SSE:
-# Select SSE instruction set support.
-# Any of NONE/SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2 could be selected.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# SSE4A:
-# Select AMD SSE4A instructions support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# AES:
-# Select AES instruction set support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# MOVBE:
-# Select MOVBE Intel(R) Atom instruction support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# XSAVE:
-# Select XSAVE extensions support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# XSAVEOPT:
-# Select XSAVEOPT instruction support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# AVX:
-# Select AVX/AVX2 instruction set support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# AVX_F16C:
-# Select AVX float16 convert instructions support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# AVX_FMA:
-# Select AVX fused multiply add (FMA) instructions support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# BMI:
-# Select BMI1/BMI2 instructions support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# XOP:
-# Select AMD XOP instructions support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# FMA4:
-# Select AMD four operand FMA instructions support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# TBM:
-# Select AMD Trailing Bit Manipulation (TBM) instructions support.
-# This option exists only if Bochs compiled with --enable-avx option.
-#
-# X86-64:
-# Enable x86-64 and long mode support.
-# This option exists only if Bochs compiled with x86-64 support.
-#
-# 1G_PAGES:
-# Enable 1G page size support in long mode.
-# This option exists only if Bochs compiled with x86-64 support.
-#
-# PCID:
-# Enable Process-Context Identifiers (PCID) support in long mode.
-# This option exists only if Bochs compiled with x86-64 support.
-#
-# FSGSBASE:
-# Enable GS/GS BASE access instructions support in long mode.
-# This option exists only if Bochs compiled with x86-64 support.
-#
-# SMEP:
-# Enable Supervisor Mode Execution Protection (SMEP) support.
-# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6.
-#
-# MWAIT:
-# Select MONITOR/MWAIT instructions support.
-# This option exists only if Bochs compiled with --enable-monitor-mwait.
-#
-# VMX:
-# Select VMX extensions emulation support.
-# This option exists only if Bochs compiled with --enable-vmx option.
-#
-# VENDOR_STRING:
-# Set the CPUID vendor string returned by CPUID(0x0). This should be a
-# twelve-character ASCII string.
-#
-# BRAND_STRING:
-# Set the CPUID vendor string returned by CPUID(0x80000002 .. 0x80000004).
-# This should be at most a forty-eight-character ASCII string.
-#
-# FAMILY:
-# Set model information returned by CPUID. Default family value determined
-# by configure option --enable-cpu-level.
-#
-# MODEL:
-# Set model information returned by CPUID. Default model value is 3.
-#
-# STEPPING:
-# Set stepping information returned by CPUID. Default stepping value is 3.
+# Machine Mips
+# ________________________________________________________________
+# 2.1Ghz Athlon XP with Linux 2.6/g++ 3.4 12 to 15 Mips
+# 1.6Ghz Intel P4 with Win2000/g++ 3.3 5 to 7 Mips
+# 650Mhz Athlon K-7 with Linux 2.4.4/egcs-2.91.66 2 to 2.5 Mips
+# 400Mhz Pentium II with Linux 2.0.36/egcs-1.0.3 1 to 1.8 Mips
#=======================================================================
-#cpuid: x86_64=1, mmx=1, sep=1, sse=sse4_2, apic=xapic, aes=1, movbe=1, xsave=1
-#cpuid: family=6, model=0x1a, stepping=5
+cpu: count=1, ips=10000000, reset_on_triple_fault=1
#=======================================================================
-# MEMORY
-# Set the amount of physical memory you want to emulate.
-#
-# GUEST:
-# Set amount of guest physical memory to emulate. The default is 32MB,
-# the maximum amount limited only by physical address space limitations.
-#
-# HOST:
-# Set amount of host memory you want to allocate for guest RAM emulation.
-# It is possible to allocate less memory than you want to emulate in guest
-# system. This will fake guest to see the non-existing memory. Once guest
-# system touches new memory block it will be dynamically taken from the
-# memory pool. You will be warned (by FATAL PANIC) in case guest already
-# used all allocated host memory and wants more.
-#
+# MEGS
+# Set the number of Megabytes of physical memory you want to emulate.
+# The default is 32MB, most OS's won't need more than that.
+# The maximum amount of memory supported is 2048Mb.
#=======================================================================
-memory: guest=512, host=256
+#megs: 256
+#megs: 128
+#megs: 64
+megs: 32
+#megs: 16
+#megs: 8
#=======================================================================
# OPTROMIMAGE[1-4]:
@@ -341,7 +144,8 @@
#optromimage2: file=optionalrom.bin, address=0xd1000
#optromimage3: file=optionalrom.bin, address=0xd2000
#optromimage4: file=optionalrom.bin, address=0xd3000
-optromimage1: file=../../src/bin/intel.rom, address=0xcb000
+optromimage1: file=../../src/bin/pnic.rom, address=0xd0000
+#optromimage1: file=../../src/bin/rtl8029.rom, address=0xd0000
#optramimage1: file=/path/file1.img, address=0x0010000
#optramimage2: file=/path/file2.img, address=0x0020000
@@ -353,31 +157,18 @@
# You now need to load a VGA ROM BIOS into C0000.
#=======================================================================
#vgaromimage: file=bios/VGABIOS-elpin-2.40
-#vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
-#vgaromimage: file=bios/VGABIOS-lgpl-latest-cirrus
vgaromimage: file=bochs/bios/VGABIOS-lgpl-latest
+#vgaromimage: file=bios/VGABIOS-lgpl-latest-cirrus
#=======================================================================
# VGA:
-# This defines parameters related to the VGA display
-#
-# EXTENSION
-# Here you can specify the display extension to be used. With the value
-# 'none' you can use standard VGA with no extension. Other supported
-# values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support.
-#
-# UPDATE_FREQ
-# The VGA update frequency is based on the emulated clock and the default
-# value is 5. Keep in mind that you must tweak the 'cpu: ips=N' directive
-# to be as close to the number of emulated instructions-per-second your
-# workstation can do, for this to be accurate. If the realtime sync is
-# enabled with the 'clock' option, the value is based on the real time.
-# This parameter can be changed at runtime.
-#
-# Examples:
-# vga: extension=cirrus, update_freq=10
-#=======================================================================
-#vga: extension=vbe, update_freq=5
+# Here you can specify the display extension to be used. With the value
+# 'none' you can use standard VGA with no extension. Other supported
+# values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support.
+#=======================================================================
+#vga: extension=cirrus
+#vga: extension=vbe
+vga: extension=none
#=======================================================================
# FLOPPYA:
@@ -386,42 +177,36 @@
# booting from 'a' (or 'floppy').
#
# You can set the initial status of the media to 'ejected' or 'inserted'.
-# floppya: 2_88=path, status=ejected (2.88M 3.5" media)
-# floppya: 1_44=path, status=inserted (1.44M 3.5" media)
-# floppya: 1_2=path, status=ejected (1.2M 5.25" media)
-# floppya: 720k=path, status=inserted (720K 3.5" media)
-# floppya: 360k=path, status=inserted (360K 5.25" media)
-# floppya: 320k=path, status=inserted (320K 5.25" media)
-# floppya: 180k=path, status=inserted (180K 5.25" media)
-# floppya: 160k=path, status=inserted (160K 5.25" media)
-# floppya: image=path, status=inserted (guess media type from image size)
-# floppya: 1_44=vvfat:path, status=inserted (use directory as VFAT media)
-# floppya: type=1_44 (1.44M 3.5" floppy drive, no media)
+# floppya: 2_88=path, status=ejected (2.88M 3.5" floppy)
+# floppya: 1_44=path, status=inserted (1.44M 3.5" floppy)
+# floppya: 1_2=path, status=ejected (1.2M 5.25" floppy)
+# floppya: 720k=path, status=inserted (720K 3.5" floppy)
+# floppya: 360k=path, status=inserted (360K 5.25" floppy)
+# floppya: 320k=path, status=inserted (320K 5.25" floppy)
+# floppya: 180k=path, status=inserted (180K 5.25" floppy)
+# floppya: 160k=path, status=inserted (160K 5.25" floppy)
+# floppya: image=path, status=inserted (guess type from image size)
#
# The path should be the name of a disk image file. On Unix, you can use a raw
# device name such as /dev/fd0 on Linux. On win32 platforms, use drive letters
# such as a: or b: as the path. The parameter 'image' works with image files
# only. In that case the size must match one of the supported types.
-# The parameter 'type' can be used to enable the floppy drive without media
-# and status specified. Usually the drive type is set up based on the media type.
-# The optional parameter 'write_protected' can be used to control the media
-# write protect switch. By default it is turned off.
#=======================================================================
#floppya: 1_44=/dev/fd0, status=inserted
#floppya: image=../1.44, status=inserted
#floppya: 1_44=/dev/fd0H1440, status=inserted
#floppya: 1_2=../1_2, status=inserted
#floppya: 1_44=a:, status=inserted
-#floppya: 1_44=a.img, status=inserted, write_protected=1
+#floppya: 1_44=a.img, status=inserted
#floppya: 1_44=/dev/rfd0a, status=inserted
-floppya: 1_44=../../src/bin/ipxe.dsk, status=inserted
+floppya: 1_44=../../src/bin/pnic.dsk, status=inserted
#=======================================================================
# FLOPPYB:
# See FLOPPYA above for syntax
#=======================================================================
#floppyb: 1_44=b:, status=inserted
-#floppyb: 1_44=b.img, status=inserted
+floppyb: 1_44=b.img, status=inserted
#=======================================================================
# ATA0, ATA1, ATA2, ATA3
@@ -451,8 +236,8 @@
# This defines the type and characteristics of all attached ata devices:
# type= type of attached device [disk|cdrom]
# mode= only valid for disks [flat|concat|external|dll|sparse|vmware3]
-# mode= only valid for disks [undoable|growing|volatile|vvfat]
-# path= path of the image / directory
+# mode= only valid for disks [undoable|growing|volatile]
+# path= path of the image
# cylinders= only valid for disks
# heads= only valid for disks
# spt= only valid for disks
@@ -460,7 +245,7 @@
# biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos]
# translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto]
# model= string returned by identify device command
-# journal= optional filename of the redolog for undoable, volatile and vvfat disks
+# journal= optional filename of the redolog for undoable and volatile disks
#
# Point this at a hard disk image file, cdrom iso file, or physical cdrom
# device. To create a hard disk image, try running bximage. It will help you
@@ -474,11 +259,10 @@
# access the "first" cdrom in the system. On MacOSX, use path="drive"
# to access the physical drive.
#
-# The path is mandatory for hard disks. Disk geometry autodetection works with
-# images created by bximage if CHS is set to 0/0/0 (cylinders are calculated
-# using heads=16 and spt=63). For other hard disk images and modes the
-# cylinders, heads, and spt are mandatory. In all cases the disk size reported
-# from the image must be exactly C*H*S*512.
+# The path is always mandatory. For flat hard disk images created with
+# bximage geometry autodetection can be used (cylinders=0 -> cylinders are
+# calculated using heads=16 and spt=63). For other hard disk images and modes
+# the cylinders, heads, and spt are mandatory.
#
# Default values are:
# mode=flat, biosdetect=auto, translation=auto, model="Generic 1234"
@@ -495,10 +279,7 @@
# ata3-master: type=disk, mode=flat, path=483M.sample, cylinders=1024, heads=15, spt=63
# ata3-slave: type=cdrom, path=iso.sample, status=inserted
#=======================================================================
-#ata0-master: type=disk, mode=flat, path="30M.sample"
#ata0-master: type=disk, mode=flat, path="30M.sample", cylinders=615, heads=6, spt=17
-#ata0-master: type=disk, mode=flat, path="c.img", cylinders=0 # autodetect
-#ata0-slave: type=disk, mode=vvfat, path=/bochs/images/vvfat, journal=vvfat.redolog
#ata0-slave: type=cdrom, path=D:, status=inserted
#ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted
#ata0-slave: type=cdrom, path="drive", status=inserted
@@ -506,13 +287,15 @@
#=======================================================================
# BOOT:
-# This defines the boot sequence. Now you can specify up to 3 boot drives,
-# which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM).
-# Legacy 'a' and 'c' are also supported.
+# This defines the boot sequence. Now you can specify up to 3 boot drives.
+# You can either boot from 'floppy', 'disk' or 'cdrom'
+# legacy 'a' and 'c' are also supported
# Examples:
# boot: floppy
-# boot: cdrom, disk
-# boot: network, disk
+# boot: disk
+# boot: cdrom
+# boot: c
+# boot: a
# boot: cdrom, floppy, disk
#=======================================================================
#boot: floppy
@@ -524,17 +307,7 @@
# This defines the parameters of the clock inside Bochs:
#
# SYNC:
-# This defines the method how to synchronize the Bochs internal time
-# with realtime. With the value 'none' the Bochs time relies on the IPS
-# value and no host time synchronization is used. The 'slowdown' method
-# sacrifices performance to preserve reproducibility while allowing host
-# time correlation. The 'realtime' method sacrifices reproducibility to
-# preserve performance and host-time correlation.
-# It is possible to enable both synchronization methods.
-#
-# RTC_SYNC:
-# If this option is enabled together with the realtime synchronization,
-# the RTC runs at realtime speed. This feature is disabled by default.
+# TO BE COMPLETED (see Greg explanation in feature request #536329)
#
# TIME0:
# Specifies the start (boot) time of the virtual machine. Use a time
@@ -569,6 +342,7 @@
# floppy_bootsig_check: disabled=0
# floppy_bootsig_check: disabled=1
#=======================================================================
+#floppy_bootsig_check: disabled=1
floppy_bootsig_check: disabled=0
#=======================================================================
@@ -604,7 +378,7 @@
#=======================================================================
# LOG CONTROLS
#
-# Bochs has four severity levels for event logging.
+# Bochs now has four severity levels for event logging.
# panic: cannot proceed. If you choose to continue after a panic,
# don't be surprised if you get strange behavior or crashes.
# error: something went wrong, but it is probably safe to continue the
@@ -613,13 +387,9 @@
# debug: messages useful only when debugging the code. This may
# spit out thousands per second.
#
-# For events of each level, you can choose to exit Bochs ('fatal'), 'report'
-# or 'ignore'. On some guis you have the additional choice 'ask'. A gui dialog
-# appears asks how to proceed.
-#
-# It is also possible to specify the 'action' to do for each Bochs facility
-# separately (e.g. crash on panics from everything except the cdrom, and only
-# report those). See the 'log function' module list in the user documentation.
+# For events of each level, you can choose to crash, report, or ignore.
+# TODO: allow choice based on the facility: e.g. crash on panics from
+# everything except the cdrom, and only report those.
#
# If you are experiencing many panics, it can be helpful to change
# the panic action to report instead of fatal. However, be aware
@@ -630,7 +400,8 @@
panic: action=ask
error: action=report
info: action=report
-debug: action=ignore, pci=report # report BX_DEBUG from module 'pci'
+debug: action=ignore
+#pass: action=fatal
#=======================================================================
# DEBUGGER_LOG:
@@ -654,29 +425,18 @@
# Then do `sleep 1000000' in the com1 window to keep the shell from
# messing with things, and run bochs in the other window. Serial I/O to
# com1 (port 0x3f8) will all go to the other window.
-# In socket* and pipe* (win32 only) modes Bochs becomes either socket/named pipe
-# client or server. In client mode it connects to an already running server (if
-# connection fails Bochs treats com port as not connected). In server mode it
-# opens socket/named pipe and waits until a client application connects to it
-# before starting simulation. This mode is useful for remote debugging (e.g.
-# with gdb's "target remote host:port" command or windbg's command line option
-# -k com:pipe,port=\\.\pipe\pipename). Note: 'socket' is a shorthand for
-# 'socket-client' and 'pipe' for 'pipe-client'. Socket modes use simple TCP
-# communication, pipe modes use duplex byte mode pipes.
# Other serial modes are 'null' (no input/output), 'file' (output to a file
# specified as the 'dev' parameter), 'raw' (use the real serial port - under
# construction for win32), 'mouse' (standard serial mouse - requires
-# mouse option setting 'type=serial', 'type=serial_wheel' or 'type=serial_msys').
+# mouse option setting 'type=serial' or 'type=serial_wheel') and 'socket'
+# (connect a networking socket).
#
# Examples:
# com1: enabled=1, mode=null
# com1: enabled=1, mode=mouse
# com2: enabled=1, mode=file, dev=serial.out
# com3: enabled=1, mode=raw, dev=com1
-# com3: enabled=1, mode=socket-client, dev=localhost:8888
-# com3: enabled=1, mode=socket-server, dev=localhost:8888
-# com4: enabled=1, mode=pipe-client, dev=\\.\pipe\mypipe
-# com4: enabled=1, mode=pipe-server, dev=\\.\pipe\mypipe
+# com3: enabled=1, mode=socket, dev=localhost:8888
#=======================================================================
#com1: enabled=1, mode=term, dev=/dev/ttyp9
@@ -701,9 +461,6 @@
# This defines the SB16 sound emulation. It can have several of the
# following properties.
# All properties are in the format sb16: property=value
-# enabled:
-# This optional property controls the presence of the SB16 emulation.
-# The emulation is turned on unless this property is used and set to 0.
# midi: The filename is where the midi data is sent. This can be a
# device or just a file if you want to record the midi data.
# midimode:
@@ -731,25 +488,26 @@
# non-continuous sound. 750000 is usually a good value. This needs a
# reasonably correct setting for the IPS parameter of the CPU option.
#
-# Examples for output devices:
-# sb16: midimode=1, midi="", wavemode=1, wave="" # win32
-# sb16: midimode=1, midi=alsa:128:0, wavemode=1, wave=alsa # Linux with ALSA
+# For an example look at the next line:
#=======================================================================
+
#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=sb16.log, dmatimer=600000
#=======================================================================
-# ES1370:
-# This defines the ES1370 sound emulation. The parameter 'enabled' controls the
-# presence of the device. In addition to this, it must be loaded with 'plugin_ctrl'
-# and assigned to a PCI slot. The 'wavedev' parameter is similar to the 'wave'
-# parameter of the SB16 soundcard. The emulation supports recording and playback
-# (except DAC1+DAC2 output at the same time).
+# VGA_UPDATE_INTERVAL:
+# Video memory is scanned for updates and screen updated every so many
+# virtual seconds. The default is 40000, about 25Hz. Keep in mind that
+# you must tweak the 'cpu: ips=N' directive to be as close to the number
+# of emulated instructions-per-second your workstation can do, for this
+# to be accurate.
#
# Examples:
-# es1370: enabled=1, wavedev="" # win32
-# es1370: enabled=1, wavedev=alsa # Linux with ALSA
+# vga_update_interval: 250000
#=======================================================================
-#es1370: enabled=1, wavedev=alsa
+vga_update_interval: 300000
+
+# using for Winstone '98 tests
+#vga_update_interval: 100000
#=======================================================================
# KEYBOARD_SERIAL_DELAY:
@@ -779,34 +537,24 @@
#=======================================================================
# MOUSE:
-# This defines parameters for the emulated mouse type, the initial status
-# of the mouse capture and the runtime method to toggle it.
-#
-# TYPE:
-# With the mouse type option you can select the type of mouse to emulate.
-# The default value is 'ps2'. The other choices are 'imps2' (wheel mouse
-# on PS/2), 'serial', 'serial_wheel' and 'serial_msys' (one com port requires
-# setting 'mode=mouse'). To connect a mouse to an USB port, see the 'usb_uhci',
-# 'usb_ohci' or 'usb_xhci' options (requires PCI and USB support).
-#
-# ENABLED:
-# The Bochs gui creates mouse "events" unless the 'enabled' option is
-# set to 0. The hardware emulation itself is not disabled by this.
-# Unless you have a particular reason for enabling the mouse by default,
-# it is recommended that you leave it off. You can also toggle the mouse
-# usage at runtime (RFB, SDL, Win32, wxWidgets and X11 - see below).
-#
-# TOGGLE:
-# The default method to toggle the mouse capture at runtime is to press the
-# CTRL key and the middle mouse button ('ctrl+mbutton'). This option allows
-# to change the method to 'ctrl+f10' (like DOSBox), 'ctrl+alt' (like QEMU)
-# or 'f12' (replaces win32 'legacyF12' option).
+# This option prevents Bochs from creating mouse "events" unless a mouse
+# is enabled. The hardware emulation itself is not disabled by this.
+# You can turn the mouse on by setting enabled to 1, or turn it off by
+# setting enabled to 0. Unless you have a particular reason for enabling
+# the mouse by default, it is recommended that you leave it off.
+# You can also toggle the mouse usage at runtime (control key + middle
+# mouse button on X11, SDL, wxWidgets and Win32).
+# With the mouse type option you can select the type of mouse to emulate.
+# The default value is 'ps2'. The other choices are 'imps2' (wheel mouse
+# on PS/2), 'serial', 'serial_wheel' (one com port requires setting
+# 'mode=mouse') and 'usb' (3-button mouse - one of the USB ports must be
+# connected with the 'mouse' device - requires PCI and USB support).
#
# Examples:
# mouse: enabled=1
-# mouse: type=imps2, enabled=1
-# mouse: type=serial, enabled=1
-# mouse: enabled=0, toggle=ctrl+f10
+# mouse: enabled=1, type=imps2
+# mouse: enabled=1, type=serial
+# mouse: enabled=0
#=======================================================================
mouse: enabled=0
@@ -838,86 +586,54 @@
#=======================================================================
# ne2k: NE2000 compatible ethernet adapter
#
-# Format:
-# ne2k: enabled=1, ioaddr=IOADDR, irq=IRQ, mac=MACADDR, ethmod=MODULE,
-# ethdev=DEVICE, script=SCRIPT, bootrom=BOOTROM
-#
-# IOADDR, IRQ: You probably won't need to change ioaddr and irq, unless there
-# are IRQ conflicts. These arguments are ignored when assign the ne2k to a
-# PCI slot.
+# Examples:
+# ne2k: ioaddr=IOADDR, irq=IRQ, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT
+#
+# ioaddr, irq: You probably won't need to change ioaddr and irq, unless there
+# are IRQ conflicts.
#
-# MAC: The MAC address MUST NOT match the address of any machine on the net.
+# mac: The MAC address MUST NOT match the address of any machine on the net.
# Also, the first byte must be an even number (bit 0 set means a multicast
# address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast
# address. For the ethertap module, you must use fe:fd:00:00:00:01. There may
# be other restrictions too. To be safe, just use the b0:c4... address.
#
-# ETHDEV: The ethdev value is the name of the network interface on your host
+# ethdev: The ethdev value is the name of the network interface on your host
# platform. On UNIX machines, you can get the name by running ifconfig. On
# Windows machines, you must run niclist to get the name of the ethdev.
# Niclist source code is in misc/niclist.c and it is included in Windows
# binary releases.
#
-# SCRIPT: The script value is optional, and is the name of a script that
+# script: The script value is optional, and is the name of a script that
# is executed after bochs initialize the network interface. You can use
# this script to configure this network interface, or enable masquerading.
# This is mainly useful for the tun/tap devices that only exist during
# Bochs execution. The network interface name is supplied to the script
-# as first parameter.
-#
-# BOOTROM: The bootrom value is optional, and is the name of the ROM image
-# to load. Note that this feature is only implemented for the PCI version of
-# the NE2000.
+# as first parameter
#
# If you don't want to make connections to any physical networks,
# you can use the following 'ethmod's to simulate a virtual network.
# null: All packets are discarded, but logged to a few files.
+# arpback: ARP is simulated. Disabled by default.
# vde: Virtual Distributed Ethernet
# vnet: ARP, ICMP-echo(ping), DHCP and read/write TFTP are simulated.
# The virtual host uses 192.168.10.1.
# DHCP assigns 192.168.10.2 to the guest.
-# TFTP uses the 'ethdev' value for the root directory and doesn't
+# TFTP uses the ethdev value for the root directory and doesn't
# overwrite files.
#
#=======================================================================
-# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=fbsd, ethdev=en0 #macosx
-# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0
-# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
-# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD
-# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
-# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig
-# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=null, ethdev=eth0
-# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl"
-# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp"
-# ne2k: mac=b0:c4:20:00:00:01, ethmod=slirp, script=/usr/local/bin/slirp, bootrom=ne2k_pci.rom
-
-#=======================================================================
-# pnic: Bochs/Etherboot pseudo-NIC
-#
-# Format:
-# pnic: enabled=1, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT,
-# bootrom=BOOTROM
-#
-# The pseudo-NIC accepts the same syntax (for mac, ethmod, ethdev, script,
-# bootrom) and supports the same networking modules as the NE2000 adapter.
-# In addition to this, it must be loaded with 'plugin_ctrl' and assigned
-# to a PCI slot.
-#=======================================================================
-#pnic: enabled=1, mac=b0:c4:20:00:00:00, ethmod=vnet
-
-#=======================================================================
-# e1000: Intel(R) 82540EM Gigabit Ethernet adapter
-#
-# Format:
-# e1000: enabled=1, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT
-# bootrom=BOOTROM
-#
-# The E1000 accepts the same syntax (for mac, ethmod, ethdev, script, bootrom)
-# and supports the same networking modules as the NE2000 adapter. In addition
-# to this, it must be loaded with 'plugin_ctrl' and assigned to a PCI slot.
-#=======================================================================
-#e1000: enabled=1, mac=52:54:00:12:34:56, ethmod=slirp, script=/usr/local/bin/slirp
-e1000: enabled=1, mac=52:54:00:12:34:56, ethmod=tuntap, ethdev=/dev/net/tun:tap0
+# ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=fbsd, ethdev=en0 #macosx
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD
+# ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
+# ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=null, ethdev=eth0
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl"
+# ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp"
+pnic: mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun:tap0
+#ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun:tap0
#=======================================================================
# KEYBOARD_MAPPING:
@@ -946,88 +662,45 @@
# USER_SHORTCUT:
# This defines the keyboard shortcut to be sent when you press the "user"
# button in the headerbar. The shortcut string is a combination of maximum
-# 3 key names (listed below) separated with a '-' character.
+# 3 key names (listed below) separated with a '-' character. The old-style
+# syntax (without the '-') still works for the key combinations supported
+# in Bochs 2.2.1.
# Valid key names:
# "alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc",
# "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup",
-# "plus", "right", "shift", "space", "tab", "up", "win", "print" and "power".
+# "plus", "right", "shift", "space", "tab", "up", and "win".
#
# Example:
# user_shortcut: keys=ctrl-alt-del
#=======================================================================
-#user_shortcut: keys=ctrl-alt-del
+user_shortcut: keys=ctrl-alt-del
#=======================================================================
-# PCI:
-# This option controls the presence of a PCI chipset in Bochs. Currently it only
-# supports the i440FX chipset. You can also specify the devices connected to
-# PCI slots. Up to 5 slots are available. These devices are currently supported:
-# cirrus, e1000, es1370, ne2k, pcivga, pcidev, pcipnic, usb_ohci and usb_xhci.
+# I440FXSUPPORT:
+# This option controls the presence of the i440FX PCI chipset. You can
+# also specify the devices connected to PCI slots. Up to 5 slots are
+# available now. These devices are currently supported: ne2k, pcivga,
+# pcidev and pcipnic. If Bochs is compiled with Cirrus SVGA support
+# you'll have the additional choice 'cirrus'.
#
# Example:
-# pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k
+# i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k
#=======================================================================
-pci: enabled=1, chipset=i440fx, slot1=e1000
+i440fxsupport: enabled=1, slot1=pcipnic
+#i440fxsupport: enabled=1, slot1=ne2k
#=======================================================================
-# USB_UHCI:
+# USB1:
# This option controls the presence of the USB root hub which is a part
-# of the i440FX PCI chipset. With the portX parameter you can connect devices
-# to the hub (currently supported: 'mouse', 'tablet', 'keypad', 'disk', 'cdrom'
-# 'hub' and 'printer'). NOTE: UHCI must be loaded with 'plugin_ctrl'.
-#
-# The optionsX parameter can be used to assign specific options to the device
-# connected to the corresponding USB port. Currently this feature is only used
-# to set the speed reported by device and by the 'disk' device to specify
-# an alternative redolog file of some image modes.
-#
-# If you connect the mouse or tablet to one of the ports, Bochs forwards the
-# mouse movement data to the USB device instead of the selected mouse type.
-# When connecting the keypad to one of the ports, Bochs forwards the input of
-# the numeric keypad to the USB device instead of the PS/2 keyboard.
-#
-# To connect a 'flat' mode image as an USB hardisk you can use the 'disk' device
-# with the path to the image separated with a colon. To use other disk image modes
-# similar to ATA disks the syntax 'disk:mode:filename' must be used (see below).
-#
-# To emulate an USB cdrom you can use the 'cdrom' device name and the path to
-# an ISO image or raw device name also separated with a colon. An option to
-# insert/eject media is available in the runtime configuration.
-#
-# The device name 'hub' connects an external hub with max. 8 ports (default: 4)
-# to the root hub. To specify the number of ports you have to add the value
-# separated with a colon. Connecting devices to the external hub ports is only
-# available in the runtime configuration.
-#
-# The device 'printer' emulates the HP Deskjet 920C printer. The PCL data is
-# sent to a file specified in bochsrc.txt. The current code appends the PCL
-# code to the file if the file already existed. It would probably be nice to
-# overwrite the file instead, asking user first.
-#=======================================================================
-#usb_uhci: enabled=1
-#usb_uhci: enabled=1, port1=mouse, port2=disk:usbstick.img
-#usb_uhci: enabled=1, port1=hub:7, port2=disk:growing:usbdisk.img
-#usb_uhci: enabled=1, port2=disk:undoable:usbdisk.img, options1=journal:redo.log
-#usb_uhci: enabled=1, port1=printer:printdata.bin, port2=cdrom:image.iso
-
-#=======================================================================
-# USB_OHCI:
-# This option controls the presence of the USB OHCI host controller with a
-# 2-port hub. The portX option accepts the same device types with the same
-# syntax as the UHCI controller (see above). The OHCI HC must be assigned to
-# a PCI slot and loaded with 'plugin_ctrl'.
-#=======================================================================
-#usb_ohci: enabled=1
-#usb_ohci: enabled=1, port1=printer:usbprinter.bin
-
-#=======================================================================
-# USB_XHCI:
-# This option controls the presence of the experimental USB xHCI host controller
-# with a 4-port hub. The portX option accepts the same device types with the
-# same syntax as the UHCI controller (see above). The xHCI HC must be assigned
-# to a PCI slot and loaded with 'plugin_ctrl'.
+# of the i440FX PCI chipset. With the portX option you can connect devices
+# to the hub (currently supported: 'mouse' and 'keypad'). If you connect
+# the mouse to one of the ports and use the mouse option 'type=usb' you'll
+# have a 3-button USB mouse.
+#
+# Example:
+# usb1: enabled=1, port1=mouse, port2=keypad
#=======================================================================
-#usb_xhci: enabled=1
+#usb1: enabled=1
#=======================================================================
# CMOSIMAGE:
@@ -1042,50 +715,12 @@
#cmosimage: file=cmos.img, rtc_init=time0
#=======================================================================
-# MAGIC_BREAK:
-# This enables the "magic breakpoint" feature when using the debugger.
-# The useless cpu instruction XCHG BX, BX causes Bochs to enter the
-# debugger mode. This might be useful for software development.
-#
-# Example:
-# magic_break: enabled=1
-#=======================================================================
-#magic_break: enabled=1
-magic_break: enabled=1
-
-#=======================================================================
-# PORT_E9_HACK:
-# The 0xE9 port doesn't exists in normal ISA architecture. However, we
-# define a convention here, to display on the console of the system running
-# Bochs anything that is written to it. The idea is to provide debug output
-# very early when writing BIOS or OS code for example, without having to
-# bother with setting up a serial port or etc. Reading from port 0xE9 will
-# will return 0xe9 to let you know if the feature is available.
-# Leave this 0 unless you have a reason to use it.
-#
-# Example:
-# port_e9_hack: enabled=1
-#=======================================================================
-port_e9_hack: enabled=1
-
-#=======================================================================
-# DEBUG_SYMBOLS:
-# This loads symbols from the specified file for use in Bochs' internal
-# debugger. Symbols are loaded into global context. This is equivalent to
-# issuing ldsym debugger command at start up.
-#
-# Example:
-# debug_symbols: file="kernel.sym"
-# debug_symbols: file="kernel.sym", offset=0x80000000
-#=======================================================================
-#debug_symbols: file="kernel.sym"
-
-#=======================================================================
# other stuff
#=======================================================================
+magic_break: enabled=1
#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log
#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img
-#print_timestamps: enabled=1
+#text_snapshot_check: enable
#-------------------------
# PCI host device mapping
@@ -1100,12 +735,11 @@
#gdbstub: enabled=0, port=1234, text_base=0, data_base=0, bss_base=0
#=======================================================================
-# USER_PLUGIN:
-# Load user-defined plugin. This option is available only if Bochs is
-# compiled with plugin support. Maximum 8 different plugins are supported.
-# See the example in the Bochs sources how to write a plugin device.
+# IPS:
+# The IPS directive is DEPRECATED. Use the parameter IPS of the CPU
+# directive instead.
#=======================================================================
-#user_plugin: name=testdev
+#ips: 10000000
#=======================================================================
# for Macintosh, use the style of pathnames in the following
@@ -1115,17 +749,3 @@
# romimage: file=:bios:BIOS-bochs-latest, address=0xf0000
# floppya: 1_44=[fd:], status=inserted
#=======================================================================
-
-#=======================================================================
-# MEGS
-# Set the number of Megabytes of physical memory you want to emulate.
-# The default is 32MB, most OS's won't need more than that.
-# The maximum amount of memory supported is 2048Mb.
-# The 'MEGS' option is deprecated. Use 'MEMORY' option instead.
-#=======================================================================
-#megs: 256
-#megs: 128
-#megs: 64
-#megs: 32
-#megs: 16
-#megs: 8
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/bin/efirom-combine.py ipxe-1.0.1~lliurex1505/debian/bin/efirom-combine.py
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/bin/efirom-combine.py 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/bin/efirom-combine.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,33 +0,0 @@
-#!/usr/bin/python3
-
-import argparse
-import logging
-
-
-class FileBinary:
- pass
-
-
-class FileEfi:
- pass
-
-
-class Main:
- argparser = argparse.ArgumentParser()
- argparser.add_argument('-o', '--output')
- argparser.add_argument('-v', '--vendor')
- argparser.add_argument('-d', '--device')
- argparser.add_argument('-D', '--debug', action='store_true')
- argparser.add_argument('-V', '--verbose', action='store_true')
- argparser.add_argument('files', nargs='+', metavar='FILE')
-
- def __init__(self, args):
- pass
-
-
-if __name__ == '__main__':
- args = Main.argparser.parse_args()
- logging.basicConfig(level=args.debug and logging.DEBUG or
- args.verbose and logging.INFO or
- logging.WARN)
- main = Main(args)
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/changelog ipxe-1.0.1~lliurex1505/debian/changelog
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/changelog 2014-01-06 09:55:28.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/changelog 2015-04-14 12:55:38.000000000 +0000
@@ -1,156 +1,8 @@
-ipxe (1.0.0+git-20131111.c3d1e78-2ubuntu1) trusty; urgency=low
+ipxe (1.0.1~lliurex1505) trusty; urgency=high
- * Merge from Debian unstable. Remaining changes:
- - d/p/enable-https.patch: Enable HTTPS support.
- - d/control,grub-ipxe*: Split grub integration from ipxe->grub-ipxe.
- - d/control: Transition kvm-ipxe->ipxe-qemu for LTS->LTS upgrade.
- - d/ipxe-qemu.links: Add compat links from /usr/share/qemu to
- /usr/lib/ipxe/qemu.
- - d/ipxe-qemu.install: Install ne.rom as pxe-ne2k_isa.rom.
- * Dropped changes, alternative fix in Debian:
- - d/control: Add libiberty-dev to BD's to fix FTBFS.
-
- -- James Page Mon, 06 Jan 2014 09:55:25 +0000
-
-ipxe (1.0.0+git-20131111.c3d1e78-2) unstable; urgency=medium
-
- * Don't use libiberty. (closes: #730910)
-
- -- Bastian Blank Sun, 22 Dec 2013 20:05:03 +0100
-
-ipxe (1.0.0+git-20131111.c3d1e78-1ubuntu1) trusty; urgency=low
-
- * Merge from Debian unstable, remaining changes:
- - d/p/enable-https.patch: Enable HTTPS support.
- - d/control,grub-ipxe*: Split grub integration from ipxe->grub-ipxe.
- - d/control: Transition kvm-ipxe->ipxe-qemu for LTS->LTS upgrade.
- - d/ipxe-qemu.links: Add compat links from /usr/share/qemu to
- /usr/lib/ipxe/qemu.
- - d/ipxe-qemu.install: Install ne.rom as pxe-ne2k_isa.rom.
- * All other changes dropped in preference to upstream Debian
- packaging.
- * d/control: Add libiberty-dev to BD's to fix FTBFS.
+ * Reported from precise
- -- James Page Tue, 26 Nov 2013 17:50:47 +0000
-
-ipxe (1.0.0+git-20131111.c3d1e78-1) unstable; urgency=low
-
- * New snapshot.
- * Add undionly.kkpxe. (closes: #671340)
- * Ignore result of update-grub invocation. (closes: #660459)
- * Mark packages as multi-arch foreign. (closes: #728476)
- * Use debhelper 9.
- * Remove old breaks relations.
- * Add 64-bit EFI images:
- - Build-depend on binutils-dev, zlib1g-dev.
- - Add combined EFI/legacy images for qemu.
- - Properly clean build dir.
- * Install images in ipxe-qemu to match names used by qemu:
- - Add compatility symlink for e1000_82540.
- - Use dh-exec to allow renames in dh_install.
-
- -- Bastian Blank Thu, 21 Nov 2013 18:26:32 +0100
-
-ipxe (1.0.0+git-20130710.936134e-0ubuntu1) saucy; urgency=low
-
- * New upstream snapshot:
- - d/p/fix-bp-bug.patch: Dropped; included in snapshot.
- - d/p/baseroms-target.diff: Dropped; no longer required.
- - Refreshed all other patches.
- * d/rules: Use date for snapshot prefix instead of increment.
- * d/p/qemu-target-fix-names.diff: Consolidated into qemu-target.diff.
- * d/p/*: Tidied redundant patches.
- * d/control,rules: Move roms for use with qemu-kvm to ipxe-qemu, update
- kvm-ipxe to be transitional.
- * d/control: Drop Depends from grub-ipxe to ipxe as its not required.
-
- -- James Page Wed, 10 Jul 2013 12:23:26 +0100
-
-ipxe (1.0.0+git-20120202.f6840ba-3) unstable; urgency=low
-
- * Fix to break qemu-system instead of qemu. (closes: #658982)
- * Make ipxe-qemu break and replace ipxe. (closes: #658684)
- * Add link for ipxe.lkrn, so all images can be found in one location.
-
- -- Bastian Blank Tue, 07 Feb 2012 16:09:43 +0100
-
-ipxe (1.0.0+git-20120202.f6840ba-2) unstable; urgency=low
-
- * Fix grub setup and restrict entry by default. (closes: #658465)
- * Install only combined images into ipxe package.
- * Install rom images needed for qemu into ipxe-qemu package.
- - Add breaks against qemu and qemu-kvm.
- * Disable rom banner timeout. (closes: #638574)
-
- -- Bastian Blank Fri, 03 Feb 2012 19:04:56 +0100
-
-ipxe (1.0.0+git-20120202.f6840ba-1) unstable; urgency=low
-
- * New snapshot.
- * Disable ath9k roms.
- * Fix tg3 build.
- * Create grub entry. (closes: #626238)
- * Override version string with package version.
-
- -- Bastian Blank Thu, 02 Feb 2012 12:40:26 +0100
-
-ipxe (1.0.0+git-4.d6b0b76-0ubuntu3) saucy; urgency=low
-
- * debian/patches/fix-bp-bug.patch: fixes FTBFS (LP: #1194914)
-
- -- Yolanda Robla Thu, 27 Jun 2013 11:22:43 +0200
-
-ipxe (1.0.0+git-4.d6b0b76-0ubuntu2) raring; urgency=low
-
- * d/control: Add ipxe-qemu virtual package for use with qemu.
-
- -- Serge Hallyn Tue, 20 Nov 2012 16:08:21 -0600
-
-ipxe (1.0.0+git-4.d6b0b76-0ubuntu1) raring; urgency=low
-
- * New upstream snapshot:
- - d/p/iscsi*.patch: Dropped - included in snapshot.
- - Refreshed all other patches.
- * d/p/enable-https.patch: Enable HTTPS support (LP: #1025239).
-
- -- James Page Wed, 14 Nov 2012 15:47:31 +0000
-
-ipxe (1.0.0+git-3.55f6c88-0ubuntu5) quantal; urgency=low
-
- * Fix input/output errors when using ipxe to boot from iSCSI storage
- (LP: #1045923).
- - d/p/iscsi-{report-reponse,send-padding-inline}.patch: Cherry picked
- patches from upstream VCS which resolve two issues with iSCSI protocol
- handling.
-
- -- James Page Thu, 06 Sep 2012 21:46:54 +0100
-
-ipxe (1.0.0+git-3.55f6c88-0ubuntu4) quantal; urgency=low
-
- * debian/ipxe.install: add ipxe.dsk and ipxe.usb (LP: #1014005)
-
- -- Serge Hallyn Tue, 21 Aug 2012 14:48:44 -0500
-
-ipxe (1.0.0+git-3.55f6c88-0ubuntu3) quantal; urgency=low
-
- [ Serge Hallyn ]
- * debian/patches/rom-set-banner-timeout-0.diff: set rom banner timeout
- to 0. (LP: #921230)
-
- [ Stefan Bader ]
- * Modify the ROM names in of the allqemu target to use 8086100e instead
- of e1000_82540 and ne instead of ne2k_isa (LP: #948323)
-
- -- Serge Hallyn Mon, 28 May 2012 11:57:48 -0500
-
-ipxe (1.0.0+git-3.55f6c88-0ubuntu2) quantal; urgency=low
-
- * debian/grub.d/25_ipxe: removed the space after "Found iPXE image"
- to match other grub-update script fragments (LP: #990378).
- * debian/control: fixed some Lintian warnings.
- - TODO: lots of missing Copyright information.
-
- -- Martin-Éric Racine Sat, 28 Apr 2012 11:41:28 +0300
+ -- Angel Berlanas Vicente Tue, 14 Apr 2015 14:55:07 +0200
ipxe (1.0.0+git-3.55f6c88-0ubuntu1) precise; urgency=low
@@ -224,4 +76,3 @@
- Remove linda infiniband driver.
-- Bastian Blank Sun, 03 Apr 2011 11:32:56 +0200
-
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/compat ipxe-1.0.1~lliurex1505/debian/compat
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/compat 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/compat 2012-02-10 17:00:50.000000000 +0000
@@ -1 +1 @@
-9
+7
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/config/general.h ipxe-1.0.1~lliurex1505/debian/config/general.h
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/config/general.h 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/config/general.h 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-#define ROM_BANNER_TIMEOUT 0
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/control ipxe-1.0.1~lliurex1505/debian/control
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/control 2014-01-06 09:48:16.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/control 2012-02-10 17:00:50.000000000 +0000
@@ -3,38 +3,30 @@
Priority: optional
Maintainer: Ubuntu Developers
XSBC-Original-Maintainer: Bastian Blank
-Build-Depends:
- debhelper (>> 9), dh-exec,
- genisoimage, syslinux,
- binutils-dev, zlib1g-dev
-Standards-Version: 3.9.1
+Build-Depends: debhelper (>= 7.0.50~),
+ genisoimage, syslinux
+Standards-Version: 3.9.2
Homepage: http://ipxe.org/
#Vcs-Git: git://git.debian.org/collab-maint/ipxe.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/ipxe.git;a=summary
-Package: ipxe
+Package: kvm-ipxe
Architecture: all
-Multi-Arch: foreign
-Depends: ipxe-qemu, grub-ipxe, ${misc:Depends}
-Description: PXE boot firmware
+Depends: ${misc:Depends}
+Breaks: ipxe (<< 1.0.0+git-2.149b50-1ubuntu3)
+Replaces: ipxe (<< 1.0.0+git-2.149b50-1ubuntu3)
+Description: PXE ROM's for KVM
iPXE is network boot firmware. It supports a variety of network cards,
including some wireless cards, and variety of network protocols (traditional
DHCP, BOOTP and TFTP and also HTTP, iSCSI, SAN via FCoE and Infiniband). It
supports scripting.
.
- It is possible to use iPXE as a PXE ROM in the network card or to
- chainload it from other boot methods.
- .
- This package provides boot code for all supported network cards in one
- binary and several bootable formats.
+ This package contains PXE ROM's made especially to pxeboot kvm vm's.
-Package: ipxe-qemu
+Package: ipxe
Architecture: all
-Multi-Arch: foreign
-Depends: ${misc:Depends}
-Breaks: kvm-ipxe (<< 1.0.0+git-20130710.936134e-0ubuntu1)
-Replaces: kvm-ipxe (<< 1.0.0+git-20130710.936134e-0ubuntu1)
-Description: PXE boot firmware - ROM images for qemu
+Depends: ${misc:Depends}, kvm-ipxe
+Description: PXE boot firmware
iPXE is network boot firmware. It supports a variety of network cards,
including some wireless cards, and variety of network protocols (traditional
DHCP, BOOTP and TFTP and also HTTP, iSCSI, SAN via FCoE and Infiniband). It
@@ -43,24 +35,19 @@
It is possible to use iPXE as a PXE ROM in the network card or to
chainload it from other boot methods.
.
- This package provides boot code for the qemu emulated network cards in
- as boot ROMs.
-
-Package: kvm-ipxe
-Architecture: all
-Depends: ipxe-qemu, ${misc:Depends}
-Section: oldlibs
-Description: transitional dummy package
- This is a transitional dummy package. It can safely be removed.
+ This package provides boot code for all supported network cards in one
+ binary, in several bootable formats, and also many boot ROMs to be
+ embedded in various network cards.
Package: grub-ipxe
Architecture: all
Suggests: grub-pc (>= 1.96)
-Depends: ${misc:Depends}
+Depends: ${misc:Depends}, ipxe
Description: Network booting from GRUB using iPXE
iPXE is network boot firmware. It supports a variety of network cards,
including some wireless cards, and variety of network protocols (traditional
DHCP, BOOTP and TFTP and also HTTP, iSCSI, SAN via FCoE and Infiniband). It
supports scripting.
.
- This package adds a menu entry to grub2 for network booting using iPXE.
+ This package adds a menu entry to grub2 for network booting using iPXE.
+
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/copyright ipxe-1.0.1~lliurex1505/debian/copyright
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/copyright 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/copyright 2012-02-10 17:00:50.000000000 +0000
@@ -1,6 +1,6 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Source: git://git.ipxe.org/ipxe.git
+Format: http://dep.debian.net/deps/dep5
Upstream-Name: ipxe
+Source: git://git.ipxe.org/ipxe.git
Files: *
License: GPL-2+
@@ -65,7 +65,7 @@
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
- .
+ .
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -93,7 +93,7 @@
src/drivers/net/3c5x9.c
src/drivers/net/ne2k_isa.c
src/drivers/net/ns8390.c
-Copyright:
+Coypright:
1993-1994 David Greenman, Martin Renters
1993-1995 Andres Vega Garcia
1994 Herb Peyerl
@@ -107,7 +107,7 @@
responsibility for damages incurred with its use.
Files: src/drivers/net/3c595.h
-Copyright:
+Coypright:
2000 Shusuke Nisiyama
License: BSD-3-clause
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/grub.d/25_ipxe ipxe-1.0.1~lliurex1505/debian/grub.d/25_ipxe
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/grub.d/25_ipxe 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/grub.d/25_ipxe 2012-02-10 17:00:50.000000000 +0000
@@ -0,0 +1,42 @@
+#!/bin/sh
+set -e
+
+if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then
+ . /usr/lib/grub/grub-mkconfig_lib
+ LX=linux16
+elif [ -f /usr/lib/grub/update-grub_lib ]; then
+ . /usr/lib/grub/update-grub_lib
+ LX=linux
+else
+ # no grub file, so we notify and exit gracefully
+ echo "Cannot find grub config file, exiting." >&2
+ exit 0
+fi
+
+# We can't cope with loop-mounted devices here.
+case ${GRUB_DEVICE_BOOT} in
+ /dev/loop/*|/dev/loop[0-9]) exit 0 ;;
+esac
+
+# iPXE is only supported on x86
+case $(dpkg --print-architecture) in
+ *i386|*amd64) ;;
+ *) exit 0 ;;
+esac
+
+prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+
+IPXE=/boot/ipxe.lkrn
+
+if test -e "$IPXE" ; then
+ IPXEPATH=$( make_system_path_relative_to_its_root "$IPXE" )
+ echo "Found iPXE image : $IPXEPATH" >&2
+ cat << EOF
+menuentry "Network boot (iPXE)" {
+EOF
+ printf '%s\n' "${prepare_boot_cache}"
+ cat << EOF
+ $LX $IPXEPATH
+}
+EOF
+fi
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/grub-ipxe.install ipxe-1.0.1~lliurex1505/debian/grub-ipxe.install
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/grub-ipxe.install 2013-11-26 15:55:10.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/grub-ipxe.install 2012-02-10 17:00:50.000000000 +0000
@@ -1,2 +1,2 @@
-debian/tree/ipxe/* .
-src/bin-x86_64-efi/ipxe.efi src/bin/ipxe.lkrn /boot
+debian/grub.d/25_ipxe etc/grub.d
+src/bin/ipxe.lkrn /boot
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/grub-ipxe.postinst ipxe-1.0.1~lliurex1505/debian/grub-ipxe.postinst
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/grub-ipxe.postinst 2013-11-26 17:47:25.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/grub-ipxe.postinst 2012-02-10 17:00:50.000000000 +0000
@@ -1,13 +1,10 @@
#!/bin/sh
-
+# Calls update-grub for the new ipxe entry to show up in the grub menu.
set -e
-case "$1" in
- configure)
- command -v update-grub > /dev/null && update-grub || :
- ;;
-esac
+if [ -e /boot/grub/grub.cfg ] && which update-grub >/dev/null 2>&1
+then
+ update-grub || true
+fi
#DEBHELPER#
-
-exit 0
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/grub-ipxe.postrm ipxe-1.0.1~lliurex1505/debian/grub-ipxe.postrm
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/grub-ipxe.postrm 2013-11-26 17:47:31.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/grub-ipxe.postrm 2012-02-10 17:00:50.000000000 +0000
@@ -1,13 +1,14 @@
#!/bin/sh
-
+# Calls update-grub for the new ipxe entry to show up in the grub menu.
set -e
-case "$1" in
- remove)
- command -v update-grub > /dev/null && update-grub || :
- ;;
-esac
+if [ "${1}" = "remove" ]
+then
-#DEBHELPER#
+ if [ -e /boot/grub/grub.cfg ] && which update-grub >/dev/null 2>&1
+ then
+ update-grub || true
+ fi
+fi
-exit 0
+#DEBHELPER#
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe.install ipxe-1.0.1~lliurex1505/debian/ipxe.install
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe.install 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/ipxe.install 2012-02-10 17:00:50.000000000 +0000
@@ -1,3 +1,5 @@
-src/bin/ipxe.iso src/bin/ipxe.pxe usr/lib/ipxe
-src/bin/ipxe.dsk src/bin/ipxe.usb usr/lib/ipxe
-src/bin/undionly.kpxe src/bin/undionly.kkpxe usr/lib/ipxe
+src/bin/*.rom usr/lib/ipxe
+src/bin/ipxe.iso usr/lib/ipxe
+src/bin/ipxe.lkrn usr/lib/ipxe
+src/bin/ipxe.pxe usr/lib/ipxe
+src/bin/undionly.kpxe usr/lib/ipxe
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe.links ipxe-1.0.1~lliurex1505/debian/ipxe.links
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe.links 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/ipxe.links 2012-02-10 17:00:50.000000000 +0000
@@ -1,2 +1,5 @@
-/boot/ipxe.efi /usr/lib/ipxe/ipxe.efi
-/boot/ipxe.lkrn /usr/lib/ipxe/ipxe.lkrn
+usr/share/qemu/pxe-virtio.rom usr/lib/ipxe/virtio-net.rom
+usr/share/qemu/pxe-rtl8139.rom usr/lib/ipxe/rtl8139.rom
+usr/share/qemu/pxe-pcnet32.rom usr/lib/ipxe/pcnet32.rom
+usr/share/qemu/pxe-ne2k_isa.rom usr/lib/ipxe/ne2k_isa.rom
+usr/share/qemu/pxe-e1000.rom usr/lib/ipxe/e1000_82540.rom
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe-qemu.install ipxe-1.0.1~lliurex1505/debian/ipxe-qemu.install
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe-qemu.install 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/ipxe-qemu.install 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-#! /usr/bin/dh-exec
-src/bin-efi/82540em.efirom => usr/lib/ipxe/qemu/efi-e1000.rom
-src/bin/82540em.rom => usr/lib/ipxe/qemu/pxe-e1000.rom
-src/bin-efi/eepro100.efirom => usr/lib/ipxe/qemu/efi-eepro100.rom
-src/bin/eepro100.rom => usr/lib/ipxe/qemu/pxe-eepro100.rom
-src/bin-efi/ns8390.efirom => usr/lib/ipxe/qemu/efi-ne2k_pci.rom
-src/bin/ns8390.rom => usr/lib/ipxe/qemu/pxe-ne2k_pci.rom
-src/bin-efi/pcnet32.efirom => usr/lib/ipxe/qemu/efi-pcnet.rom
-src/bin/pcnet32.rom => usr/lib/ipxe/qemu/pxe-pcnet.rom
-src/bin-efi/rtl8139.efirom => usr/lib/ipxe/qemu/efi-rtl8139.rom
-src/bin/rtl8139.rom => usr/lib/ipxe/qemu/pxe-rtl8139.rom
-src/bin-efi/virtio-net.efirom => usr/lib/ipxe/qemu/efi-virtio.rom
-src/bin/virtio-net.rom => usr/lib/ipxe/qemu/pxe-virtio.rom
-src/bin/ne.rom => usr/lib/ipxe/qemu/pxe-ne2k_isa.rom
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe-qemu.install.old ipxe-1.0.1~lliurex1505/debian/ipxe-qemu.install.old
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe-qemu.install.old 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/ipxe-qemu.install.old 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-src/bin/82540em.rom src/bin/eepro100.rom src/bin/ns8390.rom src/bin/pcnet32.rom src/bin/rtl8139.rom src/bin/virtio-net.rom usr/lib/ipxe
-#src/bin-combine/82540em.efirom src/bin/eepro100.efirom src/bin/ns8390.efirom src/bin/pcnet32.efirom src/bin/rtl8139.efirom src/bin/virtio-net.efirom usr/lib/ipxe
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe-qemu.links ipxe-1.0.1~lliurex1505/debian/ipxe-qemu.links
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/ipxe-qemu.links 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/ipxe-qemu.links 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-/usr/lib/ipxe/qemu/pxe-e1000.rom /usr/lib/ipxe/e1000_82540.rom
-/usr/lib/ipxe/qemu/pxe-e1000.rom /usr/lib/ipxe/82540em.rom
-/usr/lib/ipxe/qemu/pxe-eepro100.rom /usr/lib/ipxe/eepro100.rom
-/usr/lib/ipxe/qemu/pxe-ne2k_pci.rom /usr/lib/ipxe/ns8390.rom
-/usr/lib/ipxe/qemu/pxe-ne2k_isa.rom /usr/lib/ipxe/ne.rom
-/usr/lib/ipxe/qemu/pxe-pcnet.rom /usr/lib/ipxe/pcnet32.rom
-/usr/lib/ipxe/qemu/pxe-rtl8139.rom /usr/lib/ipxe/rtl8139.rom
-/usr/lib/ipxe/qemu/pxe-virtio.rom /usr/lib/ipxe/virtio-net.rom
-# Compat links for QEMU
-/usr/lib/ipxe/82540em.rom /usr/share/qemu/pxe-e1000.rom
-/usr/lib/ipxe/ne.rom /usr/share/qemu/pxe-ne2k_isa.rom
-/usr/lib/ipxe/rtl8139.rom /usr/share/qemu/pxe-rtl8139.rom
-/usr/lib/ipxe/virtio-net.rom /usr/share/qemu/pxe-virtio.rom
-/usr/lib/ipxe/pcnet32.rom /usr/share/qemu/pxe-pcnet32.rom
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/baseroms-target.diff ipxe-1.0.1~lliurex1505/debian/patches/baseroms-target.diff
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/baseroms-target.diff 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/baseroms-target.diff 2012-02-10 17:00:50.000000000 +0000
@@ -0,0 +1,10 @@
+--- a/src/Makefile.housekeeping
++++ b/src/Makefile.housekeeping
+@@ -928,6 +928,7 @@
+ #
+ allall: allroms allmroms allpxes allisos alldsks
+ allroms allmroms : all%s : $(foreach ROM,$(ROMS),$(BIN)/$(ROM).%)
++allbaseroms allbasemroms : allbase%s : $(foreach ROM,$(DRIVERS),$(BIN)/$(ROM).%)
+ allpxes allisos alldsks : all%s : $(foreach DRIVER,$(DRIVERS),$(BIN)/$(DRIVER).%)
+
+ # Alias for ipxe.%
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/disable-baddrivers.diff ipxe-1.0.1~lliurex1505/debian/patches/disable-baddrivers.diff
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/disable-baddrivers.diff 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/disable-baddrivers.diff 2012-02-10 17:00:50.000000000 +0000
@@ -0,0 +1,34 @@
+--- a/src/Makefile 2012-01-06 15:49:04.000000000 -0800
++++ b/src/Makefile 2012-01-10 14:10:28.120834619 -0800
+@@ -92,6 +92,31 @@
+ #
+ NON_AUTO_SRCS :=
+ NON_AUTO_SRCS += drivers/net/prism2.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ani.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar5008_phy.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9002_calib.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9002_hw.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9002_mac.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9002_phy.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9003_calib.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9003_eeprom.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9003_hw.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9003_mac.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_ar9003_phy.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_calib.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_common.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_eeprom_4k.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_eeprom_9287.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_eeprom.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_eeprom_def.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_hw.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_init.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_mac.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_main.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_recv.c
++NON_AUTO_SRCS += drivers/net/ath/ath9k/ath9k_xmit.c
++
+
+ # INCDIRS lists the include path
+ #
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/enable-https.patch ipxe-1.0.1~lliurex1505/debian/patches/enable-https.patch
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/enable-https.patch 2013-11-26 15:08:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/enable-https.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
---- a/src/config/general.h
-+++ b/src/config/general.h
-@@ -57,7 +57,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
-
- #define DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */
- #define DOWNLOAD_PROTO_HTTP /* Hypertext Transfer Protocol */
--#undef DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */
-+#define DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */
- #undef DOWNLOAD_PROTO_FTP /* File Transfer Protocol */
- #undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */
- #undef DOWNLOAD_PROTO_NFS /* Network File System Protocol */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/qemu-target.diff ipxe-1.0.1~lliurex1505/debian/patches/qemu-target.diff
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/qemu-target.diff 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/qemu-target.diff 2012-02-10 17:00:50.000000000 +0000
@@ -0,0 +1,13 @@
+--- a/src/Makefile.housekeeping
++++ b/src/Makefile.housekeeping
+@@ -950,5 +950,10 @@
+ allpxes allisos alldsks : all%s : $(foreach DRIVER,$(DRIVERS),$(BIN)/$(DRIVER).%)
+
++# Create qemu target for qemu package
++#
++QEMUS = e1000_82540 ne2k_isa pcnet32 rtl8139 virtio-net
++allqemu : $(foreach ROM,$(QEMUS),$(BIN)/$(ROM).rom)
++
+ # Alias for ipxe.%
+ #
+ $(BIN)/etherboot.% : $(BIN)/ipxe.%
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/remove-libiberty.diff ipxe-1.0.1~lliurex1505/debian/patches/remove-libiberty.diff
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/remove-libiberty.diff 2013-12-22 18:55:56.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/remove-libiberty.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,15 +0,0 @@
-Description: Don't use libiberty
-Author: Bastian Blank
-Bug-Debian: http://bugs.debian.org/730910
----
---- ipxe-1.0.0+git-20131111.c3d1e78.orig/src/Makefile.housekeeping
-+++ ipxe-1.0.0+git-20131111.c3d1e78/src/Makefile.housekeeping
-@@ -1179,7 +1179,7 @@ CLEANUP += $(ZBIN)
- ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
- -I$(ZLIB_DIR)/include -idirafter include
- ELF2EFI_LDFLAGS := -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib -L$(ZLIB_DIR)/lib \
-- -lbfd -ldl -liberty -lz -Wl,--no-warn-search-mismatch
-+ -lbfd -ldl -lz -Wl,--no-warn-search-mismatch
-
- $(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
- $(QM)$(ECHO) " [HOSTCC] $@"
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/rom-change-banner-timeout.diff ipxe-1.0.1~lliurex1505/debian/patches/rom-change-banner-timeout.diff
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/rom-change-banner-timeout.diff 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/rom-change-banner-timeout.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
---- a/src/arch/i386/prefix/romprefix.S
-+++ b/src/arch/i386/prefix/romprefix.S
-@@ -30,7 +30,9 @@
- * doubled to allow for BIOSes that switch video modes immediately
- * beforehand, so rendering the message almost invisible to the user.
- */
-+#ifndef ROM_BANNER_TIMEOUT
- #define ROM_BANNER_TIMEOUT ( 2 * ( 18 * BANNER_TIMEOUT ) / 10 )
-+#endif
-
- /* Allow payload to be excluded from ROM size
- */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/series ipxe-1.0.1~lliurex1505/debian/patches/series
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/patches/series 2014-01-06 09:48:23.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/patches/series 2012-02-10 17:00:50.000000000 +0000
@@ -1,3 +1,3 @@
-rom-change-banner-timeout.diff
-enable-https.patch
-remove-libiberty.diff
+baseroms-target.diff
+disable-baddrivers.diff
+qemu-target.diff
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/rules ipxe-1.0.1~lliurex1505/debian/rules
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/rules 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/rules 2012-02-10 17:32:46.000000000 +0000
@@ -4,32 +4,29 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
-
%:
- +dh $@
-
-override_dh_auto_configure:
- cp debian/config/* src/config/local
-
-src/bin/% src/bin-x86_64-efi/%:
- $(MAKE) -C src V=1 NO_WERROR=1 VERSION="$(VERSION)" $(subst src/,,$@)
+ dh $@
-src/bin-efi/%.efirom: src/bin/%.rom src/bin-x86_64-efi/%.efirom
- @[ -d $(dir $@) ] || mkdir $(dir $@)
- src/util/catrom.pl $^ > $@
-
-override_dh_auto_build: $(shell grep -hoE 'src/bin(-[^/]*)?/\S+' debian/*.install)
+override_dh_auto_build:
+ make -C src V=1 NO_WERROR=1 all allroms allqemu bin/ipxe.pxe bin/ipxe.lkrn
override_dh_auto_clean:
- $(MAKE) -C src veryclean
- rm -fr src/bin-efi src/bin-x86_64-efi
+ make -C src veryclean
rm -f src/config/local/*
+override_dh_auto_install:
+ mkdir -p $(CURDIR)/debian/kvm-ipxe/usr/share/qemu
+ mv src/bin/e1000_82540.rom $(CURDIR)/debian/kvm-ipxe/usr/share/qemu/pxe-e1000.rom
+ mv src/bin/ne2k_isa.rom $(CURDIR)/debian/kvm-ipxe/usr/share/qemu/pxe-ne2k_isa.rom
+ mv src/bin/pcnet32.rom $(CURDIR)/debian/kvm-ipxe/usr/share/qemu/pxe-pcnet32.rom
+ mv src/bin/rtl8139.rom $(CURDIR)/debian/kvm-ipxe/usr/share/qemu/pxe-rtl8139.rom
+ mv src/bin/virtio-net.rom $(CURDIR)/debian/kvm-ipxe/usr/share/qemu/pxe-virtio.rom
+
# Stuff for get-orig-source.
version_prefix := $(shell dpkg-parsechangelog | sed -ne 's/^Version.*git-\(.*\)\..*/\1/p')
-# Git short hash is prefixed with date of snapshot
-new_prefix := $(shell date +%Y%m%d)
+# Git short hash is prefixed with version number -
+# increment for next snapshot
+new_prefix := $(shell expr $(version_prefix) + 1)
get-orig-source:
# Grab the latest snapshot of the upstream git repository
@@ -37,9 +34,6 @@
git clone git://git.ipxe.org/ipxe.git ipxe-snapshot
cd ipxe-snapshot && \
commit=`git rev-parse --short HEAD` && \
- git archive --format=tar --prefix=ipxe-1.0.0+git-$(new_prefix).$${commit}/ master |\
+ git archive --format=tar --prefix=ipxe-1.0.0+git-$(new_prefix).$${commit} master |\
gzip -9 --no-name > ../../ipxe_1.0.0+git-$(new_prefix).$${commit}.orig.tar.gz
rm -rf ipxe-snapshot
-
-.NOTPARALLEL:
-.SECONDARY:
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/source/format ipxe-1.0.1~lliurex1505/debian/source/format
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/source/format 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/source/format 2015-04-14 12:56:07.000000000 +0000
@@ -1 +1 @@
-3.0 (quilt)
+1.0
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/debian/tree/ipxe/etc/grub.d/20_ipxe ipxe-1.0.1~lliurex1505/debian/tree/ipxe/etc/grub.d/20_ipxe
--- ipxe-1.0.0+git-20131111.c3d1e78/debian/tree/ipxe/etc/grub.d/20_ipxe 2013-12-22 21:40:08.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/debian/tree/ipxe/etc/grub.d/20_ipxe 1970-01-01 00:00:00.000000000 +0000
@@ -1,40 +0,0 @@
-#!/bin/sh
-set -e
-
-if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then
- . /usr/lib/grub/grub-mkconfig_lib
- LX=linux16
-elif [ -f /usr/lib/grub/update-grub_lib ]; then
- . /usr/lib/grub/update-grub_lib
- LX=linux
-else
- # no grub file, so we notify and exit gracefully
- echo "Cannot find grub config file, exiting." >&2
- exit 0
-fi
-
-# We can't cope with loop-mounted devices here.
-case ${GRUB_DEVICE_BOOT} in
- /dev/loop/*|/dev/loop[0-9]) exit 0 ;;
-esac
-
-# iPXE is only supported on x86
-case $(dpkg --print-architecture) in
- *i386|*amd64) ;;
- *) exit 0 ;;
-esac
-
-prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
-
-IPXE=/boot/ipxe.lkrn
-
-if test -e "$IPXE" ; then
- IPXEPATH=$( make_system_path_relative_to_its_root "$IPXE" )
- echo "Found iPXE image: $IPXEPATH" >&2
- cat << EOF
-menuentry "Network boot (iPXE)" --users "" --class network {
-${prepare_boot_cache}
- $LX $IPXEPATH
-}
-EOF
-fi
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/applied-patches ipxe-1.0.1~lliurex1505/.pc/applied-patches
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/applied-patches 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/applied-patches 2015-04-14 12:54:27.000000000 +0000
@@ -0,0 +1,3 @@
+baseroms-target.diff
+disable-baddrivers.diff
+qemu-target.diff
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/baseroms-target.diff/src/Makefile.housekeeping ipxe-1.0.1~lliurex1505/.pc/baseroms-target.diff/src/Makefile.housekeeping
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/baseroms-target.diff/src/Makefile.housekeeping 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/baseroms-target.diff/src/Makefile.housekeeping 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,1153 @@
+# -*- makefile -*- : Force emacs to use Makefile mode
+#
+# This file contains various boring housekeeping functions that would
+# otherwise seriously clutter up the main Makefile.
+
+###############################################################################
+#
+# Find a usable "echo -e" substitute.
+#
+TAB := $(shell $(PRINTF) '\t')
+ECHO_E_ECHO := $(ECHO)
+ECHO_E_ECHO_E := $(ECHO) -e
+ECHO_E_BIN_ECHO := /bin/echo
+ECHO_E_BIN_ECHO_E := /bin/echo -e
+ECHO_E_ECHO_TAB := $(shell $(ECHO_E_ECHO) '\t' | cat)
+ECHO_E_ECHO_E_TAB := $(shell $(ECHO_E_ECHO_E) '\t' | cat)
+ECHO_E_BIN_ECHO_TAB := $(shell $(ECHO_E_BIN_ECHO) '\t')
+ECHO_E_BIN_ECHO_E_TAB := $(shell $(ECHO_E_BIN_ECHO_E) '\t')
+
+ifeq ($(ECHO_E_ECHO_TAB),$(TAB))
+ECHO_E := $(ECHO_E_ECHO)
+endif
+ifeq ($(ECHO_E_ECHO_E_TAB),$(TAB))
+ECHO_E := $(ECHO_E_ECHO_E)
+endif
+ifeq ($(ECHO_E_BIN_ECHO_TAB),$(TAB))
+ECHO_E := $(ECHO_E_BIN_ECHO)
+endif
+ifeq ($(ECHO_E_BIN_ECHO_E_TAB),$(TAB))
+ECHO_E := $(ECHO_E_BIN_ECHO_E)
+endif
+
+.echocheck :
+ifdef ECHO_E
+ @$(TOUCH) $@
+else
+ @$(PRINTF) '%24s : x%sx\n' 'tab' '$(TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO) \t"' \
+ '$(ECHO_E_ECHO_TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO_E) \t"' \
+ '$(ECHO_E_ECHO_E_TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO) \t"' \
+ '$(ECHO_E_BIN_ECHO_TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO_E) \t"' \
+ '$(ECHO_E_BIN_ECHO_E_TAB)'
+ @$(ECHO) "No usable \"echo -e\" substitute found"
+ @exit 1
+endif
+MAKEDEPS += .echocheck
+VERYCLEANUP += .echocheck
+
+echo :
+ @$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
+
+###############################################################################
+#
+# Generate a usable "seq" substitute
+#
+define seq
+ $(shell awk 'BEGIN { for ( i = $(1) ; i <= $(2) ; i++ ) print i }')
+endef
+
+###############################################################################
+#
+# Determine host OS
+#
+HOST_OS := $(shell uname -s)
+hostos :
+ @$(ECHO) $(HOST_OS)
+
+###############################################################################
+#
+# Determine compiler
+
+CCDEFS := $(shell $(CC) -E -x c -c /dev/null -dM | cut -d" " -f2)
+ccdefs:
+ @$(ECHO) $(CCDEFS)
+
+ifeq ($(filter __ICC,$(CCDEFS)),__ICC)
+CCTYPE := icc
+else
+CCTYPE := gcc
+endif
+cctype:
+ @$(ECHO) $(CCTYPE)
+
+###############################################################################
+#
+# Check for tools that can cause failed builds
+#
+
+ifeq ($(CCTYPE),gcc)
+GCC_2_96_BANNER := $(shell $(CC) -v 2>&1 | grep -is 'gcc version 2\.96')
+ifneq ($(GCC_2_96_BANNER),)
+$(warning gcc 2.96 is unsuitable for compiling iPXE)
+$(warning Use gcc 2.95 or a newer version instead)
+$(error Unsuitable build environment found)
+endif
+endif
+
+PERL_UNICODE_CHECK := $(shell $(PERL) -e 'use bytes; print chr(255)' | wc -c)
+ifeq ($(PERL_UNICODE_CHECK),2)
+$(warning Your Perl version has a Unicode handling bug)
+$(warning Execute this command before building iPXE:)
+$(warning export LANG=$${LANG%.UTF-8})
+$(error Unsuitable build environment found)
+endif
+
+LD_GOLD_BANNER := $(shell $(LD) -v 2>&1 | grep 'GNU gold')
+ifneq ($(LD_GOLD_BANNER),)
+$(warning GNU gold is unsuitable for building iPXE)
+$(warning Use GNU ld instead)
+$(error Unsuitable build environment found)
+endif
+
+###############################################################################
+#
+# Check for various tool workarounds
+#
+
+WORKAROUND_CFLAGS :=
+WORKAROUND_ASFLAGS :=
+WORKAROUND_LDFLAGS :=
+
+# Make syntax does not allow use of comma or space in certain places.
+# This ugly workaround is suggested in the manual.
+#
+COMMA := ,
+EMPTY :=
+SPACE := $(EMPTY) $(EMPTY)
+
+# Check for an old version of gas (binutils 2.9.1)
+#
+OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
+WORKAROUND_CFLAGS += $(OLDGAS)
+oldgas :
+ @$(ECHO) $(oldgas)
+
+# Some widespread patched versions of gcc include -fstack-protector by
+# default, even when -ffreestanding is specified. We therefore need
+# to disable -fstack-protector if the compiler supports it.
+#
+ifeq ($(CCTYPE),gcc)
+SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
+ -o /dev/null >/dev/null 2>&1
+SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
+WORKAROUND_CFLAGS += $(SP_FLAGS)
+endif
+
+# Some widespread patched versions of gcc include -fPIE -Wl,-pie by
+# default. Note that gcc will exit *successfully* if it fails to
+# recognise an option that starts with "no", so we have to test for
+# output on stderr instead of checking the exit status.
+#
+ifeq ($(CCTYPE),gcc)
+PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
+PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
+WORKAROUND_CFLAGS += $(PIE_FLAGS)
+endif
+
+# gcc 4.4 generates .eh_frame sections by default, which distort the
+# output of "size". Inhibit this.
+#
+ifeq ($(CCTYPE),gcc)
+CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
+ -o /dev/null >/dev/null 2>&1
+CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
+WORKAROUND_CFLAGS += $(CFI_FLAGS)
+endif
+
+# gcc 4.6 generates spurious warnings if -Waddress is in force.
+# Inhibit this.
+#
+ifeq ($(CCTYPE),gcc)
+WNA_TEST = $(CC) -Wno-address -x c -c /dev/null -o /dev/null >/dev/null 2>&1
+WNA_FLAGS := $(shell $(WNA_TEST) && $(ECHO) '-Wno-address')
+WORKAROUND_CFLAGS += $(WNA_FLAGS)
+endif
+
+# Some versions of gas choke on division operators, treating them as
+# comment markers. Specifying --divide will work around this problem,
+# but isn't available on older gas versions.
+#
+DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
+DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
+WORKAROUND_ASFLAGS += $(DIVIDE_FLAGS)
+
+###############################################################################
+#
+# Build verbosity
+#
+ifeq ($(V),1)
+Q :=
+QM := @\#
+else
+Q := @
+QM := @
+endif
+
+###############################################################################
+#
+# Set BIN according to whatever was specified on the command line as
+# the build target.
+#
+
+# Determine how many different BIN directories are mentioned in the
+# make goals.
+#
+BIN_GOALS := $(filter bin/% bin-%,$(MAKECMDGOALS))
+BIN_GOALS_BINS := $(sort $(foreach BG,$(BIN_GOALS),\
+ $(firstword $(subst /, ,$(BG)))))
+NUM_BINS := $(words $(BIN_GOALS_BINS))
+
+ifeq ($(NUM_BINS),0)
+
+# No BIN directory was specified. Set BIN to "bin" as a sensible
+# default.
+
+BIN := bin
+
+else # NUM_BINS == 0
+
+ifeq ($(NUM_BINS),1)
+
+# If exactly one BIN directory was specified, set BIN to match this
+# directory.
+#
+BIN := $(firstword $(BIN_GOALS_BINS))
+
+else # NUM_BINS == 1
+
+# More than one BIN directory was specified. We cannot handle the
+# latter case within a single make invocation, so set up recursive
+# targets for each BIN directory. Use exactly one target for each BIN
+# directory since running multiple make invocations within the same
+# BIN directory is likely to cause problems.
+#
+# Leave $(BIN) undefined. This has implications for any target that
+# depends on $(BIN); such targets should be made conditional upon the
+# existence of $(BIN).
+#
+BIN_GOALS_FIRST := $(foreach BGB,$(BIN_GOALS_BINS),\
+ $(firstword $(filter $(BGB)/%,$(BIN_GOALS))))
+BIN_GOALS_OTHER := $(filter-out $(BIN_GOALS_FIRST),$(BIN_GOALS))
+
+$(BIN_GOALS_FIRST) : % : BIN_RECURSE
+ $(Q)$(MAKE) --no-print-directory BIN=$(firstword $(subst /, ,$@)) \
+ $(filter $(firstword $(subst /, ,$@))/%, $(BIN_GOALS))
+$(BIN_GOALS_OTHER) : % : BIN_RECURSE
+ $(Q)$(TRUE)
+.PHONY : BIN_RECURSE
+
+endif # NUM_BINS == 1
+endif # NUM_BINS == 0
+
+ifdef BIN
+
+# Create $(BIN) directory if it doesn't exist yet
+#
+ifeq ($(wildcard $(BIN)),)
+$(shell $(MKDIR) -p $(BIN))
+endif
+
+# Target to allow e.g. "make bin-efi arch"
+#
+$(BIN) :
+ @# Do nothing, silently
+.PHONY : $(BIN)
+
+# Remove everything in $(BIN) for a "make clean"
+#
+CLEANUP += $(BIN)/*.* # Avoid picking up directories
+
+endif # defined(BIN)
+
+# Determine whether or not we need to include the dependency files
+#
+NO_DEP_TARGETS := $(BIN) clean veryclean
+ifeq ($(MAKECMDGOALS),)
+NEED_DEPS := 1
+endif
+ifneq ($(strip $(filter-out $(NO_DEP_TARGETS),$(MAKECMDGOALS))),)
+NEED_DEPS := 1
+endif
+
+###############################################################################
+#
+# Select build architecture and platform based on $(BIN)
+#
+# BIN has the form bin[-[arch-]platform]
+
+ARCHS := $(patsubst arch/%,%,$(wildcard arch/*))
+PLATFORMS := $(patsubst config/defaults/%.h,%,\
+ $(wildcard config/defaults/*.h))
+archs :
+ @$(ECHO) $(ARCHS)
+
+platforms :
+ @$(ECHO) $(PLATFORMS)
+
+ifdef BIN
+
+# Determine architecture portion of $(BIN), if present
+BIN_ARCH := $(strip $(foreach A,$(ARCHS),\
+ $(patsubst bin-$(A)-%,$(A),\
+ $(filter bin-$(A)-%,$(BIN)))))
+
+# Determine platform portion of $(BIN), if present
+ifeq ($(BIN_ARCH),)
+BIN_PLATFORM := $(patsubst bin-%,%,$(filter bin-%,$(BIN)))
+else
+BIN_PLATFORM := $(patsubst bin-$(BIN_ARCH)-%,%,$(BIN))
+endif
+
+# Determine build architecture
+DEFAULT_ARCH := i386
+ARCH := $(firstword $(BIN_ARCH) $(DEFAULT_ARCH))
+CFLAGS += -DARCH=$(ARCH)
+arch :
+ @$(ECHO) $(ARCH)
+.PHONY : arch
+
+# Determine build platform
+DEFAULT_PLATFORM := pcbios
+PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM))
+CFLAGS += -DPLATFORM=$(PLATFORM)
+platform :
+ @$(ECHO) $(PLATFORM)
+
+endif # defined(BIN)
+
+# Include architecture-specific Makefile
+ifdef ARCH
+MAKEDEPS += arch/$(ARCH)/Makefile
+include arch/$(ARCH)/Makefile
+endif
+
+# Include architecture-specific include path
+ifdef ARCH
+INCDIRS += arch/$(ARCH)/include
+INCDIRS += arch/$(ARCH)/include/$(PLATFORM)
+endif
+
+###############################################################################
+#
+# Source file handling
+
+# SRCDIRS lists all directories containing source files.
+srcdirs :
+ @$(ECHO) $(SRCDIRS)
+
+# SRCS lists all .c or .S files found in any SRCDIR
+#
+SRCS += $(wildcard $(patsubst %,%/*.c,$(SRCDIRS)))
+SRCS += $(wildcard $(patsubst %,%/*.S,$(SRCDIRS)))
+srcs :
+ @$(ECHO) $(SRCS)
+
+# AUTO_SRCS lists all files in SRCS that are not mentioned in
+# NON_AUTO_SRCS. Files should be added to NON_AUTO_SRCS if they
+# cannot be built using the standard build template.
+#
+AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS))
+autosrcs :
+ @$(ECHO) $(AUTO_SRCS)
+
+# Just about everything else in this section depends upon having
+# $(BIN) set
+
+ifdef BIN
+
+# INCDIRS lists the include path
+incdirs :
+ @$(ECHO) $(INCDIRS)
+
+# Common flags
+#
+CFLAGS += $(foreach INC,$(INCDIRS),-I$(INC))
+CFLAGS += -Os
+CFLAGS += -g
+ifeq ($(CCTYPE),gcc)
+CFLAGS += -ffreestanding
+CFLAGS += -Wall -W -Wformat-nonliteral
+endif
+ifeq ($(CCTYPE),icc)
+CFLAGS += -fno-builtin
+CFLAGS += -no-ip
+CFLAGS += -no-gcc
+CFLAGS += -diag-disable 111 # Unreachable code
+CFLAGS += -diag-disable 128 # Unreachable loop
+CFLAGS += -diag-disable 170 # Array boundary checks
+CFLAGS += -diag-disable 177 # Unused functions
+CFLAGS += -diag-disable 181 # printf() format checks
+CFLAGS += -diag-disable 188 # enum strictness
+CFLAGS += -diag-disable 193 # Undefined preprocessor identifiers
+CFLAGS += -diag-disable 280 # switch ( constant )
+CFLAGS += -diag-disable 310 # K&R parameter lists
+CFLAGS += -diag-disable 424 # Extra semicolon
+CFLAGS += -diag-disable 589 # Declarations mid-code
+CFLAGS += -diag-disable 593 # Unused variables
+CFLAGS += -diag-disable 810 # Casting ints to smaller ints
+CFLAGS += -diag-disable 981 # Sequence point violations
+CFLAGS += -diag-disable 1292 # Ignored attributes
+CFLAGS += -diag-disable 1338 # void pointer arithmetic
+CFLAGS += -diag-disable 1361 # Variable-length arrays
+CFLAGS += -diag-disable 1418 # Missing prototypes
+CFLAGS += -diag-disable 1419 # Missing prototypes
+CFLAGS += -diag-disable 1599 # Hidden variables
+CFLAGS += -Wall -Wmissing-declarations
+endif
+CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
+ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
+LDFLAGS += $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
+
+# Inhibit -Werror if NO_WERROR is specified on make command line
+#
+ifneq ($(NO_WERROR),1)
+CFLAGS += -Werror
+ASFLAGS += --fatal-warnings
+endif
+
+# Function trace recorder state in the last build. This is needed
+# in order to correctly rebuild whenever the function recorder is
+# enabled/disabled.
+#
+FNREC_STATE := $(BIN)/.fnrec.state
+ifeq ($(wildcard $(FNREC_STATE)),)
+FNREC_OLD :=
+else
+FNREC_OLD := $(shell cat $(FNREC_STATE))
+endif
+ifeq ($(FNREC_OLD),$(FNREC))
+$(FNREC_STATE) :
+else
+$(FNREC_STATE) : clean
+$(shell $(ECHO) "$(FNREC)" > $(FNREC_STATE))
+endif
+
+VERYCLEANUP += $(FNREC_STATE)
+MAKEDEPS += $(FNREC_STATE)
+
+ifeq ($(FNREC),1)
+# Enabling -finstrument-functions affects gcc's analysis and leads to spurious
+# warnings about use of uninitialised variables.
+#
+CFLAGS += -Wno-uninitialized
+CFLAGS += -finstrument-functions
+CFLAGS += -finstrument-functions-exclude-file-list=core/fnrec.c
+endif
+
+# Enable per-item sections and section garbage collection. Note that
+# some older versions of gcc support -fdata-sections but treat it as
+# implying -fno-common, which would break our build. Some other older
+# versions issue a spurious and uninhibitable warning if
+# -ffunction-sections is used with -g, which would also break our
+# build since we use -Werror.
+#
+ifeq ($(CCTYPE),gcc)
+DS_TEST = $(ECHO) 'char x;' | \
+ $(CC) -fdata-sections -S -x c - -o - 2>/dev/null | \
+ grep -E '\.comm' > /dev/null
+DS_FLAGS := $(shell $(DS_TEST) && $(ECHO) '-fdata-sections')
+FS_TEST = $(CC) -ffunction-sections -g -c -x c /dev/null \
+ -o /dev/null 2>/dev/null
+FS_FLAGS := $(shell $(FS_TEST) && $(ECHO) '-ffunction-sections')
+CFLAGS += $(FS_FLAGS) $(DS_FLAGS)
+endif
+LDFLAGS += --gc-sections
+
+# compiler.h is needed for our linking and debugging system
+#
+CFLAGS += -include compiler.h
+
+# CFLAGS for specific object types
+#
+CFLAGS_c +=
+CFLAGS_S += -DASSEMBLY
+
+# Base object name of the current target
+#
+OBJECT = $(firstword $(subst ., ,$(@F)))
+
+# CFLAGS for specific object files. You can define
+# e.g. CFLAGS_rtl8139, and have those flags automatically used when
+# compiling bin/rtl8139.o.
+#
+OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
+$(BIN)/%.flags :
+ @$(ECHO) $(OBJ_CFLAGS)
+
+# ICC requires postprocessing objects to fix up table alignments
+#
+ifeq ($(CCTYPE),icc)
+POST_O = && $(ICCFIX) $@
+POST_O_DEPS := $(ICCFIX)
+else
+POST_O :=
+POST_O_DEPS :=
+endif
+
+# Rules for specific object types.
+#
+COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
+RULE_c = $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
+RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(subst -,_,$(OBJECT))=$* -c $< -o $@ $(POST_O)
+RULE_c_to_c = $(Q)$(COMPILE_c) -E -c $< > $@
+RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
+
+PREPROCESS_S = $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
+ASSEMBLE_S = $(AS) $(ASFLAGS)
+RULE_S = $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
+RULE_S_to_dbg%.o = $(Q)$(PREPROCESS_S) -Ddebug_$(subst -,_,$(OBJECT))=$* $< | $(ASSEMBLE_S) -o $@
+RULE_S_to_s = $(Q)$(PREPROCESS_S) $< > $@
+
+DEBUG_TARGETS += dbg%.o c s
+
+# We automatically generate rules for any file mentioned in AUTO_SRCS
+# using the following set of templates. It would be cleaner to use
+# $(eval ...), but this function exists only in GNU make >= 3.80.
+
+# deps_template : generate dependency list for a given source file
+#
+# $(1) is the full path to the source file (e.g. "drivers/net/rtl8139.c")
+# $(2) is the source type (e.g. "c")
+# $(3) is the source base name (e.g. "rtl8139")
+#
+define deps_template
+ @$(ECHO) " [DEPS] $(1)"
+ @$(MKDIR) -p $(BIN)/deps/$(dir $(1))
+ @$(CPP) $(CFLAGS) $(CFLAGS_$(2)) $(CFLAGS_$(3)) -DOBJECT=$(3) \
+ -Wno-error -M $(1) -MG -MP | \
+ sed 's/\.o\s*:/_DEPS =/' > $(BIN)/deps/$(1).d
+endef
+
+# rules_template : generate rules for a given source file
+#
+# $(1) is the full path to the source file (e.g. "drivers/net/rtl8139.c")
+# $(2) is the source type (e.g. "c")
+# $(3) is the source base name (e.g. "rtl8139")
+#
+define rules_template
+ @$(ECHO) " [RULES] $(1)"
+ @$(MKDIR) -p $(BIN)/rules/$(dir $(1))
+ @$(ECHO_E) '\n$$(BIN)/$(3).o :' \
+ '$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(3)_DEPS)' \
+ '\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
+ '\n\t$$(RULE_$(2))\n' \
+ '\nBOBJS += $$(BIN)/$(3).o\n' \
+ $(foreach TGT,$(DEBUG_TARGETS), \
+ $(if $(RULE_$(2)_to_$(TGT)), \
+ '\n$$(BIN)/$(3).$(TGT) :' \
+ '$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(3)_DEPS)' \
+ '\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
+ '\n\t$$(RULE_$(2)_to_$(TGT))\n' \
+ '\n$(TGT)_OBJS += $$(BIN)/$(3).$(TGT)\n' ) ) \
+ '\n$(BIN)/deps/$(1).d : $$($(3)_DEPS)\n' \
+ '\nTAGS : $$($(3)_DEPS)\n' > $(BIN)/rules/$(1).r
+ @$(if $(findstring drivers/,$(1)),\
+ $(PERL) $(PARSEROM) $(1) >> $(BIN)/rules/$(1).r)
+endef
+
+# Rule to generate the dependency list file
+#
+$(BIN)/deps/%.d : % $(MAKEDEPS)
+ $(call deps_template,$<,$(subst .,,$(suffix $<)),$(basename $(notdir $<)))
+
+# Calculate and include the list of dependency list files
+#
+AUTO_DEPS = $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS))
+ifdef NEED_DEPS
+ifneq ($(AUTO_DEPS),)
+-include $(AUTO_DEPS)
+endif
+endif
+autodeps :
+ @$(ECHO) $(AUTO_DEPS)
+VERYCLEANUP += $(BIN)/deps
+
+# Rule to generate the rules file
+#
+$(BIN)/rules/%.r : % $(MAKEDEPS) $(PARSEROM)
+ $(call rules_template,$<,$(subst .,,$(suffix $<)),$(basename $(notdir $<)))
+
+# Calculate and include the list of rules files
+#
+AUTO_RULES = $(patsubst %,$(BIN)/rules/%.r,$(AUTO_SRCS))
+ifdef NEED_DEPS
+ifneq ($(AUTO_RULES),)
+-include $(AUTO_RULES)
+endif
+endif
+autorules :
+ @$(ECHO) $(AUTO_RULES)
+VERYCLEANUP += $(BIN)/rules
+
+# The following variables are created by the rules files
+#
+bobjs :
+ @$(ECHO) $(BOBJS)
+drivers :
+ @$(ECHO) $(DRIVERS)
+.PHONY : drivers
+roms :
+ @$(ECHO) $(ROMS)
+
+# List of embedded images included in the last build of embedded.o.
+# This is needed in order to correctly rebuild embedded.o whenever the
+# list of objects changes.
+#
+EMBED := $(EMBEDDED_IMAGE) # Maintain backwards compatibility
+EMBEDDED_LIST := $(BIN)/.embedded.list
+ifeq ($(wildcard $(EMBEDDED_LIST)),)
+EMBED_OLD :=
+else
+EMBED_OLD := $(shell cat $(EMBEDDED_LIST))
+endif
+ifneq ($(EMBED_OLD),$(EMBED))
+$(shell $(ECHO) "$(EMBED)" > $(EMBEDDED_LIST))
+endif
+
+$(EMBEDDED_LIST) :
+
+VERYCLEANUP += $(EMBEDDED_LIST)
+
+EMBEDDED_FILES := $(subst $(COMMA), ,$(EMBED))
+EMBED_ALL := $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\
+ EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
+ \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
+
+$(BIN)/embedded.o : $(EMBEDDED_FILES) $(EMBEDDED_LIST)
+
+# This file uses .incbin inline assembly to include a binary file.
+# Unfortunately ccache does not detect this dependency and caches builds even
+# when the binary file has changed.
+#
+$(BIN)/embedded.o : override CC := env CCACHE_DISABLE=1 $(CC)
+
+CFLAGS_embedded = -DEMBED_ALL="$(EMBED_ALL)"
+
+# Generate error usage information
+#
+$(BIN)/%.einfo : $(BIN)/%.o
+ $(QM)$(ECHO) " [EINFO] $@"
+ $(Q)$(OBJCOPY) -O binary -j .einfo --set-section-flags .einfo=alloc \
+ $< $@
+
+EINFOS := $(patsubst $(BIN)/%.o,$(BIN)/%.einfo,$(BOBJS))
+$(BIN)/errors : $(EINFOS) $(EINFO)
+ $(QM)$(ECHO) " [EINFO] $@"
+ $(Q)$(EINFO) $(EINFOS) | sort > $@
+CLEANUP += $(BIN)/errors # Doesn't match the $(BIN)/*.* pattern
+
+# Generate the NIC file from the parsed source files. The NIC file is
+# only for rom-o-matic.
+#
+$(BIN)/NIC : $(AUTO_DEPS)
+ @$(ECHO) '# This is an automatically generated file, do not edit' > $@
+ @$(ECHO) '# It does not affect anything in the build, ' \
+ 'it is only for rom-o-matic' >> $@
+ @$(ECHO) >> $@
+ @perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
+CLEANUP += $(BIN)/NIC # Doesn't match the $(BIN)/*.* pattern
+
+# Analyse a target name (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and
+# derive the variables:
+#
+# TGT_ELEMENTS : the elements of the target (e.g. "dfe538 prism2_pci")
+# TGT_PREFIX : the prefix type (e.g. "zrom")
+# TGT_DRIVERS : the driver for each element (e.g. "rtl8139 prism2_pci")
+# TGT_ROM_NAME : the ROM name (e.g. "dfe538")
+# TGT_MEDIA : the media type (e.g. "rom")
+#
+DRIVERS_ipxe = $(DRIVERS)
+CARD_DRIVER = $(firstword $(DRIVER_$(1)) $(1))
+TGT_ELEMENTS = $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
+TGT_PREFIX = $(word 2,$(subst ., ,$(notdir $@)))
+TGT_ROM_NAME = $(firstword $(TGT_ELEMENTS))
+TGT_DRIVERS = $(strip $(if $(DRIVERS_$(TGT_ROM_NAME)), \
+ $(DRIVERS_$(TGT_ROM_NAME)), \
+ $(foreach TGT_ELEMENT,$(TGT_ELEMENTS), \
+ $(call CARD_DRIVER,$(TGT_ELEMENT))) ))
+TGT_MEDIA = $(subst z,,$(TGT_PREFIX))
+
+# Look up ROM IDs for the current target
+# (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
+#
+# TGT_PCI_VENDOR : the PCI vendor ID (e.g. "0x1186")
+# TGT_PCI_DEVICE : the PCI device ID (e.g. "0x1300")
+#
+TGT_PCI_VENDOR = $(PCI_VENDOR_$(TGT_ROM_NAME))
+TGT_PCI_DEVICE = $(PCI_DEVICE_$(TGT_ROM_NAME))
+
+# Calculate link-time options for the current target
+# (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
+#
+# TGT_LD_DRIVERS : symbols to require in order to drag in the relevant drivers
+# (e.g. "obj_rtl8139 obj_prism2_pci")
+# TGT_LD_IDS : symbols to define in order to fill in ID structures in the
+# ROM header (e.g."pci_vendor_id=0x1186 pci_device_id=0x1300")
+#
+TGT_LD_DRIVERS = $(subst -,_,$(patsubst %,obj_%,$(TGT_DRIVERS)))
+TGT_LD_IDS = pci_vendor_id=$(firstword $(TGT_PCI_VENDOR) 0) \
+ pci_device_id=$(firstword $(TGT_PCI_DEVICE) 0)
+TGT_LD_ENTRY = _$(TGT_PREFIX)_start
+
+# Calculate linker flags based on link-time options for the current
+# target type (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the
+# variables:
+#
+# TGT_LD_FLAGS : target-specific flags to pass to linker (e.g.
+# "-u obj_zpciprefix -u obj_rtl8139 -u obj_prism2_pci
+# --defsym pci_vendor=0x1186 --defsym pci_device=0x1300")
+#
+TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_ENTRY) $(TGT_LD_DRIVERS) obj_config,\
+ -u $(SYM) --defsym check_$(SYM)=$(SYM) ) \
+ $(patsubst %,--defsym %,$(TGT_LD_IDS)) \
+ -e $(TGT_LD_ENTRY)
+
+# Calculate list of debugging versions of objects to be included in
+# the target.
+#
+DEBUG_LIST = $(subst $(COMMA), ,$(DEBUG))
+DEBUG_OBJ_LEVEL = $(firstword $(word 2,$(subst :, ,$(1))) 1)
+DEBUG_OBJ_BASE = $(word 1,$(subst :, ,$(1))).dbg$(call DEBUG_OBJ_LEVEL,$(1))
+DEBUG_OBJ = $(BIN)/$(call DEBUG_OBJ_BASE,$(1)).o
+DEBUG_ORIG_OBJ = $(BIN)/$(word 1,$(subst :, ,$(1))).o
+DEBUG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))
+DEBUG_ORIG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_ORIG_OBJ,$(D)))
+BLIB_OBJS = $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
+
+# Print out all derived information for a given target.
+#
+$(BIN)/%.info :
+ @$(ECHO) 'Elements : $(TGT_ELEMENTS)'
+ @$(ECHO) 'Prefix : $(TGT_PREFIX)'
+ @$(ECHO) 'Drivers : $(TGT_DRIVERS)'
+ @$(ECHO) 'ROM name : $(TGT_ROM_NAME)'
+ @$(ECHO) 'Media : $(TGT_MEDIA)'
+ @$(ECHO)
+ @$(ECHO) 'PCI vendor : $(TGT_PCI_VENDOR)'
+ @$(ECHO) 'PCI device : $(TGT_PCI_DEVICE)'
+ @$(ECHO)
+ @$(ECHO) 'LD driver symbols : $(TGT_LD_DRIVERS)'
+ @$(ECHO) 'LD ID symbols : $(TGT_LD_IDS)'
+ @$(ECHO) 'LD entry point : $(TGT_LD_ENTRY)'
+ @$(ECHO)
+ @$(ECHO) 'LD target flags : $(TGT_LD_FLAGS)'
+ @$(ECHO)
+ @$(ECHO) 'Debugging objects : $(DEBUG_OBJS)'
+ @$(ECHO) 'Replaced objects : $(DEBUG_ORIG_OBJS)'
+
+# List of objects included in the last build of blib. This is needed
+# in order to correctly rebuild blib whenever the list of objects
+# changes.
+#
+BLIB_LIST := $(BIN)/.blib.list
+ifeq ($(wildcard $(BLIB_LIST)),)
+BLIB_OBJS_OLD :=
+else
+BLIB_OBJS_OLD := $(shell cat $(BLIB_LIST))
+endif
+ifneq ($(BLIB_OBJS_OLD),$(BLIB_OBJS))
+$(shell $(ECHO) "$(BLIB_OBJS)" > $(BLIB_LIST))
+endif
+
+$(BLIB_LIST) :
+
+VERYCLEANUP += $(BLIB_LIST)
+
+# Library of all objects
+#
+BLIB = $(BIN)/blib.a
+$(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
+ $(Q)$(RM) $(BLIB)
+ $(QM)$(ECHO) " [AR] $@"
+ $(Q)$(AR) r $@ $(BLIB_OBJS)
+ $(Q)$(RANLIB) $@
+blib : $(BLIB)
+
+# Command to generate build ID. Must be unique for each $(BIN)/%.tmp,
+# even within the same build run.
+#
+BUILD_ID_CMD := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
+
+# Build an intermediate object file from the objects required for the
+# specified target.
+#
+$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
+ $(QM)$(ECHO) " [LD] $@"
+ $(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
+ --defsym _build_id=`$(BUILD_ID_CMD)` -Map $(BIN)/$*.tmp.map
+ $(Q)$(OBJDUMP) -ht $@ | $(PERL) $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
+
+# Keep intermediate object file (useful for debugging)
+.PRECIOUS : $(BIN)/%.tmp
+
+# Show a linker map for the specified target
+#
+$(BIN)/%.map : $(BIN)/%.tmp
+ @less $(BIN)/$*.tmp.map
+
+# Get objects list for the specified target
+#
+define objs_list
+ $(sort $(foreach OBJ_SYMBOL,\
+ $(filter obj_%,$(shell $(NM) $(1) | cut -d" " -f3)),\
+ $(patsubst obj_%,%,$(OBJ_SYMBOL))))
+endef
+$(BIN)/%.objs : $(BIN)/%.tmp
+ $(Q)$(ECHO) $(call objs_list,$<)
+$(BIN)/%.sizes : $(BIN)/%.tmp
+ $(Q)$(SIZE) -t $(foreach OBJ,$(call objs_list,$<),$(wildcard $(BIN)/$(subst _,?,$(OBJ)).o)) | \
+ sort -g
+
+# Get dependency list for the specified target
+#
+define deps_list
+ $(sort $(foreach OBJ,$(call objs_list,$(1)),$($(OBJ)_DEPS)))
+endef
+$(BIN)/%.deps : $(BIN)/%.tmp
+ $(Q)$(ECHO) $(call deps_list,$<)
+
+# Get unneeded source files for the specified target
+#
+define nodeps_list
+ $(sort $(filter-out $(call deps_list,$(1)),\
+ $(foreach BOBJ,$(BOBJS),\
+ $($(basename $(notdir $(BOBJ)))_DEPS))))
+endef
+$(BIN)/%.nodeps : $(BIN)/%.tmp
+ $(Q)$(ECHO) $(call nodeps_list,$<)
+
+# Get licensing verdict for the specified target
+#
+define licensable_deps_list
+ $(filter-out config/local/%.h,$(call deps_list,$(1)))
+endef
+define unlicensed_deps_list
+ $(shell grep -L FILE_LICENCE $(call licensable_deps_list,$(1)))
+endef
+define licence_list
+ $(patsubst __licence_%,%,\
+ $(filter __licence_%,$(shell $(NM) $(1) | cut -d" " -f3)))
+endef
+$(BIN)/%.licence : $(BIN)/%.tmp
+ $(QM)$(ECHO) " [LICENCE] $@"
+ $(Q)$(if $(strip $(call unlicensed_deps_list,$<)),\
+ echo -n "Unable to determine licence because the following " ;\
+ echo "files are missing a licence declaration:" ;\
+ echo $(call unlicensed_deps_list,$<);\
+ exit 1,\
+ $(PERL) $(LICENCE) $(call licence_list,$<))
+
+# Extract compression information from intermediate object file
+#
+$(BIN)/%.zinfo : $(BIN)/%.tmp
+ $(QM)$(ECHO) " [ZINFO] $@"
+ $(Q)$(OBJCOPY) -O binary -j .zinfo $< $@
+
+# Build raw binary file from intermediate object file
+#
+$(BIN)/%.bin : $(BIN)/%.tmp
+ $(QM)$(ECHO) " [BIN] $@"
+ $(Q)$(OBJCOPY) -O binary -R .zinfo $< $@
+
+# Compress raw binary file
+#
+$(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN)
+ $(QM)$(ECHO) " [ZBIN] $@"
+ $(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@
+
+# Rules for each media format. These are generated and placed in an
+# external Makefile fragment. We could do this via $(eval ...), but
+# that would require make >= 3.80.
+#
+# Note that there's an alternative way to generate most .rom images:
+# they can be copied from their 'master' ROM image using cp and
+# reprocessed with makerom to add the PCI IDs and ident string. The
+# relevant rule would look something like:
+#
+# $(BIN)/dfe538%rom : $(BIN)/rtl8139%rom
+# cat $< $@
+# $(FINALISE_rom)
+#
+# You can derive the ROM/driver relationships using the variables
+# DRIVER_ and/or ROMS_.
+#
+# We don't currently do this, because (a) it would require generating
+# yet more Makefile fragments (since you need a rule for each ROM in
+# ROMS), and (b) the linker is so fast that it probably wouldn't make
+# much difference to the overall build time.
+
+# Add NON_AUTO_MEDIA to the media list, so that they show up in the
+# output of "make"
+#
+MEDIA += $(NON_AUTO_MEDIA)
+
+media :
+ @$(ECHO) $(MEDIA)
+
+AUTO_MEDIA = $(filter-out $(NON_AUTO_MEDIA),$(MEDIA))
+automedia :
+ @$(ECHO) $(AUTO_MEDIA)
+
+# media_template : create Makefile rules for specified media
+#
+# $(1) is the media name (e.g. "rom")
+#
+define media_template
+ @$(ECHO) " [MEDIARULES] $(1)"
+ @$(MKDIR) -p $(BIN)/rules/$(dir $(1))
+ @$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
+ '\n\t$$(QM)$(ECHO) " [FINISH] $$@"' \
+ '\n\t$$(Q)$$(CP) $$< $$@' \
+ '\n\t$$(Q)$$(PAD_$(1))' \
+ '\n\t$$(Q)$$(FINALISE_$(1))' \
+ > $(BIN)/rules/$(1).media.r
+endef
+
+# Rule to generate the Makefile rules to be included
+#
+$(BIN)/rules/%.media.r : $(MAKEDEPS)
+ $(call media_template,$*)
+
+# Calculate and include the list of Makefile rules files
+#
+MEDIA_RULES = $(patsubst %,$(BIN)/rules/%.media.r,$(AUTO_MEDIA))
+mediarules :
+ @$(ECHO) $(MEDIA_RULES)
+ifdef NEED_DEPS
+ifneq ($(MEDIA_RULES),)
+-include $(MEDIA_RULES)
+endif
+endif
+
+# Wrap up binary blobs (for embedded images)
+#
+$(BIN)/%.o : payload/%.img
+ $(QM)echo " [WRAP] $@"
+ $(Q)$(LD) -b binary -r -o $@ $< --undefined obj_payload \
+ --defsym obj_$*=0
+
+BOBJS += $(patsubst payload/%.img,$(BIN)/%.o,$(wildcard payload/*.img))
+
+# The "allXXXs" targets for each suffix
+#
+allall: allroms allmroms allpxes allisos alldsks
+allroms allmroms : all%s : $(foreach ROM,$(ROMS),$(BIN)/$(ROM).%)
+allpxes allisos alldsks : all%s : $(foreach DRIVER,$(DRIVERS),$(BIN)/$(DRIVER).%)
+
+# Alias for ipxe.%
+#
+$(BIN)/etherboot.% : $(BIN)/ipxe.%
+ ln -sf $(notdir $<) $@
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# The compression utilities
+#
+$(NRV2B) : util/nrv2b.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \
+ -DBITSIZE=32 -DENDIAN=0 -o $@ $<
+CLEANUP += $(NRV2B)
+
+$(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -O2 -o $@ $<
+CLEANUP += $(ZBIN)
+
+###############################################################################
+#
+# The EFI image converter
+#
+ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
+ -I$(ZLIB_DIR)/include -idirafter include \
+ -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib -L$(ZLIB_DIR)/lib \
+ -lbfd -ldl -liberty -lz -Wl,--no-warn-search-mismatch
+
+$(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DEFI_TARGET_IA32 -O2 -o $@
+CLEANUP += $(ELF2EFI32)
+
+$(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DEFI_TARGET_X64 -O2 -o $@
+CLEANUP += $(ELF2EFI64)
+
+$(EFIROM) : util/efirom.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(EFIROM)
+
+###############################################################################
+#
+# The ICC fixup utility
+#
+$(ICCFIX) : util/iccfix.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(ICCFIX)
+
+###############################################################################
+#
+# The error usage information utility
+#
+$(EINFO) : util/einfo.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(EINFO)
+
+###############################################################################
+#
+# Local configs
+#
+config/local/%.h :
+ $(Q)touch $@
+
+###############################################################################
+#
+# Auto-incrementing build serial number. Append "bs" to your list of
+# build targets to get a serial number printed at the end of the
+# build. Enable -DBUILD_SERIAL in order to see it when the code runs.
+#
+BUILDSERIAL_H = config/.buildserial.h
+BUILDSERIAL_NOW = config/.buildserial.now
+BUILDSERIAL_NEXT = config/.buildserial.next
+
+$(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
+ $(ECHO) 1 > $@
+
+$(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
+ $(ECHO) '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
+
+ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
+$(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
+ cp -f $(BUILDSERIAL_NEXT) $(BUILDSERIAL_NOW))
+endif
+
+bs : $(BUILDSERIAL_NOW)
+ @$(ECHO) $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
+ @$(ECHO) "Build serial number is $(shell cat $<)"
+
+###############################################################################
+#
+# Build the TAGS file(s) for emacs
+#
+TAGS :
+ ctags -e -R -f $@ --exclude=bin
+
+CLEANUP += TAGS
+
+###############################################################################
+#
+# Force rebuild for any given target
+#
+%.rebuild :
+ rm -f $*
+ $(Q)$(MAKE) $*
+
+###############################################################################
+#
+# Symbol table checks
+#
+
+ifdef BIN
+
+SYMTAB = $(BIN)/symtab
+$(SYMTAB) : $(BLIB)
+ $(OBJDUMP) -w -t $< > $@
+
+CLEANUP += $(BIN)/symtab
+
+symcheck : $(SYMTAB)
+ $(PERL) $(SYMCHECK) $<
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# Build bochs symbol table
+#
+
+ifdef BIN
+
+$(BIN)/%.bxs : $(BIN)/%.tmp
+ $(NM) $< | cut -d" " -f1,3 > $@
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# Documentation
+#
+
+ifdef BIN
+
+$(BIN)/doxygen.cfg : doxygen.cfg $(MAKEDEPS)
+ $(Q)$(PERL) -pe 's{\@SRCDIRS\@}{$(SRCDIRS)}; ' \
+ -e 's{\@INCDIRS\@}{$(filter-out .,$(INCDIRS))}; ' \
+ -e 's{\@BIN\@}{$(BIN)}; ' \
+ -e 's{\@ARCH\@}{$(ARCH)}; ' \
+ $< > $@
+
+$(BIN)/doc : $(BIN)/doxygen.cfg
+ $(Q)$(DOXYGEN) $<
+
+.PHONY : $(BIN)/doc
+
+doc : $(BIN)/doc
+
+doc-clean :
+ $(Q)$(RM) -r $(BIN)/doc
+
+VERYCLEANUP += $(BIN)/doc
+
+docview :
+ @[ -f $(BIN)/doc/html/index.html ] || $(MAKE) $(BIN)/doc
+ @if [ -n "$$BROWSER" ] ; then \
+ ( $$BROWSER $(BIN)/doc/html/index.html & ) ; \
+ else \
+ $(ECHO) "Documentation index in $(BIN)/doc/html/index.html" ; \
+ fi
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# Keyboard maps
+#
+
+hci/keymap/keymap_%.c :
+ $(Q)$(PERL) $(GENKEYMAP) $* > $@
+
+###############################################################################
+#
+# Force deletion of incomplete targets
+#
+
+.DELETE_ON_ERROR :
+
+###############################################################################
+#
+# Clean-up
+#
+clean :
+ $(RM) $(CLEANUP)
+
+veryclean : clean
+ $(RM) -r $(VERYCLEANUP)
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/disable-baddrivers.diff/src/Makefile ipxe-1.0.1~lliurex1505/.pc/disable-baddrivers.diff/src/Makefile
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/disable-baddrivers.diff/src/Makefile 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/disable-baddrivers.diff/src/Makefile 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,179 @@
+###############################################################################
+#
+# Initialise various variables
+#
+
+CLEANUP :=
+CFLAGS :=
+ASFLAGS :=
+LDFLAGS :=
+MAKEDEPS := Makefile
+
+###############################################################################
+#
+# Locations of tools
+#
+HOST_CC := gcc
+RM := rm -f
+TOUCH := touch
+MKDIR := mkdir
+CP := cp
+ECHO := echo
+PRINTF := printf
+PERL := perl
+TRUE := true
+CC := $(CROSS_COMPILE)gcc
+CPP := $(CC) -E
+AS := $(CROSS_COMPILE)as
+LD := $(CROSS_COMPILE)ld
+SIZE := $(CROSS_COMPILE)size
+AR := $(CROSS_COMPILE)ar
+RANLIB := $(CROSS_COMPILE)ranlib
+OBJCOPY := $(CROSS_COMPILE)objcopy
+NM := $(CROSS_COMPILE)nm
+OBJDUMP := $(CROSS_COMPILE)objdump
+PARSEROM := ./util/parserom.pl
+FIXROM := ./util/fixrom.pl
+SYMCHECK := ./util/symcheck.pl
+SORTOBJDUMP := ./util/sortobjdump.pl
+PADIMG := ./util/padimg.pl
+LICENCE := ./util/licence.pl
+NRV2B := ./util/nrv2b
+ZBIN := ./util/zbin
+ELF2EFI32 := ./util/elf2efi32
+ELF2EFI64 := ./util/elf2efi64
+EFIROM := ./util/efirom
+ICCFIX := ./util/iccfix
+EINFO := ./util/einfo
+GENKEYMAP := ./util/genkeymap.pl
+DOXYGEN := doxygen
+BINUTILS_DIR := /usr
+BFD_DIR := $(BINUTILS_DIR)
+ZLIB_DIR := /usr
+
+###############################################################################
+#
+# SRCDIRS lists all directories containing source files.
+#
+SRCDIRS :=
+SRCDIRS += libgcc
+SRCDIRS += core
+SRCDIRS += net net/tcp net/udp net/infiniband net/80211
+SRCDIRS += image
+SRCDIRS += drivers/bus
+SRCDIRS += drivers/net
+SRCDIRS += drivers/net/e1000
+SRCDIRS += drivers/net/e1000e
+SRCDIRS += drivers/net/igb
+SRCDIRS += drivers/net/igbvf
+SRCDIRS += drivers/net/phantom
+SRCDIRS += drivers/net/rtl818x
+SRCDIRS += drivers/net/ath
+SRCDIRS += drivers/net/ath/ath5k
+SRCDIRS += drivers/net/ath/ath9k
+SRCDIRS += drivers/net/vxge
+SRCDIRS += drivers/net/efi
+SRCDIRS += drivers/block
+SRCDIRS += drivers/nvs
+SRCDIRS += drivers/bitbash
+SRCDIRS += drivers/infiniband
+SRCDIRS += interface/pxe interface/efi interface/smbios
+SRCDIRS += interface/bofm
+SRCDIRS += tests
+SRCDIRS += crypto crypto/axtls crypto/matrixssl
+SRCDIRS += hci hci/commands hci/tui
+SRCDIRS += hci/mucurses hci/mucurses/widgets
+SRCDIRS += hci/keymap
+SRCDIRS += usr
+SRCDIRS += config
+
+# NON_AUTO_SRCS lists files that are excluded from the normal
+# automatic build system.
+#
+NON_AUTO_SRCS :=
+NON_AUTO_SRCS += drivers/net/prism2.c
+
+# INCDIRS lists the include path
+#
+INCDIRS :=
+INCDIRS += include .
+
+###############################################################################
+#
+# Default build target: build the most common targets and print out a
+# helpfully suggestive message
+#
+ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
+ bin/ipxe.usb bin/undionly.kpxe bin/rtl8139.rom
+all : $(ALL)
+ @$(ECHO) '==========================================================='
+ @$(ECHO)
+ @$(ECHO) 'To create a bootable floppy, type'
+ @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
+ @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
+ @$(ECHO) 'data already on the disk.'
+ @$(ECHO)
+ @$(ECHO) 'To create a bootable USB key, type'
+ @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
+ @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
+ @$(ECHO) 'disk on your system. This will erase any data already on'
+ @$(ECHO) 'the USB key.'
+ @$(ECHO)
+ @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
+ @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
+ @$(ECHO)
+ @$(ECHO) 'These images contain drivers for all supported cards. You'
+ @$(ECHO) 'can build more customised images, and ROM images, using'
+ @$(ECHO) ' make bin/.'
+ @$(ECHO)
+ @$(ECHO) '==========================================================='
+
+###############################################################################
+#
+# Comprehensive build target: build a selection of cross-platform
+# targets to expose potential build errors that show up only on
+# certain platforms
+#
+everything :
+ $(Q)$(MAKE) --no-print-directory $(ALL) \
+ bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
+ bin-i386-efi/ipxe.efirom \
+ bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
+ bin-x86_64-efi/ipxe.efirom \
+ bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux
+
+###############################################################################
+#
+# Build targets that do nothing but might be tried by users
+#
+configure :
+ @$(ECHO) "No configuration needed."
+
+install :
+ @$(ECHO) "No installation required."
+
+###############################################################################
+#
+# Version number calculations
+#
+VERSION_MAJOR = 1
+VERSION_MINOR = 0
+VERSION_PATCH = 0
+EXTRAVERSION = +
+MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
+VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
+CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
+ -DVERSION_MINOR=$(VERSION_MINOR) \
+ -DVERSION_PATCH=$(VERSION_PATCH) \
+ -DVERSION=\"$(VERSION)\"
+IDENT = '$(@F) $(VERSION) (GPL) ipxe.org'
+version :
+ @$(ECHO) $(VERSION)
+
+###############################################################################
+#
+# Drag in the bulk of the build system
+#
+
+MAKEDEPS += Makefile.housekeeping
+include Makefile.housekeeping
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/qemu-target.diff/src/Makefile.housekeeping ipxe-1.0.1~lliurex1505/.pc/qemu-target.diff/src/Makefile.housekeeping
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/qemu-target.diff/src/Makefile.housekeeping 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/qemu-target.diff/src/Makefile.housekeeping 2015-04-14 12:54:27.000000000 +0000
@@ -0,0 +1,1154 @@
+# -*- makefile -*- : Force emacs to use Makefile mode
+#
+# This file contains various boring housekeeping functions that would
+# otherwise seriously clutter up the main Makefile.
+
+###############################################################################
+#
+# Find a usable "echo -e" substitute.
+#
+TAB := $(shell $(PRINTF) '\t')
+ECHO_E_ECHO := $(ECHO)
+ECHO_E_ECHO_E := $(ECHO) -e
+ECHO_E_BIN_ECHO := /bin/echo
+ECHO_E_BIN_ECHO_E := /bin/echo -e
+ECHO_E_ECHO_TAB := $(shell $(ECHO_E_ECHO) '\t' | cat)
+ECHO_E_ECHO_E_TAB := $(shell $(ECHO_E_ECHO_E) '\t' | cat)
+ECHO_E_BIN_ECHO_TAB := $(shell $(ECHO_E_BIN_ECHO) '\t')
+ECHO_E_BIN_ECHO_E_TAB := $(shell $(ECHO_E_BIN_ECHO_E) '\t')
+
+ifeq ($(ECHO_E_ECHO_TAB),$(TAB))
+ECHO_E := $(ECHO_E_ECHO)
+endif
+ifeq ($(ECHO_E_ECHO_E_TAB),$(TAB))
+ECHO_E := $(ECHO_E_ECHO_E)
+endif
+ifeq ($(ECHO_E_BIN_ECHO_TAB),$(TAB))
+ECHO_E := $(ECHO_E_BIN_ECHO)
+endif
+ifeq ($(ECHO_E_BIN_ECHO_E_TAB),$(TAB))
+ECHO_E := $(ECHO_E_BIN_ECHO_E)
+endif
+
+.echocheck :
+ifdef ECHO_E
+ @$(TOUCH) $@
+else
+ @$(PRINTF) '%24s : x%sx\n' 'tab' '$(TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO) \t"' \
+ '$(ECHO_E_ECHO_TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO_E) \t"' \
+ '$(ECHO_E_ECHO_E_TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO) \t"' \
+ '$(ECHO_E_BIN_ECHO_TAB)'
+ @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO_E) \t"' \
+ '$(ECHO_E_BIN_ECHO_E_TAB)'
+ @$(ECHO) "No usable \"echo -e\" substitute found"
+ @exit 1
+endif
+MAKEDEPS += .echocheck
+VERYCLEANUP += .echocheck
+
+echo :
+ @$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
+
+###############################################################################
+#
+# Generate a usable "seq" substitute
+#
+define seq
+ $(shell awk 'BEGIN { for ( i = $(1) ; i <= $(2) ; i++ ) print i }')
+endef
+
+###############################################################################
+#
+# Determine host OS
+#
+HOST_OS := $(shell uname -s)
+hostos :
+ @$(ECHO) $(HOST_OS)
+
+###############################################################################
+#
+# Determine compiler
+
+CCDEFS := $(shell $(CC) -E -x c -c /dev/null -dM | cut -d" " -f2)
+ccdefs:
+ @$(ECHO) $(CCDEFS)
+
+ifeq ($(filter __ICC,$(CCDEFS)),__ICC)
+CCTYPE := icc
+else
+CCTYPE := gcc
+endif
+cctype:
+ @$(ECHO) $(CCTYPE)
+
+###############################################################################
+#
+# Check for tools that can cause failed builds
+#
+
+ifeq ($(CCTYPE),gcc)
+GCC_2_96_BANNER := $(shell $(CC) -v 2>&1 | grep -is 'gcc version 2\.96')
+ifneq ($(GCC_2_96_BANNER),)
+$(warning gcc 2.96 is unsuitable for compiling iPXE)
+$(warning Use gcc 2.95 or a newer version instead)
+$(error Unsuitable build environment found)
+endif
+endif
+
+PERL_UNICODE_CHECK := $(shell $(PERL) -e 'use bytes; print chr(255)' | wc -c)
+ifeq ($(PERL_UNICODE_CHECK),2)
+$(warning Your Perl version has a Unicode handling bug)
+$(warning Execute this command before building iPXE:)
+$(warning export LANG=$${LANG%.UTF-8})
+$(error Unsuitable build environment found)
+endif
+
+LD_GOLD_BANNER := $(shell $(LD) -v 2>&1 | grep 'GNU gold')
+ifneq ($(LD_GOLD_BANNER),)
+$(warning GNU gold is unsuitable for building iPXE)
+$(warning Use GNU ld instead)
+$(error Unsuitable build environment found)
+endif
+
+###############################################################################
+#
+# Check for various tool workarounds
+#
+
+WORKAROUND_CFLAGS :=
+WORKAROUND_ASFLAGS :=
+WORKAROUND_LDFLAGS :=
+
+# Make syntax does not allow use of comma or space in certain places.
+# This ugly workaround is suggested in the manual.
+#
+COMMA := ,
+EMPTY :=
+SPACE := $(EMPTY) $(EMPTY)
+
+# Check for an old version of gas (binutils 2.9.1)
+#
+OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
+WORKAROUND_CFLAGS += $(OLDGAS)
+oldgas :
+ @$(ECHO) $(oldgas)
+
+# Some widespread patched versions of gcc include -fstack-protector by
+# default, even when -ffreestanding is specified. We therefore need
+# to disable -fstack-protector if the compiler supports it.
+#
+ifeq ($(CCTYPE),gcc)
+SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
+ -o /dev/null >/dev/null 2>&1
+SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
+WORKAROUND_CFLAGS += $(SP_FLAGS)
+endif
+
+# Some widespread patched versions of gcc include -fPIE -Wl,-pie by
+# default. Note that gcc will exit *successfully* if it fails to
+# recognise an option that starts with "no", so we have to test for
+# output on stderr instead of checking the exit status.
+#
+ifeq ($(CCTYPE),gcc)
+PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
+PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
+WORKAROUND_CFLAGS += $(PIE_FLAGS)
+endif
+
+# gcc 4.4 generates .eh_frame sections by default, which distort the
+# output of "size". Inhibit this.
+#
+ifeq ($(CCTYPE),gcc)
+CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
+ -o /dev/null >/dev/null 2>&1
+CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
+WORKAROUND_CFLAGS += $(CFI_FLAGS)
+endif
+
+# gcc 4.6 generates spurious warnings if -Waddress is in force.
+# Inhibit this.
+#
+ifeq ($(CCTYPE),gcc)
+WNA_TEST = $(CC) -Wno-address -x c -c /dev/null -o /dev/null >/dev/null 2>&1
+WNA_FLAGS := $(shell $(WNA_TEST) && $(ECHO) '-Wno-address')
+WORKAROUND_CFLAGS += $(WNA_FLAGS)
+endif
+
+# Some versions of gas choke on division operators, treating them as
+# comment markers. Specifying --divide will work around this problem,
+# but isn't available on older gas versions.
+#
+DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
+DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
+WORKAROUND_ASFLAGS += $(DIVIDE_FLAGS)
+
+###############################################################################
+#
+# Build verbosity
+#
+ifeq ($(V),1)
+Q :=
+QM := @\#
+else
+Q := @
+QM := @
+endif
+
+###############################################################################
+#
+# Set BIN according to whatever was specified on the command line as
+# the build target.
+#
+
+# Determine how many different BIN directories are mentioned in the
+# make goals.
+#
+BIN_GOALS := $(filter bin/% bin-%,$(MAKECMDGOALS))
+BIN_GOALS_BINS := $(sort $(foreach BG,$(BIN_GOALS),\
+ $(firstword $(subst /, ,$(BG)))))
+NUM_BINS := $(words $(BIN_GOALS_BINS))
+
+ifeq ($(NUM_BINS),0)
+
+# No BIN directory was specified. Set BIN to "bin" as a sensible
+# default.
+
+BIN := bin
+
+else # NUM_BINS == 0
+
+ifeq ($(NUM_BINS),1)
+
+# If exactly one BIN directory was specified, set BIN to match this
+# directory.
+#
+BIN := $(firstword $(BIN_GOALS_BINS))
+
+else # NUM_BINS == 1
+
+# More than one BIN directory was specified. We cannot handle the
+# latter case within a single make invocation, so set up recursive
+# targets for each BIN directory. Use exactly one target for each BIN
+# directory since running multiple make invocations within the same
+# BIN directory is likely to cause problems.
+#
+# Leave $(BIN) undefined. This has implications for any target that
+# depends on $(BIN); such targets should be made conditional upon the
+# existence of $(BIN).
+#
+BIN_GOALS_FIRST := $(foreach BGB,$(BIN_GOALS_BINS),\
+ $(firstword $(filter $(BGB)/%,$(BIN_GOALS))))
+BIN_GOALS_OTHER := $(filter-out $(BIN_GOALS_FIRST),$(BIN_GOALS))
+
+$(BIN_GOALS_FIRST) : % : BIN_RECURSE
+ $(Q)$(MAKE) --no-print-directory BIN=$(firstword $(subst /, ,$@)) \
+ $(filter $(firstword $(subst /, ,$@))/%, $(BIN_GOALS))
+$(BIN_GOALS_OTHER) : % : BIN_RECURSE
+ $(Q)$(TRUE)
+.PHONY : BIN_RECURSE
+
+endif # NUM_BINS == 1
+endif # NUM_BINS == 0
+
+ifdef BIN
+
+# Create $(BIN) directory if it doesn't exist yet
+#
+ifeq ($(wildcard $(BIN)),)
+$(shell $(MKDIR) -p $(BIN))
+endif
+
+# Target to allow e.g. "make bin-efi arch"
+#
+$(BIN) :
+ @# Do nothing, silently
+.PHONY : $(BIN)
+
+# Remove everything in $(BIN) for a "make clean"
+#
+CLEANUP += $(BIN)/*.* # Avoid picking up directories
+
+endif # defined(BIN)
+
+# Determine whether or not we need to include the dependency files
+#
+NO_DEP_TARGETS := $(BIN) clean veryclean
+ifeq ($(MAKECMDGOALS),)
+NEED_DEPS := 1
+endif
+ifneq ($(strip $(filter-out $(NO_DEP_TARGETS),$(MAKECMDGOALS))),)
+NEED_DEPS := 1
+endif
+
+###############################################################################
+#
+# Select build architecture and platform based on $(BIN)
+#
+# BIN has the form bin[-[arch-]platform]
+
+ARCHS := $(patsubst arch/%,%,$(wildcard arch/*))
+PLATFORMS := $(patsubst config/defaults/%.h,%,\
+ $(wildcard config/defaults/*.h))
+archs :
+ @$(ECHO) $(ARCHS)
+
+platforms :
+ @$(ECHO) $(PLATFORMS)
+
+ifdef BIN
+
+# Determine architecture portion of $(BIN), if present
+BIN_ARCH := $(strip $(foreach A,$(ARCHS),\
+ $(patsubst bin-$(A)-%,$(A),\
+ $(filter bin-$(A)-%,$(BIN)))))
+
+# Determine platform portion of $(BIN), if present
+ifeq ($(BIN_ARCH),)
+BIN_PLATFORM := $(patsubst bin-%,%,$(filter bin-%,$(BIN)))
+else
+BIN_PLATFORM := $(patsubst bin-$(BIN_ARCH)-%,%,$(BIN))
+endif
+
+# Determine build architecture
+DEFAULT_ARCH := i386
+ARCH := $(firstword $(BIN_ARCH) $(DEFAULT_ARCH))
+CFLAGS += -DARCH=$(ARCH)
+arch :
+ @$(ECHO) $(ARCH)
+.PHONY : arch
+
+# Determine build platform
+DEFAULT_PLATFORM := pcbios
+PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM))
+CFLAGS += -DPLATFORM=$(PLATFORM)
+platform :
+ @$(ECHO) $(PLATFORM)
+
+endif # defined(BIN)
+
+# Include architecture-specific Makefile
+ifdef ARCH
+MAKEDEPS += arch/$(ARCH)/Makefile
+include arch/$(ARCH)/Makefile
+endif
+
+# Include architecture-specific include path
+ifdef ARCH
+INCDIRS += arch/$(ARCH)/include
+INCDIRS += arch/$(ARCH)/include/$(PLATFORM)
+endif
+
+###############################################################################
+#
+# Source file handling
+
+# SRCDIRS lists all directories containing source files.
+srcdirs :
+ @$(ECHO) $(SRCDIRS)
+
+# SRCS lists all .c or .S files found in any SRCDIR
+#
+SRCS += $(wildcard $(patsubst %,%/*.c,$(SRCDIRS)))
+SRCS += $(wildcard $(patsubst %,%/*.S,$(SRCDIRS)))
+srcs :
+ @$(ECHO) $(SRCS)
+
+# AUTO_SRCS lists all files in SRCS that are not mentioned in
+# NON_AUTO_SRCS. Files should be added to NON_AUTO_SRCS if they
+# cannot be built using the standard build template.
+#
+AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS))
+autosrcs :
+ @$(ECHO) $(AUTO_SRCS)
+
+# Just about everything else in this section depends upon having
+# $(BIN) set
+
+ifdef BIN
+
+# INCDIRS lists the include path
+incdirs :
+ @$(ECHO) $(INCDIRS)
+
+# Common flags
+#
+CFLAGS += $(foreach INC,$(INCDIRS),-I$(INC))
+CFLAGS += -Os
+CFLAGS += -g
+ifeq ($(CCTYPE),gcc)
+CFLAGS += -ffreestanding
+CFLAGS += -Wall -W -Wformat-nonliteral
+endif
+ifeq ($(CCTYPE),icc)
+CFLAGS += -fno-builtin
+CFLAGS += -no-ip
+CFLAGS += -no-gcc
+CFLAGS += -diag-disable 111 # Unreachable code
+CFLAGS += -diag-disable 128 # Unreachable loop
+CFLAGS += -diag-disable 170 # Array boundary checks
+CFLAGS += -diag-disable 177 # Unused functions
+CFLAGS += -diag-disable 181 # printf() format checks
+CFLAGS += -diag-disable 188 # enum strictness
+CFLAGS += -diag-disable 193 # Undefined preprocessor identifiers
+CFLAGS += -diag-disable 280 # switch ( constant )
+CFLAGS += -diag-disable 310 # K&R parameter lists
+CFLAGS += -diag-disable 424 # Extra semicolon
+CFLAGS += -diag-disable 589 # Declarations mid-code
+CFLAGS += -diag-disable 593 # Unused variables
+CFLAGS += -diag-disable 810 # Casting ints to smaller ints
+CFLAGS += -diag-disable 981 # Sequence point violations
+CFLAGS += -diag-disable 1292 # Ignored attributes
+CFLAGS += -diag-disable 1338 # void pointer arithmetic
+CFLAGS += -diag-disable 1361 # Variable-length arrays
+CFLAGS += -diag-disable 1418 # Missing prototypes
+CFLAGS += -diag-disable 1419 # Missing prototypes
+CFLAGS += -diag-disable 1599 # Hidden variables
+CFLAGS += -Wall -Wmissing-declarations
+endif
+CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
+ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
+LDFLAGS += $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
+
+# Inhibit -Werror if NO_WERROR is specified on make command line
+#
+ifneq ($(NO_WERROR),1)
+CFLAGS += -Werror
+ASFLAGS += --fatal-warnings
+endif
+
+# Function trace recorder state in the last build. This is needed
+# in order to correctly rebuild whenever the function recorder is
+# enabled/disabled.
+#
+FNREC_STATE := $(BIN)/.fnrec.state
+ifeq ($(wildcard $(FNREC_STATE)),)
+FNREC_OLD :=
+else
+FNREC_OLD := $(shell cat $(FNREC_STATE))
+endif
+ifeq ($(FNREC_OLD),$(FNREC))
+$(FNREC_STATE) :
+else
+$(FNREC_STATE) : clean
+$(shell $(ECHO) "$(FNREC)" > $(FNREC_STATE))
+endif
+
+VERYCLEANUP += $(FNREC_STATE)
+MAKEDEPS += $(FNREC_STATE)
+
+ifeq ($(FNREC),1)
+# Enabling -finstrument-functions affects gcc's analysis and leads to spurious
+# warnings about use of uninitialised variables.
+#
+CFLAGS += -Wno-uninitialized
+CFLAGS += -finstrument-functions
+CFLAGS += -finstrument-functions-exclude-file-list=core/fnrec.c
+endif
+
+# Enable per-item sections and section garbage collection. Note that
+# some older versions of gcc support -fdata-sections but treat it as
+# implying -fno-common, which would break our build. Some other older
+# versions issue a spurious and uninhibitable warning if
+# -ffunction-sections is used with -g, which would also break our
+# build since we use -Werror.
+#
+ifeq ($(CCTYPE),gcc)
+DS_TEST = $(ECHO) 'char x;' | \
+ $(CC) -fdata-sections -S -x c - -o - 2>/dev/null | \
+ grep -E '\.comm' > /dev/null
+DS_FLAGS := $(shell $(DS_TEST) && $(ECHO) '-fdata-sections')
+FS_TEST = $(CC) -ffunction-sections -g -c -x c /dev/null \
+ -o /dev/null 2>/dev/null
+FS_FLAGS := $(shell $(FS_TEST) && $(ECHO) '-ffunction-sections')
+CFLAGS += $(FS_FLAGS) $(DS_FLAGS)
+endif
+LDFLAGS += --gc-sections
+
+# compiler.h is needed for our linking and debugging system
+#
+CFLAGS += -include compiler.h
+
+# CFLAGS for specific object types
+#
+CFLAGS_c +=
+CFLAGS_S += -DASSEMBLY
+
+# Base object name of the current target
+#
+OBJECT = $(firstword $(subst ., ,$(@F)))
+
+# CFLAGS for specific object files. You can define
+# e.g. CFLAGS_rtl8139, and have those flags automatically used when
+# compiling bin/rtl8139.o.
+#
+OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
+$(BIN)/%.flags :
+ @$(ECHO) $(OBJ_CFLAGS)
+
+# ICC requires postprocessing objects to fix up table alignments
+#
+ifeq ($(CCTYPE),icc)
+POST_O = && $(ICCFIX) $@
+POST_O_DEPS := $(ICCFIX)
+else
+POST_O :=
+POST_O_DEPS :=
+endif
+
+# Rules for specific object types.
+#
+COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
+RULE_c = $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
+RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(subst -,_,$(OBJECT))=$* -c $< -o $@ $(POST_O)
+RULE_c_to_c = $(Q)$(COMPILE_c) -E -c $< > $@
+RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
+
+PREPROCESS_S = $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
+ASSEMBLE_S = $(AS) $(ASFLAGS)
+RULE_S = $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
+RULE_S_to_dbg%.o = $(Q)$(PREPROCESS_S) -Ddebug_$(subst -,_,$(OBJECT))=$* $< | $(ASSEMBLE_S) -o $@
+RULE_S_to_s = $(Q)$(PREPROCESS_S) $< > $@
+
+DEBUG_TARGETS += dbg%.o c s
+
+# We automatically generate rules for any file mentioned in AUTO_SRCS
+# using the following set of templates. It would be cleaner to use
+# $(eval ...), but this function exists only in GNU make >= 3.80.
+
+# deps_template : generate dependency list for a given source file
+#
+# $(1) is the full path to the source file (e.g. "drivers/net/rtl8139.c")
+# $(2) is the source type (e.g. "c")
+# $(3) is the source base name (e.g. "rtl8139")
+#
+define deps_template
+ @$(ECHO) " [DEPS] $(1)"
+ @$(MKDIR) -p $(BIN)/deps/$(dir $(1))
+ @$(CPP) $(CFLAGS) $(CFLAGS_$(2)) $(CFLAGS_$(3)) -DOBJECT=$(3) \
+ -Wno-error -M $(1) -MG -MP | \
+ sed 's/\.o\s*:/_DEPS =/' > $(BIN)/deps/$(1).d
+endef
+
+# rules_template : generate rules for a given source file
+#
+# $(1) is the full path to the source file (e.g. "drivers/net/rtl8139.c")
+# $(2) is the source type (e.g. "c")
+# $(3) is the source base name (e.g. "rtl8139")
+#
+define rules_template
+ @$(ECHO) " [RULES] $(1)"
+ @$(MKDIR) -p $(BIN)/rules/$(dir $(1))
+ @$(ECHO_E) '\n$$(BIN)/$(3).o :' \
+ '$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(3)_DEPS)' \
+ '\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
+ '\n\t$$(RULE_$(2))\n' \
+ '\nBOBJS += $$(BIN)/$(3).o\n' \
+ $(foreach TGT,$(DEBUG_TARGETS), \
+ $(if $(RULE_$(2)_to_$(TGT)), \
+ '\n$$(BIN)/$(3).$(TGT) :' \
+ '$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(3)_DEPS)' \
+ '\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
+ '\n\t$$(RULE_$(2)_to_$(TGT))\n' \
+ '\n$(TGT)_OBJS += $$(BIN)/$(3).$(TGT)\n' ) ) \
+ '\n$(BIN)/deps/$(1).d : $$($(3)_DEPS)\n' \
+ '\nTAGS : $$($(3)_DEPS)\n' > $(BIN)/rules/$(1).r
+ @$(if $(findstring drivers/,$(1)),\
+ $(PERL) $(PARSEROM) $(1) >> $(BIN)/rules/$(1).r)
+endef
+
+# Rule to generate the dependency list file
+#
+$(BIN)/deps/%.d : % $(MAKEDEPS)
+ $(call deps_template,$<,$(subst .,,$(suffix $<)),$(basename $(notdir $<)))
+
+# Calculate and include the list of dependency list files
+#
+AUTO_DEPS = $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS))
+ifdef NEED_DEPS
+ifneq ($(AUTO_DEPS),)
+-include $(AUTO_DEPS)
+endif
+endif
+autodeps :
+ @$(ECHO) $(AUTO_DEPS)
+VERYCLEANUP += $(BIN)/deps
+
+# Rule to generate the rules file
+#
+$(BIN)/rules/%.r : % $(MAKEDEPS) $(PARSEROM)
+ $(call rules_template,$<,$(subst .,,$(suffix $<)),$(basename $(notdir $<)))
+
+# Calculate and include the list of rules files
+#
+AUTO_RULES = $(patsubst %,$(BIN)/rules/%.r,$(AUTO_SRCS))
+ifdef NEED_DEPS
+ifneq ($(AUTO_RULES),)
+-include $(AUTO_RULES)
+endif
+endif
+autorules :
+ @$(ECHO) $(AUTO_RULES)
+VERYCLEANUP += $(BIN)/rules
+
+# The following variables are created by the rules files
+#
+bobjs :
+ @$(ECHO) $(BOBJS)
+drivers :
+ @$(ECHO) $(DRIVERS)
+.PHONY : drivers
+roms :
+ @$(ECHO) $(ROMS)
+
+# List of embedded images included in the last build of embedded.o.
+# This is needed in order to correctly rebuild embedded.o whenever the
+# list of objects changes.
+#
+EMBED := $(EMBEDDED_IMAGE) # Maintain backwards compatibility
+EMBEDDED_LIST := $(BIN)/.embedded.list
+ifeq ($(wildcard $(EMBEDDED_LIST)),)
+EMBED_OLD :=
+else
+EMBED_OLD := $(shell cat $(EMBEDDED_LIST))
+endif
+ifneq ($(EMBED_OLD),$(EMBED))
+$(shell $(ECHO) "$(EMBED)" > $(EMBEDDED_LIST))
+endif
+
+$(EMBEDDED_LIST) :
+
+VERYCLEANUP += $(EMBEDDED_LIST)
+
+EMBEDDED_FILES := $(subst $(COMMA), ,$(EMBED))
+EMBED_ALL := $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\
+ EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
+ \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
+
+$(BIN)/embedded.o : $(EMBEDDED_FILES) $(EMBEDDED_LIST)
+
+# This file uses .incbin inline assembly to include a binary file.
+# Unfortunately ccache does not detect this dependency and caches builds even
+# when the binary file has changed.
+#
+$(BIN)/embedded.o : override CC := env CCACHE_DISABLE=1 $(CC)
+
+CFLAGS_embedded = -DEMBED_ALL="$(EMBED_ALL)"
+
+# Generate error usage information
+#
+$(BIN)/%.einfo : $(BIN)/%.o
+ $(QM)$(ECHO) " [EINFO] $@"
+ $(Q)$(OBJCOPY) -O binary -j .einfo --set-section-flags .einfo=alloc \
+ $< $@
+
+EINFOS := $(patsubst $(BIN)/%.o,$(BIN)/%.einfo,$(BOBJS))
+$(BIN)/errors : $(EINFOS) $(EINFO)
+ $(QM)$(ECHO) " [EINFO] $@"
+ $(Q)$(EINFO) $(EINFOS) | sort > $@
+CLEANUP += $(BIN)/errors # Doesn't match the $(BIN)/*.* pattern
+
+# Generate the NIC file from the parsed source files. The NIC file is
+# only for rom-o-matic.
+#
+$(BIN)/NIC : $(AUTO_DEPS)
+ @$(ECHO) '# This is an automatically generated file, do not edit' > $@
+ @$(ECHO) '# It does not affect anything in the build, ' \
+ 'it is only for rom-o-matic' >> $@
+ @$(ECHO) >> $@
+ @perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
+CLEANUP += $(BIN)/NIC # Doesn't match the $(BIN)/*.* pattern
+
+# Analyse a target name (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and
+# derive the variables:
+#
+# TGT_ELEMENTS : the elements of the target (e.g. "dfe538 prism2_pci")
+# TGT_PREFIX : the prefix type (e.g. "zrom")
+# TGT_DRIVERS : the driver for each element (e.g. "rtl8139 prism2_pci")
+# TGT_ROM_NAME : the ROM name (e.g. "dfe538")
+# TGT_MEDIA : the media type (e.g. "rom")
+#
+DRIVERS_ipxe = $(DRIVERS)
+CARD_DRIVER = $(firstword $(DRIVER_$(1)) $(1))
+TGT_ELEMENTS = $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
+TGT_PREFIX = $(word 2,$(subst ., ,$(notdir $@)))
+TGT_ROM_NAME = $(firstword $(TGT_ELEMENTS))
+TGT_DRIVERS = $(strip $(if $(DRIVERS_$(TGT_ROM_NAME)), \
+ $(DRIVERS_$(TGT_ROM_NAME)), \
+ $(foreach TGT_ELEMENT,$(TGT_ELEMENTS), \
+ $(call CARD_DRIVER,$(TGT_ELEMENT))) ))
+TGT_MEDIA = $(subst z,,$(TGT_PREFIX))
+
+# Look up ROM IDs for the current target
+# (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
+#
+# TGT_PCI_VENDOR : the PCI vendor ID (e.g. "0x1186")
+# TGT_PCI_DEVICE : the PCI device ID (e.g. "0x1300")
+#
+TGT_PCI_VENDOR = $(PCI_VENDOR_$(TGT_ROM_NAME))
+TGT_PCI_DEVICE = $(PCI_DEVICE_$(TGT_ROM_NAME))
+
+# Calculate link-time options for the current target
+# (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
+#
+# TGT_LD_DRIVERS : symbols to require in order to drag in the relevant drivers
+# (e.g. "obj_rtl8139 obj_prism2_pci")
+# TGT_LD_IDS : symbols to define in order to fill in ID structures in the
+# ROM header (e.g."pci_vendor_id=0x1186 pci_device_id=0x1300")
+#
+TGT_LD_DRIVERS = $(subst -,_,$(patsubst %,obj_%,$(TGT_DRIVERS)))
+TGT_LD_IDS = pci_vendor_id=$(firstword $(TGT_PCI_VENDOR) 0) \
+ pci_device_id=$(firstword $(TGT_PCI_DEVICE) 0)
+TGT_LD_ENTRY = _$(TGT_PREFIX)_start
+
+# Calculate linker flags based on link-time options for the current
+# target type (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the
+# variables:
+#
+# TGT_LD_FLAGS : target-specific flags to pass to linker (e.g.
+# "-u obj_zpciprefix -u obj_rtl8139 -u obj_prism2_pci
+# --defsym pci_vendor=0x1186 --defsym pci_device=0x1300")
+#
+TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_ENTRY) $(TGT_LD_DRIVERS) obj_config,\
+ -u $(SYM) --defsym check_$(SYM)=$(SYM) ) \
+ $(patsubst %,--defsym %,$(TGT_LD_IDS)) \
+ -e $(TGT_LD_ENTRY)
+
+# Calculate list of debugging versions of objects to be included in
+# the target.
+#
+DEBUG_LIST = $(subst $(COMMA), ,$(DEBUG))
+DEBUG_OBJ_LEVEL = $(firstword $(word 2,$(subst :, ,$(1))) 1)
+DEBUG_OBJ_BASE = $(word 1,$(subst :, ,$(1))).dbg$(call DEBUG_OBJ_LEVEL,$(1))
+DEBUG_OBJ = $(BIN)/$(call DEBUG_OBJ_BASE,$(1)).o
+DEBUG_ORIG_OBJ = $(BIN)/$(word 1,$(subst :, ,$(1))).o
+DEBUG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))
+DEBUG_ORIG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_ORIG_OBJ,$(D)))
+BLIB_OBJS = $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
+
+# Print out all derived information for a given target.
+#
+$(BIN)/%.info :
+ @$(ECHO) 'Elements : $(TGT_ELEMENTS)'
+ @$(ECHO) 'Prefix : $(TGT_PREFIX)'
+ @$(ECHO) 'Drivers : $(TGT_DRIVERS)'
+ @$(ECHO) 'ROM name : $(TGT_ROM_NAME)'
+ @$(ECHO) 'Media : $(TGT_MEDIA)'
+ @$(ECHO)
+ @$(ECHO) 'PCI vendor : $(TGT_PCI_VENDOR)'
+ @$(ECHO) 'PCI device : $(TGT_PCI_DEVICE)'
+ @$(ECHO)
+ @$(ECHO) 'LD driver symbols : $(TGT_LD_DRIVERS)'
+ @$(ECHO) 'LD ID symbols : $(TGT_LD_IDS)'
+ @$(ECHO) 'LD entry point : $(TGT_LD_ENTRY)'
+ @$(ECHO)
+ @$(ECHO) 'LD target flags : $(TGT_LD_FLAGS)'
+ @$(ECHO)
+ @$(ECHO) 'Debugging objects : $(DEBUG_OBJS)'
+ @$(ECHO) 'Replaced objects : $(DEBUG_ORIG_OBJS)'
+
+# List of objects included in the last build of blib. This is needed
+# in order to correctly rebuild blib whenever the list of objects
+# changes.
+#
+BLIB_LIST := $(BIN)/.blib.list
+ifeq ($(wildcard $(BLIB_LIST)),)
+BLIB_OBJS_OLD :=
+else
+BLIB_OBJS_OLD := $(shell cat $(BLIB_LIST))
+endif
+ifneq ($(BLIB_OBJS_OLD),$(BLIB_OBJS))
+$(shell $(ECHO) "$(BLIB_OBJS)" > $(BLIB_LIST))
+endif
+
+$(BLIB_LIST) :
+
+VERYCLEANUP += $(BLIB_LIST)
+
+# Library of all objects
+#
+BLIB = $(BIN)/blib.a
+$(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
+ $(Q)$(RM) $(BLIB)
+ $(QM)$(ECHO) " [AR] $@"
+ $(Q)$(AR) r $@ $(BLIB_OBJS)
+ $(Q)$(RANLIB) $@
+blib : $(BLIB)
+
+# Command to generate build ID. Must be unique for each $(BIN)/%.tmp,
+# even within the same build run.
+#
+BUILD_ID_CMD := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
+
+# Build an intermediate object file from the objects required for the
+# specified target.
+#
+$(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
+ $(QM)$(ECHO) " [LD] $@"
+ $(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
+ --defsym _build_id=`$(BUILD_ID_CMD)` -Map $(BIN)/$*.tmp.map
+ $(Q)$(OBJDUMP) -ht $@ | $(PERL) $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
+
+# Keep intermediate object file (useful for debugging)
+.PRECIOUS : $(BIN)/%.tmp
+
+# Show a linker map for the specified target
+#
+$(BIN)/%.map : $(BIN)/%.tmp
+ @less $(BIN)/$*.tmp.map
+
+# Get objects list for the specified target
+#
+define objs_list
+ $(sort $(foreach OBJ_SYMBOL,\
+ $(filter obj_%,$(shell $(NM) $(1) | cut -d" " -f3)),\
+ $(patsubst obj_%,%,$(OBJ_SYMBOL))))
+endef
+$(BIN)/%.objs : $(BIN)/%.tmp
+ $(Q)$(ECHO) $(call objs_list,$<)
+$(BIN)/%.sizes : $(BIN)/%.tmp
+ $(Q)$(SIZE) -t $(foreach OBJ,$(call objs_list,$<),$(wildcard $(BIN)/$(subst _,?,$(OBJ)).o)) | \
+ sort -g
+
+# Get dependency list for the specified target
+#
+define deps_list
+ $(sort $(foreach OBJ,$(call objs_list,$(1)),$($(OBJ)_DEPS)))
+endef
+$(BIN)/%.deps : $(BIN)/%.tmp
+ $(Q)$(ECHO) $(call deps_list,$<)
+
+# Get unneeded source files for the specified target
+#
+define nodeps_list
+ $(sort $(filter-out $(call deps_list,$(1)),\
+ $(foreach BOBJ,$(BOBJS),\
+ $($(basename $(notdir $(BOBJ)))_DEPS))))
+endef
+$(BIN)/%.nodeps : $(BIN)/%.tmp
+ $(Q)$(ECHO) $(call nodeps_list,$<)
+
+# Get licensing verdict for the specified target
+#
+define licensable_deps_list
+ $(filter-out config/local/%.h,$(call deps_list,$(1)))
+endef
+define unlicensed_deps_list
+ $(shell grep -L FILE_LICENCE $(call licensable_deps_list,$(1)))
+endef
+define licence_list
+ $(patsubst __licence_%,%,\
+ $(filter __licence_%,$(shell $(NM) $(1) | cut -d" " -f3)))
+endef
+$(BIN)/%.licence : $(BIN)/%.tmp
+ $(QM)$(ECHO) " [LICENCE] $@"
+ $(Q)$(if $(strip $(call unlicensed_deps_list,$<)),\
+ echo -n "Unable to determine licence because the following " ;\
+ echo "files are missing a licence declaration:" ;\
+ echo $(call unlicensed_deps_list,$<);\
+ exit 1,\
+ $(PERL) $(LICENCE) $(call licence_list,$<))
+
+# Extract compression information from intermediate object file
+#
+$(BIN)/%.zinfo : $(BIN)/%.tmp
+ $(QM)$(ECHO) " [ZINFO] $@"
+ $(Q)$(OBJCOPY) -O binary -j .zinfo $< $@
+
+# Build raw binary file from intermediate object file
+#
+$(BIN)/%.bin : $(BIN)/%.tmp
+ $(QM)$(ECHO) " [BIN] $@"
+ $(Q)$(OBJCOPY) -O binary -R .zinfo $< $@
+
+# Compress raw binary file
+#
+$(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN)
+ $(QM)$(ECHO) " [ZBIN] $@"
+ $(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@
+
+# Rules for each media format. These are generated and placed in an
+# external Makefile fragment. We could do this via $(eval ...), but
+# that would require make >= 3.80.
+#
+# Note that there's an alternative way to generate most .rom images:
+# they can be copied from their 'master' ROM image using cp and
+# reprocessed with makerom to add the PCI IDs and ident string. The
+# relevant rule would look something like:
+#
+# $(BIN)/dfe538%rom : $(BIN)/rtl8139%rom
+# cat $< $@
+# $(FINALISE_rom)
+#
+# You can derive the ROM/driver relationships using the variables
+# DRIVER_ and/or ROMS_.
+#
+# We don't currently do this, because (a) it would require generating
+# yet more Makefile fragments (since you need a rule for each ROM in
+# ROMS), and (b) the linker is so fast that it probably wouldn't make
+# much difference to the overall build time.
+
+# Add NON_AUTO_MEDIA to the media list, so that they show up in the
+# output of "make"
+#
+MEDIA += $(NON_AUTO_MEDIA)
+
+media :
+ @$(ECHO) $(MEDIA)
+
+AUTO_MEDIA = $(filter-out $(NON_AUTO_MEDIA),$(MEDIA))
+automedia :
+ @$(ECHO) $(AUTO_MEDIA)
+
+# media_template : create Makefile rules for specified media
+#
+# $(1) is the media name (e.g. "rom")
+#
+define media_template
+ @$(ECHO) " [MEDIARULES] $(1)"
+ @$(MKDIR) -p $(BIN)/rules/$(dir $(1))
+ @$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
+ '\n\t$$(QM)$(ECHO) " [FINISH] $$@"' \
+ '\n\t$$(Q)$$(CP) $$< $$@' \
+ '\n\t$$(Q)$$(PAD_$(1))' \
+ '\n\t$$(Q)$$(FINALISE_$(1))' \
+ > $(BIN)/rules/$(1).media.r
+endef
+
+# Rule to generate the Makefile rules to be included
+#
+$(BIN)/rules/%.media.r : $(MAKEDEPS)
+ $(call media_template,$*)
+
+# Calculate and include the list of Makefile rules files
+#
+MEDIA_RULES = $(patsubst %,$(BIN)/rules/%.media.r,$(AUTO_MEDIA))
+mediarules :
+ @$(ECHO) $(MEDIA_RULES)
+ifdef NEED_DEPS
+ifneq ($(MEDIA_RULES),)
+-include $(MEDIA_RULES)
+endif
+endif
+
+# Wrap up binary blobs (for embedded images)
+#
+$(BIN)/%.o : payload/%.img
+ $(QM)echo " [WRAP] $@"
+ $(Q)$(LD) -b binary -r -o $@ $< --undefined obj_payload \
+ --defsym obj_$*=0
+
+BOBJS += $(patsubst payload/%.img,$(BIN)/%.o,$(wildcard payload/*.img))
+
+# The "allXXXs" targets for each suffix
+#
+allall: allroms allmroms allpxes allisos alldsks
+allroms allmroms : all%s : $(foreach ROM,$(ROMS),$(BIN)/$(ROM).%)
+allbaseroms allbasemroms : allbase%s : $(foreach ROM,$(DRIVERS),$(BIN)/$(ROM).%)
+allpxes allisos alldsks : all%s : $(foreach DRIVER,$(DRIVERS),$(BIN)/$(DRIVER).%)
+
+# Alias for ipxe.%
+#
+$(BIN)/etherboot.% : $(BIN)/ipxe.%
+ ln -sf $(notdir $<) $@
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# The compression utilities
+#
+$(NRV2B) : util/nrv2b.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \
+ -DBITSIZE=32 -DENDIAN=0 -o $@ $<
+CLEANUP += $(NRV2B)
+
+$(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -O2 -o $@ $<
+CLEANUP += $(ZBIN)
+
+###############################################################################
+#
+# The EFI image converter
+#
+ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
+ -I$(ZLIB_DIR)/include -idirafter include \
+ -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib -L$(ZLIB_DIR)/lib \
+ -lbfd -ldl -liberty -lz -Wl,--no-warn-search-mismatch
+
+$(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DEFI_TARGET_IA32 -O2 -o $@
+CLEANUP += $(ELF2EFI32)
+
+$(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DEFI_TARGET_X64 -O2 -o $@
+CLEANUP += $(ELF2EFI64)
+
+$(EFIROM) : util/efirom.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(EFIROM)
+
+###############################################################################
+#
+# The ICC fixup utility
+#
+$(ICCFIX) : util/iccfix.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(ICCFIX)
+
+###############################################################################
+#
+# The error usage information utility
+#
+$(EINFO) : util/einfo.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(EINFO)
+
+###############################################################################
+#
+# Local configs
+#
+config/local/%.h :
+ $(Q)touch $@
+
+###############################################################################
+#
+# Auto-incrementing build serial number. Append "bs" to your list of
+# build targets to get a serial number printed at the end of the
+# build. Enable -DBUILD_SERIAL in order to see it when the code runs.
+#
+BUILDSERIAL_H = config/.buildserial.h
+BUILDSERIAL_NOW = config/.buildserial.now
+BUILDSERIAL_NEXT = config/.buildserial.next
+
+$(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
+ $(ECHO) 1 > $@
+
+$(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
+ $(ECHO) '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
+
+ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
+$(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
+ cp -f $(BUILDSERIAL_NEXT) $(BUILDSERIAL_NOW))
+endif
+
+bs : $(BUILDSERIAL_NOW)
+ @$(ECHO) $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
+ @$(ECHO) "Build serial number is $(shell cat $<)"
+
+###############################################################################
+#
+# Build the TAGS file(s) for emacs
+#
+TAGS :
+ ctags -e -R -f $@ --exclude=bin
+
+CLEANUP += TAGS
+
+###############################################################################
+#
+# Force rebuild for any given target
+#
+%.rebuild :
+ rm -f $*
+ $(Q)$(MAKE) $*
+
+###############################################################################
+#
+# Symbol table checks
+#
+
+ifdef BIN
+
+SYMTAB = $(BIN)/symtab
+$(SYMTAB) : $(BLIB)
+ $(OBJDUMP) -w -t $< > $@
+
+CLEANUP += $(BIN)/symtab
+
+symcheck : $(SYMTAB)
+ $(PERL) $(SYMCHECK) $<
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# Build bochs symbol table
+#
+
+ifdef BIN
+
+$(BIN)/%.bxs : $(BIN)/%.tmp
+ $(NM) $< | cut -d" " -f1,3 > $@
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# Documentation
+#
+
+ifdef BIN
+
+$(BIN)/doxygen.cfg : doxygen.cfg $(MAKEDEPS)
+ $(Q)$(PERL) -pe 's{\@SRCDIRS\@}{$(SRCDIRS)}; ' \
+ -e 's{\@INCDIRS\@}{$(filter-out .,$(INCDIRS))}; ' \
+ -e 's{\@BIN\@}{$(BIN)}; ' \
+ -e 's{\@ARCH\@}{$(ARCH)}; ' \
+ $< > $@
+
+$(BIN)/doc : $(BIN)/doxygen.cfg
+ $(Q)$(DOXYGEN) $<
+
+.PHONY : $(BIN)/doc
+
+doc : $(BIN)/doc
+
+doc-clean :
+ $(Q)$(RM) -r $(BIN)/doc
+
+VERYCLEANUP += $(BIN)/doc
+
+docview :
+ @[ -f $(BIN)/doc/html/index.html ] || $(MAKE) $(BIN)/doc
+ @if [ -n "$$BROWSER" ] ; then \
+ ( $$BROWSER $(BIN)/doc/html/index.html & ) ; \
+ else \
+ $(ECHO) "Documentation index in $(BIN)/doc/html/index.html" ; \
+ fi
+
+endif # defined(BIN)
+
+###############################################################################
+#
+# Keyboard maps
+#
+
+hci/keymap/keymap_%.c :
+ $(Q)$(PERL) $(GENKEYMAP) $* > $@
+
+###############################################################################
+#
+# Force deletion of incomplete targets
+#
+
+.DELETE_ON_ERROR :
+
+###############################################################################
+#
+# Clean-up
+#
+clean :
+ $(RM) $(CLEANUP)
+
+veryclean : clean
+ $(RM) -r $(VERYCLEANUP)
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/.quilt_patches ipxe-1.0.1~lliurex1505/.pc/.quilt_patches
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/.quilt_patches 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/.quilt_patches 2015-04-14 12:54:27.000000000 +0000
@@ -0,0 +1 @@
+debian/patches
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/.quilt_series ipxe-1.0.1~lliurex1505/.pc/.quilt_series
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/.quilt_series 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/.quilt_series 2015-04-14 12:54:27.000000000 +0000
@@ -0,0 +1 @@
+series
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/.pc/.version ipxe-1.0.1~lliurex1505/.pc/.version
--- ipxe-1.0.0+git-20131111.c3d1e78/.pc/.version 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/.pc/.version 2015-04-14 12:54:27.000000000 +0000
@@ -0,0 +1 @@
+2
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/aout_loader.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/aout_loader.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/aout_loader.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/aout_loader.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,144 @@
+/* a.out */
+struct exec {
+ unsigned long a_midmag; /* flags<<26 | mid<<16 | magic */
+ unsigned long a_text; /* text segment size */
+ unsigned long a_data; /* initialized data size */
+ unsigned long a_bss; /* uninitialized data size */
+ unsigned long a_syms; /* symbol table size */
+ unsigned long a_entry; /* entry point */
+ unsigned long a_trsize; /* text relocation size */
+ unsigned long a_drsize; /* data relocation size */
+};
+
+struct aout_state {
+ struct exec head;
+ unsigned long curaddr;
+ int segment; /* current segment number, -1 for none */
+ unsigned long loc; /* start offset of current block */
+ unsigned long skip; /* padding to be skipped to current segment */
+ unsigned long toread; /* remaining data to be read in the segment */
+};
+
+static struct aout_state astate;
+
+static sector_t aout_download(unsigned char *data, unsigned int len, int eof);
+static inline os_download_t aout_probe(unsigned char *data, unsigned int len)
+{
+ unsigned long start, mid, end, istart, iend;
+ if (len < sizeof(astate.head)) {
+ return 0;
+ }
+ memcpy(&astate.head, data, sizeof(astate.head));
+ if ((astate.head.a_midmag & 0xffff) != 0x010BL) {
+ return 0;
+ }
+
+ printf("(a.out");
+ aout_freebsd_probe();
+ printf(")... ");
+ /* Check the aout image */
+ start = astate.head.a_entry;
+ mid = (((start + astate.head.a_text) + 4095) & ~4095) + astate.head.a_data;
+ end = ((mid + 4095) & ~4095) + astate.head.a_bss;
+ istart = 4096;
+ iend = istart + (mid - start);
+ if (!prep_segment(start, mid, end, istart, iend))
+ return dead_download;
+ astate.segment = -1;
+ astate.loc = 0;
+ astate.skip = 0;
+ astate.toread = 0;
+ return aout_download;
+}
+
+static sector_t aout_download(unsigned char *data, unsigned int len, int eof)
+{
+ unsigned int offset; /* working offset in the current data block */
+
+ offset = 0;
+
+#ifdef AOUT_LYNX_KDI
+ astate.segment++;
+ if (astate.segment == 0) {
+ astate.curaddr = 0x100000;
+ astate.head.a_entry = astate.curaddr + 0x20;
+ }
+ memcpy(phys_to_virt(astate.curaddr), data, len);
+ astate.curaddr += len;
+ return 0;
+#endif
+
+ do {
+ if (astate.segment != -1) {
+ if (astate.skip) {
+ if (astate.skip >= len - offset) {
+ astate.skip -= len - offset;
+ break;
+ }
+ offset += astate.skip;
+ astate.skip = 0;
+ }
+
+ if (astate.toread) {
+ if (astate.toread >= len - offset) {
+ memcpy(phys_to_virt(astate.curaddr), data+offset,
+ len - offset);
+ astate.curaddr += len - offset;
+ astate.toread -= len - offset;
+ break;
+ }
+ memcpy(phys_to_virt(astate.curaddr), data+offset, astate.toread);
+ offset += astate.toread;
+ astate.toread = 0;
+ }
+ }
+
+ /* Data left, but current segment finished - look for the next
+ * segment. This is quite simple for a.out files. */
+ astate.segment++;
+ switch (astate.segment) {
+ case 0:
+ /* read text */
+ astate.curaddr = astate.head.a_entry;
+ astate.skip = 4096;
+ astate.toread = astate.head.a_text;
+ break;
+ case 1:
+ /* read data */
+ /* skip and curaddr may be wrong, but I couldn't find
+ * examples where this failed. There is no reasonable
+ * documentation for a.out available. */
+ astate.skip = ((astate.curaddr + 4095) & ~4095) - astate.curaddr;
+ astate.curaddr = (astate.curaddr + 4095) & ~4095;
+ astate.toread = astate.head.a_data;
+ break;
+ case 2:
+ /* initialize bss and start kernel */
+ astate.curaddr = (astate.curaddr + 4095) & ~4095;
+ astate.skip = 0;
+ astate.toread = 0;
+ memset(phys_to_virt(astate.curaddr), '\0', astate.head.a_bss);
+ goto aout_startkernel;
+ default:
+ break;
+ }
+ } while (offset < len);
+
+ astate.loc += len;
+
+ if (eof) {
+ unsigned long entry;
+
+aout_startkernel:
+ entry = astate.head.a_entry;
+ done(1);
+
+ aout_freebsd_boot();
+#ifdef AOUT_LYNX_KDI
+ xstart32(entry);
+#endif
+ printf("unexpected a.out variant\n");
+ longjmp(restart_etherboot, -2);
+ }
+ return 0;
+}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/basemem_packet.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/basemem_packet.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/basemem_packet.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/basemem_packet.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/cachedhcp.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/cachedhcp.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/cachedhcp.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/cachedhcp.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2013 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** @file
- *
- * Cached DHCP packet
- *
- */
-
-/** Cached DHCPACK physical address
- *
- * This can be set by the prefix.
- */
-uint32_t __bss16 ( cached_dhcpack_phys );
-#define cached_dhcpack_phys __use_data16 ( cached_dhcpack_phys )
-
-/** Colour for debug messages */
-#define colour &cached_dhcpack_phys
-
-/** Cached DHCPACK */
-static struct dhcp_packet *cached_dhcpack;
-
-/**
- * Cached DHCPACK startup function
- *
- */
-static void cachedhcp_init ( void ) {
- struct dhcp_packet *dhcppkt;
- struct dhcp_packet *tmp;
- struct dhcphdr *dhcphdr;
- size_t len;
-
- /* Do nothing if no cached DHCPACK is present */
- if ( ! cached_dhcpack_phys ) {
- DBGC ( colour, "CACHEDHCP found no cached DHCPACK\n" );
- return;
- }
-
- /* No reliable way to determine length before parsing packet;
- * start by assuming maximum length permitted by PXE.
- */
- len = sizeof ( BOOTPLAYER_t );
-
- /* Allocate and populate DHCP packet */
- dhcppkt = zalloc ( sizeof ( *dhcppkt ) + len );
- if ( ! dhcppkt ) {
- DBGC ( colour, "CACHEDHCP could not allocate copy\n" );
- return;
- }
- dhcphdr = ( ( ( void * ) dhcppkt ) + sizeof ( *dhcppkt ) );
- copy_from_user ( dhcphdr, phys_to_user ( cached_dhcpack_phys ), 0,
- len );
- dhcppkt_init ( dhcppkt, dhcphdr, len );
-
- /* Resize packet to required length. If reallocation fails,
- * just continue to use the original packet.
- */
- len = dhcppkt_len ( dhcppkt );
- tmp = realloc ( dhcppkt, ( sizeof ( *dhcppkt ) + len ) );
- if ( tmp )
- dhcppkt = tmp;
-
- /* Reinitialise packet at new address */
- dhcphdr = ( ( ( void * ) dhcppkt ) + sizeof ( *dhcppkt ) );
- dhcppkt_init ( dhcppkt, dhcphdr, len );
-
- /* Store as cached DHCPACK, and mark original copy as consumed */
- DBGC ( colour, "CACHEDHCP found cached DHCPACK at %08x+%zx\n",
- cached_dhcpack_phys, len );
- cached_dhcpack = dhcppkt;
- cached_dhcpack_phys = 0;
-}
-
-/**
- * Cached DHCPACK startup function
- *
- */
-static void cachedhcp_startup ( void ) {
-
- /* If cached DHCP packet was not claimed by any network device
- * during startup, then free it.
- */
- if ( cached_dhcpack ) {
- DBGC ( colour, "CACHEDHCP freeing unclaimed cached DHCPACK\n" );
- dhcppkt_put ( cached_dhcpack );
- cached_dhcpack = NULL;
- }
-}
-
-/** Cached DHCPACK initialisation function */
-struct init_fn cachedhcp_init_fn __init_fn ( INIT_NORMAL ) = {
- .initialise = cachedhcp_init,
-};
-
-/** Cached DHCPACK startup function */
-struct startup_fn cachedhcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
- .startup = cachedhcp_startup,
-};
-
-/**
- * Apply cached DHCPACK to network device, if applicable
- *
- * @v netdev Network device
- * @ret rc Return status code
- */
-static int cachedhcp_probe ( struct net_device *netdev ) {
- struct ll_protocol *ll_protocol = netdev->ll_protocol;
- int rc;
-
- /* Do nothing unless we have a cached DHCPACK */
- if ( ! cached_dhcpack )
- return 0;
-
- /* Do nothing unless cached DHCPACK's MAC address matches this
- * network device.
- */
- if ( memcmp ( netdev->ll_addr, cached_dhcpack->dhcphdr->chaddr,
- ll_protocol->ll_addr_len ) != 0 ) {
- DBGC ( colour, "CACHEDHCP cached DHCPACK does not match %s\n",
- netdev->name );
- return 0;
- }
- DBGC ( colour, "CACHEDHCP cached DHCPACK is for %s\n", netdev->name );
-
- /* Register as DHCP settings for this network device */
- if ( ( rc = register_settings ( &cached_dhcpack->settings,
- netdev_settings ( netdev ),
- DHCP_SETTINGS_NAME ) ) != 0 ) {
- DBGC ( colour, "CACHEDHCP could not register settings: %s\n",
- strerror ( rc ) );
- return rc;
- }
-
- /* Claim cached DHCPACK */
- dhcppkt_put ( cached_dhcpack );
- cached_dhcpack = NULL;
-
- return 0;
-}
-
-/** Cached DHCP packet network device driver */
-struct net_driver cachedhcp_driver __net_driver = {
- .name = "cachedhcp",
- .probe = cachedhcp_probe,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/cpu.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/cpu.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/cpu.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/cpu.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,73 @@
+#include
+#include
+#include
+
+/** @file
+ *
+ * CPU identification
+ *
+ */
+
+/**
+ * Test to see if CPU flag is changeable
+ *
+ * @v flag Flag to test
+ * @ret can_change Flag is changeable
+ */
+static inline int flag_is_changeable ( unsigned int flag ) {
+ uint32_t f1, f2;
+
+ __asm__ ( "pushfl\n\t"
+ "pushfl\n\t"
+ "popl %0\n\t"
+ "movl %0,%1\n\t"
+ "xorl %2,%0\n\t"
+ "pushl %0\n\t"
+ "popfl\n\t"
+ "pushfl\n\t"
+ "popl %0\n\t"
+ "popfl\n\t"
+ : "=&r" ( f1 ), "=&r" ( f2 )
+ : "ir" ( flag ) );
+
+ return ( ( ( f1 ^ f2 ) & flag ) != 0 );
+}
+
+/**
+ * Get CPU information
+ *
+ * @v cpu CPU information structure to fill in
+ */
+void get_cpuinfo ( struct cpuinfo_x86 *cpu ) {
+ unsigned int cpuid_level;
+ unsigned int cpuid_extlevel;
+ unsigned int discard_1, discard_2, discard_3;
+
+ memset ( cpu, 0, sizeof ( *cpu ) );
+
+ /* Check for CPUID instruction */
+ if ( ! flag_is_changeable ( X86_EFLAGS_ID ) ) {
+ DBG ( "CPUID not supported\n" );
+ return;
+ }
+
+ /* Get features, if present */
+ cpuid ( 0x00000000, &cpuid_level, &discard_1,
+ &discard_2, &discard_3 );
+ if ( cpuid_level >= 0x00000001 ) {
+ cpuid ( 0x00000001, &discard_1, &discard_2,
+ &discard_3, &cpu->features );
+ } else {
+ DBG ( "CPUID cannot return capabilities\n" );
+ }
+
+ /* Get 64-bit features, if present */
+ cpuid ( 0x80000000, &cpuid_extlevel, &discard_1,
+ &discard_2, &discard_3 );
+ if ( ( cpuid_extlevel & 0xffff0000 ) == 0x80000000 ) {
+ if ( cpuid_extlevel >= 0x80000001 ) {
+ cpuid ( 0x80000001, &discard_1, &discard_2,
+ &discard_3, &cpu->amd_features );
+ }
+ }
+}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/freebsd_loader.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/freebsd_loader.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/freebsd_loader.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/freebsd_loader.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,377 @@
+/* bootinfo */
+#define BOOTINFO_VERSION 1
+#define NODEV (-1) /* non-existent device */
+#define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */
+#define PAGE_SIZE (1<= estate.p.phdr32[j].p_offset) &&
+ ((shdr[i].sh_offset + shdr[i].sh_size) <=
+ (estate.p.phdr32[j].p_offset + estate.p.phdr32[j].p_filesz)))
+ {
+ shdr[i].sh_offset=0;
+ shdr[i].sh_size=0;
+ break;
+ }
+ }
+ }
+ if ((shdr[i].sh_offset != 0) && (shdr[i].sh_size != 0))
+ {
+ symtabindex = i;
+ symstrindex = shdr[i].sh_link;
+ }
+ }
+ }
+ }
+
+ /* Check if we have a symbol table index and have not loaded it */
+ if ((symtab_load == 0) && (symtabindex >= 0))
+ {
+ /* No symbol table yet? Load it first... */
+
+ /* This happens to work out in a strange way.
+ * If we are past the point in the file already,
+ * we will skip a *large* number of bytes which
+ * ends up bringing us to the end of the file and
+ * an old (default) boot. Less code and lets
+ * the state machine work in a cleaner way but this
+ * is a nasty side-effect trick... */
+ estate.skip = shdr[symtabindex].sh_offset - (estate.loc + offset);
+
+ /* And we need to read this many bytes... */
+ estate.toread = shdr[symtabindex].sh_size;
+
+ if (estate.toread)
+ {
+#if ELF_DEBUG
+ printf("db sym, size %lX, curaddr %lX\n",
+ estate.toread, estate.curaddr);
+#endif
+ /* Save where we are loading this... */
+ symtab_load = estate.curaddr;
+
+ *((long *)phys_to_virt(estate.curaddr)) = estate.toread;
+ estate.curaddr += sizeof(long);
+
+ /* Start to read... */
+ return 1;
+ }
+ }
+ else if ((symstr_load == 0) && (symstrindex >= 0))
+ {
+ /* We have already loaded the symbol table, so
+ * now on to the symbol strings... */
+
+
+ /* Same nasty trick as above... */
+ estate.skip = shdr[symstrindex].sh_offset - (estate.loc + offset);
+
+ /* And we need to read this many bytes... */
+ estate.toread = shdr[symstrindex].sh_size;
+
+ if (estate.toread)
+ {
+#if ELF_DEBUG
+ printf("db str, size %lX, curaddr %lX\n",
+ estate.toread, estate.curaddr);
+#endif
+ /* Save where we are loading this... */
+ symstr_load = estate.curaddr;
+
+ *((long *)phys_to_virt(estate.curaddr)) = estate.toread;
+ estate.curaddr += sizeof(long);
+
+ /* Start to read... */
+ return 1;
+ }
+ }
+ }
+ /* all done */
+ return 0;
+}
+
+static void elf_freebsd_boot(unsigned long entry)
+{
+ if (image_type != Elf_FreeBSD)
+ return;
+
+ memset(&bsdinfo, 0, sizeof(bsdinfo));
+ bsdinfo.bi_basemem = meminfo.basememsize;
+ bsdinfo.bi_extmem = meminfo.memsize;
+ bsdinfo.bi_memsizes_valid = 1;
+ bsdinfo.bi_version = BOOTINFO_VERSION;
+ bsdinfo.bi_kernelname = virt_to_phys(KERNEL_BUF);
+ bsdinfo.bi_nfs_diskless = NULL;
+ bsdinfo.bi_size = sizeof(bsdinfo);
+#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
+ if(freebsd_kernel_env[0] != '\0'){
+ freebsd_howto |= RB_BOOTINFO;
+ bsdinfo.bi_envp = (unsigned long)freebsd_kernel_env;
+ }
+
+ /* Check if we have symbols loaded, and if so,
+ * made the meta_data needed to pass those to
+ * the kernel. */
+ if ((symtab_load !=0) && (symstr_load != 0))
+ {
+ unsigned long *t;
+
+ bsdinfo.bi_symtab = symtab_load;
+
+ /* End of symbols (long aligned...) */
+ /* Assumes size of long is a power of 2... */
+ bsdinfo.bi_esymtab = (symstr_load +
+ sizeof(long) +
+ *((long *)phys_to_virt(symstr_load)) +
+ sizeof(long) - 1) & ~(sizeof(long) - 1);
+
+ /* Where we will build the meta data... */
+ t = phys_to_virt(bsdinfo.bi_esymtab);
+
+#if ELF_DEBUG
+ printf("Metadata at %lX\n",t);
+#endif
+
+ /* Set up the pointer to the memory... */
+ bsdinfo.bi_modulep = virt_to_phys(t);
+
+ /* The metadata structure is an array of 32-bit
+ * words where we store some information about the
+ * system. This is critical, as FreeBSD now looks
+ * only for the metadata for the extended symbol
+ * information rather than in the bootinfo.
+ */
+ /* First, do the kernel name and the kernel type */
+ /* Note that this assumed x86 byte order... */
+
+ /* 'kernel\0\0' */
+ *t++=MODINFO_NAME; *t++= 7; *t++=0x6E72656B; *t++=0x00006C65;
+
+ /* 'elf kernel\0\0' */
+ *t++=MODINFO_TYPE; *t++=11; *t++=0x20666C65; *t++=0x6E72656B; *t++ = 0x00006C65;
+
+ /* Now the symbol start/end - note that they are
+ * here in local/physical address - the Kernel
+ * boot process will relocate the addresses. */
+ *t++=MODINFOMD_SSYM | MODINFO_METADATA; *t++=sizeof(*t); *t++=bsdinfo.bi_symtab;
+ *t++=MODINFOMD_ESYM | MODINFO_METADATA; *t++=sizeof(*t); *t++=bsdinfo.bi_esymtab;
+
+ *t++=MODINFO_END; *t++=0; /* end of metadata */
+
+ /* Since we have symbols we need to make
+ * sure that the kernel knows its own end
+ * of memory... It is not _end but after
+ * the symbols and the metadata... */
+ bsdinfo.bi_kernend = virt_to_phys(t);
+
+ /* Signal locore.s that we have a valid bootinfo
+ * structure that was completely filled in. */
+ freebsd_howto |= 0x80000000;
+ }
+
+ xstart32(entry, freebsd_howto, NODEV, 0, 0, 0,
+ virt_to_phys(&bsdinfo), 0, 0, 0);
+ longjmp(restart_etherboot, -2);
+}
+#endif
+
+#ifdef AOUT_IMAGE
+static void aout_freebsd_probe(void)
+{
+ image_type = Aout;
+ if (((astate.head.a_midmag >> 16) & 0xffff) == 0) {
+ /* Some other a.out variants have a different
+ * value, and use other alignments (e.g. 1K),
+ * not the 4K used by FreeBSD. */
+ image_type = Aout_FreeBSD;
+ printf("/FreeBSD");
+ off = -(astate.head.a_entry & 0xff000000);
+ astate.head.a_entry += off;
+ }
+}
+
+static void aout_freebsd_boot(void)
+{
+ if (image_type == Aout_FreeBSD) {
+ memset(&bsdinfo, 0, sizeof(bsdinfo));
+ bsdinfo.bi_basemem = meminfo.basememsize;
+ bsdinfo.bi_extmem = meminfo.memsize;
+ bsdinfo.bi_memsizes_valid = 1;
+ bsdinfo.bi_version = BOOTINFO_VERSION;
+ bsdinfo.bi_kernelname = virt_to_phys(KERNEL_BUF);
+ bsdinfo.bi_nfs_diskless = NULL;
+ bsdinfo.bi_size = sizeof(bsdinfo);
+ xstart32(astate.head.a_entry, freebsd_howto, NODEV, 0, 0, 0,
+ virt_to_phys(&bsdinfo), 0, 0, 0);
+ longjmp(restart_etherboot, -2);
+ }
+}
+#endif
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/gdbmach.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/gdbmach.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/gdbmach.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/gdbmach.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/pic8259.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/pic8259.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/pic8259.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/pic8259.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/rdtsc_timer.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/rdtsc_timer.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/rdtsc_timer.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/rdtsc_timer.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/relocate.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/relocate.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/relocate.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/relocate.c 2012-01-06 23:49:04.000000000 +0000
@@ -33,10 +33,8 @@
/**
* Relocate iPXE
*
- * @v ebp Maximum address to use for relocation
- * @ret esi Current physical address
- * @ret edi New physical address
- * @ret ecx Length to copy
+ * @v ix86 x86 register dump from prefix
+ * @ret ix86 x86 registers to return to prefix
*
* This finds a suitable location for iPXE near the top of 32-bit
* address space, and returns the physical address of the new location
@@ -61,7 +59,7 @@
/* Determine maximum usable address */
max = MAX_ADDR;
- if ( ix86->regs.ebp < max ) {
+ if ( ix86->regs.ebp && ( ix86->regs.ebp < max ) ) {
max = ix86->regs.ebp;
DBG ( "Limiting relocation to [0,%lx)\n", max );
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/runtime.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/runtime.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/runtime.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/runtime.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -28,7 +27,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -134,11 +132,7 @@
}
cmdline = cmdline_copy;
copy_from_user ( cmdline, cmdline_user, 0, len );
- DBGC ( colour, "RUNTIME found command line \"%s\" at %08x\n",
- cmdline, cmdline_phys );
-
- /* Mark command line as consumed */
- cmdline_phys = 0;
+ DBGC ( colour, "RUNTIME found command line \"%s\"\n", cmdline );
/* Strip unwanted cruft from the command line */
cmdline_strip ( cmdline, "BOOT_IMAGE=" );
@@ -191,34 +185,25 @@
initrd_phys, ( initrd_phys + initrd_len ) );
/* Allocate image */
- image = alloc_image ( NULL );
+ image = alloc_image();
if ( ! image ) {
DBGC ( colour, "RUNTIME could not allocate image for "
"initrd\n" );
- rc = -ENOMEM;
goto err_alloc_image;
}
- if ( ( rc = image_set_name ( image, "" ) ) != 0 ) {
- DBGC ( colour, "RUNTIME could not set image name: %s\n",
- strerror ( rc ) );
- goto err_set_name;
- }
+ image_set_name ( image, "" );
/* Allocate and copy initrd content */
image->data = umalloc ( initrd_len );
if ( ! image->data ) {
- DBGC ( colour, "RUNTIME could not allocate %d bytes for "
+ DBGC ( colour, "RUNTIME could not allocate %zd bytes for "
"initrd\n", initrd_len );
- rc = -ENOMEM;
goto err_umalloc;
}
image->len = initrd_len;
memcpy_user ( image->data, 0, phys_to_user ( initrd_phys ), 0,
initrd_len );
- /* Mark initrd as consumed */
- initrd_phys = 0;
-
/* Register image */
if ( ( rc = register_image ( image ) ) != 0 ) {
DBGC ( colour, "RUNTIME could not register initrd: %s\n",
@@ -233,7 +218,6 @@
err_register_image:
err_umalloc:
- err_set_name:
image_put ( image );
err_alloc_image:
return rc;
@@ -260,6 +244,6 @@
}
/** Command line and initrd initialisation function */
-struct startup_fn runtime_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
- .startup = runtime_init,
+struct init_fn runtime_init_fn __init_fn ( INIT_NORMAL ) = {
+ .initialise = runtime_init,
};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/video_subr.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/video_subr.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/video_subr.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/video_subr.c 2012-01-06 23:49:04.000000000 +0000
@@ -11,14 +11,6 @@
#include
#include
#include "vga.h"
-#include
-
-/* Set default console usage if applicable */
-#if ! ( defined ( CONSOLE_DIRECT_VGA ) && \
- CONSOLE_EXPLICIT ( CONSOLE_DIRECT_VGA ) )
-#undef CONSOLE_DIRECT_VGA
-#define CONSOLE_DIRECT_VGA ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
-#endif
struct console_driver vga_console __console_driver;
@@ -105,7 +97,6 @@
struct console_driver vga_console __console_driver = {
.putchar = vga_putc,
.disabled = 1,
- .usage = CONSOLE_DIRECT_VGA,
};
struct init_fn video_init_fn __init_fn ( INIT_EARLY ) = {
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/wince_loader.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/wince_loader.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/wince_loader.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/wince_loader.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,273 @@
+#define LOAD_DEBUG 0
+
+static int get_x_header(unsigned char *data, unsigned long now);
+static void jump_2ep();
+static unsigned char ce_signature[] = {'B', '0', '0', '0', 'F', 'F', '\n',};
+static char ** ep;
+
+#define BOOT_ARG_PTR_LOCATION 0x001FFFFC
+
+typedef struct _BOOT_ARGS{
+ unsigned char ucVideoMode;
+ unsigned char ucComPort;
+ unsigned char ucBaudDivisor;
+ unsigned char ucPCIConfigType;
+
+ unsigned long dwSig;
+ #define BOOTARG_SIG 0x544F4F42
+ unsigned long dwLen;
+
+ unsigned char ucLoaderFlags;
+ unsigned char ucEshellFlags;
+ unsigned char ucEdbgAdapterType;
+ unsigned char ucEdbgIRQ;
+
+ unsigned long dwEdbgBaseAddr;
+ unsigned long dwEdbgDebugZone;
+ unsigned long dwDHCPLeaseTime;
+ unsigned long dwEdbgFlags;
+
+ unsigned long dwEBootFlag;
+ unsigned long dwEBootAddr;
+ unsigned long dwLaunchAddr;
+
+ unsigned long pvFlatFrameBuffer;
+ unsigned short vesaMode;
+ unsigned short cxDisplayScreen;
+ unsigned short cyDisplayScreen;
+ unsigned short cxPhysicalScreen;
+ unsigned short cyPhysicalScreen;
+ unsigned short cbScanLineLength;
+ unsigned short bppScreen;
+
+ unsigned char RedMaskSize;
+ unsigned char REdMaskPosition;
+ unsigned char GreenMaskSize;
+ unsigned char GreenMaskPosition;
+ unsigned char BlueMaskSize;
+ unsigned char BlueMaskPosition;
+} BOOT_ARGS;
+
+BOOT_ARGS BootArgs;
+
+static struct segment_info{
+ unsigned long addr; // Section Address
+ unsigned long size; // Section Size
+ unsigned long checksum; // Section CheckSum
+} X;
+
+#define PSIZE (1500) //Max Packet Size
+#define DSIZE (PSIZE+12)
+static unsigned long dbuffer_available =0;
+static unsigned long not_loadin =0;
+static unsigned long d_now =0;
+
+unsigned long entry;
+static unsigned long ce_curaddr;
+
+
+static sector_t ce_loader(unsigned char *data, unsigned int len, int eof);
+static os_download_t wince_probe(unsigned char *data, unsigned int len)
+{
+ if (strncmp(ce_signature, data, sizeof(ce_signature)) != 0) {
+ return 0;
+ }
+ printf("(WINCE)");
+ return ce_loader;
+}
+
+static sector_t ce_loader(unsigned char *data, unsigned int len, int eof)
+{
+ static unsigned char dbuffer[DSIZE];
+ int this_write = 0;
+ static int firsttime = 1;
+
+ /*
+ * new packet in, we have to
+ * [1] copy data to dbuffer,
+ *
+ * update...
+ * [2] dbuffer_available
+ */
+ memcpy( (dbuffer+dbuffer_available), data, len); //[1]
+ dbuffer_available += len; // [2]
+ len = 0;
+
+ d_now = 0;
+
+#if 0
+ printf("dbuffer_available =%ld \n", dbuffer_available);
+#endif
+
+ if (firsttime)
+ {
+ d_now = sizeof(ce_signature);
+ printf("String Physical Address = %lx \n",
+ *(unsigned long *)(dbuffer+d_now));
+
+ d_now += sizeof(unsigned long);
+ printf("Image Size = %ld [%lx]\n",
+ *(unsigned long *)(dbuffer+d_now),
+ *(unsigned long *)(dbuffer+d_now));
+
+ d_now += sizeof(unsigned long);
+ dbuffer_available -= d_now;
+
+ d_now = (unsigned long)get_x_header(dbuffer, d_now);
+ firsttime = 0;
+ }
+
+ if (not_loadin == 0)
+ {
+ d_now = get_x_header(dbuffer, d_now);
+ }
+
+ while ( not_loadin > 0 )
+ {
+ /* dbuffer do not have enough data to loading, copy all */
+#if LOAD_DEBUG
+ printf("[0] not_loadin = [%ld], dbuffer_available = [%ld] \n",
+ not_loadin, dbuffer_available);
+ printf("[0] d_now = [%ld] \n", d_now);
+#endif
+
+ if( dbuffer_available <= not_loadin)
+ {
+ this_write = dbuffer_available ;
+ memcpy(phys_to_virt(ce_curaddr), (dbuffer+d_now), this_write );
+ ce_curaddr += this_write;
+ not_loadin -= this_write;
+
+ /* reset index and available in the dbuffer */
+ dbuffer_available = 0;
+ d_now = 0;
+#if LOAD_DEBUG
+ printf("[1] not_loadin = [%ld], dbuffer_available = [%ld] \n",
+ not_loadin, dbuffer_available);
+ printf("[1] d_now = [%ld], this_write = [%d] \n",
+ d_now, this_write);
+#endif
+
+ // get the next packet...
+ return (0);
+ }
+
+ /* dbuffer have more data then loading ... , copy partital.... */
+ else
+ {
+ this_write = not_loadin;
+ memcpy(phys_to_virt(ce_curaddr), (dbuffer+d_now), this_write);
+ ce_curaddr += this_write;
+ not_loadin = 0;
+
+ /* reset index and available in the dbuffer */
+ dbuffer_available -= this_write;
+ d_now += this_write;
+#if LOAD_DEBUG
+ printf("[2] not_loadin = [%ld], dbuffer_available = [%ld] \n",
+ not_loadin, dbuffer_available);
+ printf("[2] d_now = [%ld], this_write = [%d] \n\n",
+ d_now, this_write);
+#endif
+
+ /* dbuffer not empty, proceed processing... */
+
+ // don't have enough data to get_x_header..
+ if ( dbuffer_available < (sizeof(unsigned long) * 3) )
+ {
+// printf("we don't have enough data remaining to call get_x. \n");
+ memcpy( (dbuffer+0), (dbuffer+d_now), dbuffer_available);
+ return (0);
+ }
+ else
+ {
+#if LOAD_DEBUG
+ printf("with remaining data to call get_x \n");
+ printf("dbuffer available = %ld , d_now = %ld\n",
+ dbuffer_available, d_now);
+#endif
+ d_now = get_x_header(dbuffer, d_now);
+ }
+ }
+ }
+ return (0);
+}
+
+static int get_x_header(unsigned char *dbuffer, unsigned long now)
+{
+ X.addr = *(unsigned long *)(dbuffer + now);
+ X.size = *(unsigned long *)(dbuffer + now + sizeof(unsigned long));
+ X.checksum = *(unsigned long *)(dbuffer + now + sizeof(unsigned long)*2);
+
+ if (X.addr == 0)
+ {
+ entry = X.size;
+ done(1);
+ printf("Entry Point Address = [%lx] \n", entry);
+ jump_2ep();
+ }
+
+ if (!prep_segment(X.addr, X.addr + X.size, X.addr + X.size, 0, 0)) {
+ longjmp(restart_etherboot, -2);
+ }
+
+ ce_curaddr = X.addr;
+ now += sizeof(unsigned long)*3;
+
+ /* re-calculate dbuffer available... */
+ dbuffer_available -= sizeof(unsigned long)*3;
+
+ /* reset index of this section */
+ not_loadin = X.size;
+
+#if 1
+ printf("\n");
+ printf("\t Section Address = [%lx] \n", X.addr);
+ printf("\t Size = %d [%lx]\n", X.size, X.size);
+ printf("\t Checksum = %ld [%lx]\n", X.checksum, X.checksum);
+#endif
+#if LOAD_DEBUG
+ printf("____________________________________________\n");
+ printf("\t dbuffer_now = %ld \n", now);
+ printf("\t dbuffer available = %ld \n", dbuffer_available);
+ printf("\t not_loadin = %ld \n", not_loadin);
+#endif
+
+ return now;
+}
+
+static void jump_2ep()
+{
+ BootArgs.ucVideoMode = 1;
+ BootArgs.ucComPort = 1;
+ BootArgs.ucBaudDivisor = 1;
+ BootArgs.ucPCIConfigType = 1; // do not fill with 0
+
+ BootArgs.dwSig = BOOTARG_SIG;
+ BootArgs.dwLen = sizeof(BootArgs);
+
+ if(BootArgs.ucVideoMode == 0)
+ {
+ BootArgs.cxDisplayScreen = 640;
+ BootArgs.cyDisplayScreen = 480;
+ BootArgs.cxPhysicalScreen = 640;
+ BootArgs.cyPhysicalScreen = 480;
+ BootArgs.bppScreen = 16;
+ BootArgs.cbScanLineLength = 1024;
+ BootArgs.pvFlatFrameBuffer = 0x800a0000; // ollie say 0x98000000
+ }
+ else if(BootArgs.ucVideoMode != 0xFF)
+ {
+ BootArgs.cxDisplayScreen = 0;
+ BootArgs.cyDisplayScreen = 0;
+ BootArgs.cxPhysicalScreen = 0;
+ BootArgs.cyPhysicalScreen = 0;
+ BootArgs.bppScreen = 0;
+ BootArgs.cbScanLineLength = 0;
+ BootArgs.pvFlatFrameBuffer = 0;
+ }
+
+ ep = phys_to_virt(BOOT_ARG_PTR_LOCATION);
+ *ep= virt_to_phys(&BootArgs);
+ xstart32(entry);
+}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/x86_io.c ipxe-1.0.1~lliurex1505/src/arch/i386/core/x86_io.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/core/x86_io.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/core/x86_io.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2008 Michael Brown .
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include
+#include
+
+/** @file
+ *
+ * iPXE I/O API for x86
+ *
+ */
+
+/**
+ * Read 64-bit qword from memory-mapped device
+ *
+ * @v io_addr I/O address
+ * @ret data Value read
+ *
+ * This routine uses MMX instructions.
+ */
+static uint64_t x86_readq ( volatile uint64_t *io_addr ) {
+ uint64_t data;
+ __asm__ __volatile__ ( "pushl %%edx\n\t"
+ "pushl %%eax\n\t"
+ "movq (%1), %%mm0\n\t"
+ "movq %%mm0, (%%esp)\n\t"
+ "popl %%eax\n\t"
+ "popl %%edx\n\t"
+ "emms\n\t"
+ : "=A" ( data ) : "r" ( io_addr ) );
+ return data;
+}
+
+/**
+ * Write 64-bit qword to memory-mapped device
+ *
+ * @v data Value to write
+ * @v io_addr I/O address
+ *
+ * This routine uses MMX instructions.
+ */
+static void x86_writeq ( uint64_t data, volatile uint64_t *io_addr ) {
+ __asm__ __volatile__ ( "pushl %%edx\n\t"
+ "pushl %%eax\n\t"
+ "movq (%%esp), %%mm0\n\t"
+ "movq %%mm0, (%1)\n\t"
+ "popl %%eax\n\t"
+ "popl %%edx\n\t"
+ "emms\n\t"
+ : : "A" ( data ), "r" ( io_addr ) );
+}
+
+PROVIDE_IOAPI_INLINE ( x86, phys_to_bus );
+PROVIDE_IOAPI_INLINE ( x86, bus_to_phys );
+PROVIDE_IOAPI_INLINE ( x86, ioremap );
+PROVIDE_IOAPI_INLINE ( x86, iounmap );
+PROVIDE_IOAPI_INLINE ( x86, io_to_bus );
+PROVIDE_IOAPI_INLINE ( x86, readb );
+PROVIDE_IOAPI_INLINE ( x86, readw );
+PROVIDE_IOAPI_INLINE ( x86, readl );
+PROVIDE_IOAPI ( x86, readq, x86_readq );
+PROVIDE_IOAPI_INLINE ( x86, writeb );
+PROVIDE_IOAPI_INLINE ( x86, writew );
+PROVIDE_IOAPI_INLINE ( x86, writel );
+PROVIDE_IOAPI ( x86, writeq, x86_writeq );
+PROVIDE_IOAPI_INLINE ( x86, inb );
+PROVIDE_IOAPI_INLINE ( x86, inw );
+PROVIDE_IOAPI_INLINE ( x86, inl );
+PROVIDE_IOAPI_INLINE ( x86, outb );
+PROVIDE_IOAPI_INLINE ( x86, outw );
+PROVIDE_IOAPI_INLINE ( x86, outl );
+PROVIDE_IOAPI_INLINE ( x86, insb );
+PROVIDE_IOAPI_INLINE ( x86, insw );
+PROVIDE_IOAPI_INLINE ( x86, insl );
+PROVIDE_IOAPI_INLINE ( x86, outsb );
+PROVIDE_IOAPI_INLINE ( x86, outsw );
+PROVIDE_IOAPI_INLINE ( x86, outsl );
+PROVIDE_IOAPI_INLINE ( x86, iodelay );
+PROVIDE_IOAPI_INLINE ( x86, mb );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undi.c ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undi.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undi.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undi.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undiload.c ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undiload.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undiload.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undiload.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -38,12 +37,6 @@
*
*/
-/* Disambiguate the various error causes */
-#define EINFO_EUNDILOAD \
- __einfo_uniqify ( EINFO_EPLATFORM, 0x01, \
- "UNDI loader error" )
-#define EUNDILOAD( status ) EPLATFORM ( EINFO_EUNDILOAD, status )
-
/** Parameter block for calling UNDI loader */
static struct s_UNDI_LOADER __bss16 ( undi_loader );
#define undi_loader __use_data16 ( undi_loader )
@@ -103,21 +96,21 @@
/* Call loader */
undi_loader_entry = undirom->loader_entry;
- __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "pushw %%ds\n\t"
+ __asm__ __volatile__ ( REAL_CODE ( "pushw %%ds\n\t"
"pushw %%ax\n\t"
"lcall *undi_loader_entry\n\t"
- "popl %%ebp\n\t" /* discard */
- "popl %%ebp\n\t" /* gcc bug */ )
+ "addw $4, %%sp\n\t" )
: "=a" ( exit )
: "a" ( __from_data16 ( &undi_loader ) )
- : "ebx", "ecx", "edx", "esi", "edi" );
+ : "ebx", "ecx", "edx", "esi", "edi", "ebp" );
if ( exit != PXENV_EXIT_SUCCESS ) {
/* Clear entry point */
memset ( &undi_loader_entry, 0, sizeof ( undi_loader_entry ) );
- rc = -EUNDILOAD ( undi_loader.Status );
+ rc = -undi_loader.Status;
+ if ( rc == 0 ) /* Paranoia */
+ rc = -EIO;
DBGC ( undi, "UNDI %p loader failed: %s\n",
undi, strerror ( rc ) );
return rc;
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undinet.c ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undinet.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undinet.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undinet.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,15 +13,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include
#include
-#include
#include
#include
#include
@@ -71,9 +69,6 @@
/** Delay between retries of PXENV_UNDI_INITIALIZE */
#define UNDI_INITIALIZE_RETRY_DELAY_MS 200
-/** Alignment of received frame payload */
-#define UNDI_RX_ALIGN 16
-
static void undinet_close ( struct net_device *netdev );
/** Address of UNDI entry point */
@@ -171,10 +166,6 @@
static struct s_PXENV_UNDI_TBD __data16 ( undinet_tbd );
#define undinet_tbd __use_data16 ( undinet_tbd )
-/** UNDI transmit destination address */
-static uint8_t __data16_array ( undinet_destaddr, [ETH_ALEN] );
-#define undinet_destaddr __use_data16 ( undinet_destaddr )
-
/**
* Transmit packet
*
@@ -184,14 +175,8 @@
*/
static int undinet_transmit ( struct net_device *netdev,
struct io_buffer *iobuf ) {
- struct undi_nic *undinic = netdev->priv;
struct s_PXENV_UNDI_TRANSMIT undi_transmit;
- const void *ll_dest;
- const void *ll_source;
- uint16_t net_proto;
- unsigned int flags;
- uint8_t protocol;
- size_t len;
+ size_t len = iob_len ( iobuf );
int rc;
/* Technically, we ought to make sure that the previous
@@ -204,49 +189,15 @@
* transmit the next packet.
*/
- /* Some PXE stacks are unable to cope with P_UNKNOWN, and will
- * always try to prepend a link-layer header. Work around
- * these stacks by stripping the existing link-layer header
- * and allowing the PXE stack to (re)construct the link-layer
- * header itself.
- */
- if ( ( rc = eth_pull ( netdev, iobuf, &ll_dest, &ll_source,
- &net_proto, &flags ) ) != 0 ) {
- DBGC ( undinic, "UNDINIC %p could not strip Ethernet header: "
- "%s\n", undinic, strerror ( rc ) );
- return rc;
- }
- memcpy ( undinet_destaddr, ll_dest, sizeof ( undinet_destaddr ) );
- switch ( net_proto ) {
- case htons ( ETH_P_IP ) :
- protocol = P_IP;
- break;
- case htons ( ETH_P_ARP ) :
- protocol = P_ARP;
- break;
- case htons ( ETH_P_RARP ) :
- protocol = P_RARP;
- break;
- default:
- /* Unknown protocol; restore the original link-layer header */
- iob_push ( iobuf, sizeof ( struct ethhdr ) );
- protocol = P_UNKNOWN;
- break;
- }
-
/* Copy packet to UNDI I/O buffer */
- len = iob_len ( iobuf );
if ( len > sizeof ( basemem_packet ) )
len = sizeof ( basemem_packet );
memcpy ( &basemem_packet, iobuf->data, len );
/* Create PXENV_UNDI_TRANSMIT data structure */
memset ( &undi_transmit, 0, sizeof ( undi_transmit ) );
- undi_transmit.Protocol = protocol;
- undi_transmit.XmitFlag = ( ( flags & LL_BROADCAST ) ?
- XMT_BROADCAST : XMT_DESTADDR );
undi_transmit.DestAddr.segment = rm_ds;
- undi_transmit.DestAddr.offset = __from_data16 ( &undinet_destaddr );
+ undi_transmit.DestAddr.offset = __from_data16 ( &undinet_tbd );
undi_transmit.TBD.segment = rm_ds;
undi_transmit.TBD.offset = __from_data16 ( &undinet_tbd );
@@ -303,7 +254,6 @@
struct s_PXENV_UNDI_ISR undi_isr;
struct io_buffer *iobuf = NULL;
size_t len;
- size_t reserve_len;
size_t frag_len;
size_t max_frag_len;
int rc;
@@ -351,8 +301,6 @@
/* Packet fragment received */
len = undi_isr.FrameLength;
frag_len = undi_isr.BufferLength;
- reserve_len = ( -undi_isr.FrameHeaderLength &
- ( UNDI_RX_ALIGN - 1 ) );
if ( ( len == 0 ) || ( len < frag_len ) ) {
/* Don't laugh. VMWare does it. */
DBGC ( undinic, "UNDINIC %p reported insane "
@@ -361,17 +309,15 @@
netdev_rx_err ( netdev, NULL, -EINVAL );
break;
}
+ if ( ! iobuf )
+ iobuf = alloc_iob ( len );
if ( ! iobuf ) {
- iobuf = alloc_iob ( reserve_len + len );
- if ( ! iobuf ) {
- DBGC ( undinic, "UNDINIC %p could not "
- "allocate %zd bytes for RX "
- "buffer\n", undinic, len );
- /* Fragment will be dropped */
- netdev_rx_err ( netdev, NULL, -ENOMEM );
- goto done;
- }
- iob_reserve ( iobuf, reserve_len );
+ DBGC ( undinic, "UNDINIC %p could not "
+ "allocate %zd bytes for RX buffer\n",
+ undinic, len );
+ /* Fragment will be dropped */
+ netdev_rx_err ( netdev, NULL, -ENOMEM );
+ goto done;
}
max_frag_len = iob_tailroom ( iobuf );
if ( frag_len > max_frag_len ) {
@@ -531,53 +477,6 @@
.irq = undinet_irq,
};
-/** A device with broken support for generating interrupts */
-struct undinet_irq_broken {
- /** PCI vendor ID */
- uint16_t pci_vendor;
- /** PCI device ID */
- uint16_t pci_device;
-};
-
-/**
- * List of devices with broken support for generating interrupts
- *
- * Some PXE stacks are known to claim that IRQs are supported, but
- * then never generate interrupts. No satisfactory solution has been
- * found to this problem; the workaround is to add the PCI vendor and
- * device IDs to this list. This is something of a hack, since it
- * will generate false positives for identical devices with a working
- * PXE stack (e.g. those that have been reflashed with iPXE), but it's
- * an improvement on the current situation.
- */
-static const struct undinet_irq_broken undinet_irq_broken_list[] = {
- /* HP XX70x laptops */
- { .pci_vendor = 0x8086, .pci_device = 0x1502 },
- { .pci_vendor = 0x8086, .pci_device = 0x1503 },
-};
-
-/**
- * Check for devices with broken support for generating interrupts
- *
- * @v undi UNDI device
- * @ret irq_is_broken Interrupt support is broken; no interrupts are generated
- */
-static int undinet_irq_is_broken ( struct undi_device *undi ) {
- const struct undinet_irq_broken *broken;
- unsigned int i;
-
- for ( i = 0 ; i < ( sizeof ( undinet_irq_broken_list ) /
- sizeof ( undinet_irq_broken_list[0] ) ) ; i++ ) {
- broken = &undinet_irq_broken_list[i];
- if ( ( undi->dev.desc.bus_type == BUS_TYPE_PCI ) &&
- ( undi->dev.desc.vendor == broken->pci_vendor ) &&
- ( undi->dev.desc.device == broken->pci_device ) ) {
- return 1;
- }
- }
- return 0;
-}
-
/**
* Probe UNDI device
*
@@ -694,11 +593,6 @@
undinic );
undinic->hacks |= UNDI_HACK_EB54;
}
- if ( undinet_irq_is_broken ( undi ) ) {
- DBGC ( undinic, "UNDINIC %p forcing polling mode due to "
- "broken interrupts\n", undinic );
- undinic->irq_supported = 0;
- }
/* Register network device */
if ( ( rc = register_netdev ( netdev ) ) != 0 )
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undionly.c ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undionly.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undionly.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undionly.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undipreload.c ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undipreload.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undipreload.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undipreload.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undirom.c ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undirom.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/drivers/net/undirom.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/drivers/net/undirom.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/basemem.c ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/basemem.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/basemem.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/basemem.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/bios_console.c ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/bios_console.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/bios_console.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/bios_console.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -24,7 +23,6 @@
#include
#include
#include
-#include
#define ATTR_BOLD 0x08
@@ -50,12 +48,6 @@
#define ATTR_DEFAULT ATTR_FCOL_WHITE
-/* Set default console usage if applicable */
-#if ! ( defined ( CONSOLE_PCBIOS ) && CONSOLE_EXPLICIT ( CONSOLE_PCBIOS ) )
-#undef CONSOLE_PCBIOS
-#define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
-#endif
-
/** Current character attribute */
static unsigned int bios_attr = ATTR_DEFAULT;
@@ -97,7 +89,7 @@
"int $0x10\n\t"
"cli\n\t" )
: : "a" ( 0x0600 ), "b" ( bios_attr << 8 ),
- "c" ( 0 ), "d" ( 0xfefe ) );
+ "c" ( 0 ), "d" ( 0xffff ) );
}
/**
@@ -167,19 +159,10 @@
return;
/* Print character with attribute */
- __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "sti\n\t"
+ __asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
/* Skip non-printable characters */
"cmpb $0x20, %%al\n\t"
"jb 1f\n\t"
- /* Read attribute */
- "movb %%al, %%cl\n\t"
- "movb $0x08, %%ah\n\t"
- "int $0x10\n\t"
- "xchgb %%al, %%cl\n\t"
- /* Skip if attribute matches */
- "cmpb %%ah, %%bl\n\t"
- "je 1f\n\t"
/* Set attribute */
"movw $0x0001, %%cx\n\t"
"movb $0x09, %%ah\n\t"
@@ -189,11 +172,11 @@
"xorw %%bx, %%bx\n\t"
"movb $0x0e, %%ah\n\t"
"int $0x10\n\t"
- "cli\n\t"
- "popl %%ebp\n\t" /* gcc bug */ )
+ "cli\n\t" )
: "=a" ( discard_a ), "=b" ( discard_b ),
"=c" ( discard_c )
- : "a" ( character ), "b" ( bios_attr ) );
+ : "a" ( character ), "b" ( bios_attr )
+ : "ebp" );
}
/**
@@ -218,8 +201,6 @@
BIOS_KEY ( "\x4d", "[C" ) /* Right arrow */
BIOS_KEY ( "\x47", "[H" ) /* Home */
BIOS_KEY ( "\x4f", "[F" ) /* End */
- BIOS_KEY ( "\x49", "[5~" ) /* Page up */
- BIOS_KEY ( "\x51", "[6~" ) /* Page down */
BIOS_KEY ( "\x3f", "[15~" ) /* F5 */
BIOS_KEY ( "\x40", "[17~" ) /* F6 */
BIOS_KEY ( "\x41", "[18~" ) /* F7 */
@@ -330,5 +311,4 @@
.putchar = bios_putchar,
.getchar = bios_getchar,
.iskey = bios_iskey,
- .usage = CONSOLE_PCBIOS,
};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/e820mangler.S ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/e820mangler.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/e820mangler.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/e820mangler.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER )
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/fakee820.c ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/fakee820.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/fakee820.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/fakee820.c 2012-01-06 23:49:04.000000000 +0000
@@ -12,8 +12,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/hidemem.c ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/hidemem.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/hidemem.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/hidemem.c 2012-01-06 23:49:04.000000000 +0000
@@ -12,8 +12,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -190,8 +189,6 @@
* possible.
*/
static void unhide_etherboot ( int flags __unused ) {
- struct memory_map memmap;
- int rc;
/* If we have more than one hooked interrupt at this point, it
* means that some other vector is still hooked, in which case
@@ -205,23 +202,15 @@
return;
}
- /* Try to unhook INT 15 */
- if ( ( rc = unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
- &int15_vector ) ) != 0 ) {
- DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
- /* Leave it hooked; there's nothing else we can do,
- * and it should be intrinsically safe (though
- * wasteful of RAM).
- */
- }
+ /* Try to unhook INT 15. If it fails, then just leave it
+ * hooked; it takes care of protecting itself. :)
+ */
+ unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
+ &int15_vector );
/* Unhook fake E820 map, if used */
if ( FAKE_E820 )
unfake_e820();
-
- /* Dump memory map after unhiding */
- DBG ( "Unhidden iPXE from system memory map\n" );
- get_memmap ( &memmap );
}
/** Hide Etherboot startup function */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/memmap.c ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/memmap.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/memmap.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/memmap.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -63,10 +62,6 @@
static struct e820_entry __bss16 ( e820buf );
#define e820buf __use_data16 ( e820buf )
-/** We are running during POST; inhibit INT 15,e820 and INT 15,e801 */
-uint8_t __bss16 ( memmap_post );
-#define memmap_post __use_data16 ( memmap_post )
-
/**
* Get size of extended memory via INT 15,e801
*
@@ -78,12 +73,6 @@
unsigned int flags;
unsigned int extmem;
- /* Inhibit INT 15,e801 during POST */
- if ( memmap_post ) {
- DBG ( "INT 15,e801 not available during POST\n" );
- return 0;
- }
-
__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
"int $0x15\n\t"
"pushfw\n\t"
@@ -174,12 +163,6 @@
unsigned int flags;
unsigned int discard_D;
- /* Inhibit INT 15,e820 during POST */
- if ( memmap_post ) {
- DBG ( "INT 15,e820 not available during POST\n" );
- return -ENOTTY;
- }
-
/* Clear the E820 buffer. Do this once before starting,
* rather than on each call; some BIOSes rely on the contents
* being preserved between calls.
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/pnpbios.c ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/pnpbios.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/firmware/pcbios/pnpbios.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/firmware/pcbios/pnpbios.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/hci/commands/pxe_cmd.c ipxe-1.0.1~lliurex1505/src/arch/i386/hci/commands/pxe_cmd.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/hci/commands/pxe_cmd.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/hci/commands/pxe_cmd.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include
@@ -31,21 +30,18 @@
*
*/
-/** "startpxe" options */
-struct startpxe_options {};
-
-/** "startpxe" option list */
-static struct option_descriptor startpxe_opts[] = {};
+/** "startpxe" command descriptor */
+static struct command_descriptor startpxe_cmd =
+ COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
+ "[]" );
/**
* "startpxe" payload
*
* @v netdev Network device
- * @v opts Command options
* @ret rc Return status code
*/
-static int startpxe_payload ( struct net_device *netdev,
- struct startpxe_options *opts __unused ) {
+static int startpxe_payload ( struct net_device *netdev ) {
if ( netdev_is_open ( netdev ) )
pxe_activate ( netdev );
@@ -53,12 +49,6 @@
return 0;
}
-/** "startpxe" command descriptor */
-static struct ifcommon_command_descriptor startpxe_cmd =
- IFCOMMON_COMMAND_DESC ( struct startpxe_options, startpxe_opts,
- 0, MAX_ARGUMENTS, "[]",
- startpxe_payload, 0 );
-
/**
* The "startpxe" command
*
@@ -67,7 +57,7 @@
* @ret rc Return status code
*/
static int startpxe_exec ( int argc, char **argv ) {
- return ifcommon_exec ( argc, argv, &startpxe_cmd );
+ return ifcommon_exec ( argc, argv, &startpxe_cmd, startpxe_payload, 0 );
}
/** "stoppxe" options */
@@ -78,7 +68,7 @@
/** "stoppxe" command descriptor */
static struct command_descriptor stoppxe_cmd =
- COMMAND_DESC ( struct stoppxe_options, stoppxe_opts, 0, 0, NULL );
+ COMMAND_DESC ( struct stoppxe_options, stoppxe_opts, 0, 0, "" );
/**
* The "stoppxe" command
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/hci/commands/reboot_cmd.c ipxe-1.0.1~lliurex1505/src/arch/i386/hci/commands/reboot_cmd.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/hci/commands/reboot_cmd.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/hci/commands/reboot_cmd.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Michael Brown .
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include
+#include
+#include
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+/** @file
+ *
+ * Reboot command
+ *
+ */
+
+/** "reboot" options */
+struct reboot_options {};
+
+/** "reboot" option list */
+static struct option_descriptor reboot_opts[] = {};
+
+/** "reboot" command descriptor */
+static struct command_descriptor reboot_cmd =
+ COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "" );
+
+/**
+ * The "reboot" command
+ *
+ * @v argc Argument count
+ * @v argv Argument list
+ * @ret rc Return status code
+ */
+static int reboot_exec ( int argc, char **argv ) {
+ struct reboot_options opts;
+ int rc;
+
+ /* Parse options */
+ if ( ( rc = parse_options ( argc, argv, &reboot_cmd, &opts ) ) != 0 )
+ return rc;
+
+ /* Reboot system */
+ __asm__ __volatile__ ( REAL_CODE ( "ljmp $0xf000, $0xfff0" ) : : );
+
+ return 0;
+}
+
+/** "reboot" command */
+struct command reboot_command __command = {
+ .name = "reboot",
+ .exec = reboot_exec,
+};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/bootsector.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/bootsector.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/bootsector.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/bootsector.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -80,35 +79,17 @@
"movw %%ss, %%ax\n\t"
"movw %%ax, %%cs:saved_ss\n\t"
"movw %%sp, %%cs:saved_sp\n\t"
- /* Save frame pointer (gcc bug) */
- "movl %%ebp, %%cs:saved_ebp\n\t"
- /* Prepare jump to boot sector */
+ /* Jump to boot sector */
"pushw %%bx\n\t"
"pushw %%di\n\t"
- /* Clear all registers */
- "xorl %%eax, %%eax\n\t"
- "xorl %%ebx, %%ebx\n\t"
- "xorl %%ecx, %%ecx\n\t"
- /* %edx contains drive number */
- "xorl %%esi, %%esi\n\t"
- "xorl %%edi, %%edi\n\t"
- "xorl %%ebp, %%ebp\n\t"
- "movw %%ax, %%ds\n\t"
- "movw %%ax, %%es\n\t"
- "movw %%ax, %%fs\n\t"
- "movw %%ax, %%gs\n\t"
- /* Jump to boot sector */
"sti\n\t"
"lret\n\t"
/* Preserved variables */
- "\nsaved_ebp: .long 0\n\t"
"\nsaved_ss: .word 0\n\t"
"\nsaved_sp: .word 0\n\t"
"\nsaved_retaddr: .word 0\n\t"
/* Boot failure return point */
"\nbootsector_exec_fail:\n\t"
- /* Restore frame pointer (gcc bug) */
- "movl %%cs:saved_ebp, %%ebp\n\t"
/* Restore stack pointer */
"movw %%cs:saved_ss, %%ax\n\t"
"movw %%ax, %%ss\n\t"
@@ -119,7 +100,7 @@
"=d" ( discard_d )
: "b" ( segment ), "D" ( offset ),
"d" ( drive )
- : "eax", "ecx", "esi" );
+ : "eax", "ecx", "esi", "ebp" );
DBG ( "Booted disk returned via INT 18 or 19\n" );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/bzimage.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/bzimage.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/bzimage.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/bzimage.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -33,7 +32,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -216,8 +214,7 @@
} else {
bzimg->cmdline_magic.magic = BZI_CMDLINE_MAGIC;
bzimg->cmdline_magic.offset = bzimg->rm_cmdline;
- if ( bzimg->version >= 0x0200 )
- bzimg->bzhdr.setup_move_size = bzimg->rm_memsz;
+ bzimg->bzhdr.setup_move_size = bzimg->rm_memsz;
}
/* Set video mode */
@@ -305,10 +302,11 @@
* @v image bzImage image
* @v bzimg bzImage context
* @v cmdline Kernel command line
+ * @ret rc Return status code
*/
-static void bzimage_set_cmdline ( struct image *image,
- struct bzimage_context *bzimg,
- const char *cmdline ) {
+static int bzimage_set_cmdline ( struct image *image,
+ struct bzimage_context *bzimg,
+ const char *cmdline ) {
size_t cmdline_len;
/* Copy command line down to real-mode portion */
@@ -318,32 +316,8 @@
copy_to_user ( bzimg->rm_kernel, bzimg->rm_cmdline,
cmdline, cmdline_len );
DBGC ( image, "bzImage %p command line \"%s\"\n", image, cmdline );
-}
-/**
- * Parse standalone image command line for cpio parameters
- *
- * @v image bzImage file
- * @v cpio CPIO header
- * @v cmdline Command line
- */
-static void bzimage_parse_cpio_cmdline ( struct image *image,
- struct cpio_header *cpio,
- const char *cmdline ) {
- char *arg;
- char *end;
- unsigned int mode;
-
- /* Look for "mode=" */
- if ( ( arg = strstr ( cmdline, "mode=" ) ) ) {
- arg += 5;
- mode = strtoul ( arg, &end, 8 /* Octal for file mode */ );
- if ( *end && ( *end != ' ' ) ) {
- DBGC ( image, "bzImage %p strange \"mode=\""
- "terminator '%c'\n", image, *end );
- }
- cpio_set_field ( cpio->c_mode, ( 0100000 | mode ) );
- }
+ return 0;
}
/**
@@ -352,190 +326,120 @@
* @v image bzImage image
* @v initrd initrd image
* @v address Address at which to load, or UNULL
- * @ret len Length of loaded image, rounded up to INITRD_ALIGN
+ * @ret len Length of loaded image, rounded up to 4 bytes
*/
static size_t bzimage_load_initrd ( struct image *image,
struct image *initrd,
userptr_t address ) {
char *filename = initrd->cmdline;
- char *cmdline;
struct cpio_header cpio;
- size_t offset;
- size_t name_len;
- size_t pad_len;
+ size_t offset = 0;
/* Do not include kernel image itself as an initrd */
if ( initrd == image )
return 0;
- /* Create cpio header for non-prebuilt images */
+ /* Create cpio header before non-prebuilt images */
if ( filename && filename[0] ) {
- cmdline = strchr ( filename, ' ' );
- name_len = ( ( cmdline ? ( ( size_t ) ( cmdline - filename ) )
- : strlen ( filename ) ) + 1 /* NUL */ );
+ size_t name_len = ( strlen ( filename ) + 1 );
+
+ DBGC ( image, "bzImage %p inserting initrd %p as %s\n",
+ image, initrd, filename );
memset ( &cpio, '0', sizeof ( cpio ) );
memcpy ( cpio.c_magic, CPIO_MAGIC, sizeof ( cpio.c_magic ) );
cpio_set_field ( cpio.c_mode, 0100644 );
cpio_set_field ( cpio.c_nlink, 1 );
cpio_set_field ( cpio.c_filesize, initrd->len );
cpio_set_field ( cpio.c_namesize, name_len );
- if ( cmdline ) {
- bzimage_parse_cpio_cmdline ( image, &cpio,
- ( cmdline + 1 /* ' ' */ ));
+ if ( address ) {
+ copy_to_user ( address, offset, &cpio,
+ sizeof ( cpio ) );
}
- offset = ( ( sizeof ( cpio ) + name_len + 0x03 ) & ~0x03 );
- } else {
- offset = 0;
- name_len = 0;
- }
-
- /* Copy in initrd image body (and cpio header if applicable) */
- if ( address ) {
- memmove_user ( address, offset, initrd->data, 0, initrd->len );
- if ( offset ) {
- memset_user ( address, 0, 0, offset );
- copy_to_user ( address, 0, &cpio, sizeof ( cpio ) );
- copy_to_user ( address, sizeof ( cpio ), filename,
- ( name_len - 1 /* NUL (or space) */ ) );
+ offset += sizeof ( cpio );
+ if ( address ) {
+ copy_to_user ( address, offset, filename,
+ name_len );
}
- DBGC ( image, "bzImage %p initrd %p [%#08lx,%#08lx,%#08lx)"
- "%s%s\n", image, initrd, user_to_phys ( address, 0 ),
- user_to_phys ( address, offset ),
- user_to_phys ( address, ( offset + initrd->len ) ),
- ( filename ? " " : "" ), ( filename ? filename : "" ) );
- DBGC2_MD5A ( image, user_to_phys ( address, offset ),
- user_to_virt ( address, offset ), initrd->len );
+ offset += name_len;
+ offset = ( ( offset + 0x03 ) & ~0x03 );
}
- offset += initrd->len;
- /* Round up to multiple of INITRD_ALIGN and zero-pad */
- pad_len = ( ( -offset ) & ( INITRD_ALIGN - 1 ) );
+ /* Copy in initrd image body */
if ( address )
- memset_user ( address, offset, 0, pad_len );
- offset += pad_len;
+ memcpy_user ( address, offset, initrd->data, 0, initrd->len );
+ offset += initrd->len;
+ if ( address ) {
+ DBGC ( image, "bzImage %p has initrd %p at [%lx,%lx)\n",
+ image, initrd, user_to_phys ( address, 0 ),
+ user_to_phys ( address, offset ) );
+ }
+ /* Round up to 4-byte boundary */
+ offset = ( ( offset + 0x03 ) & ~0x03 );
return offset;
}
/**
- * Check that initrds can be loaded
+ * Load initrds, if any
*
* @v image bzImage image
* @v bzimg bzImage context
* @ret rc Return status code
*/
-static int bzimage_check_initrds ( struct image *image,
- struct bzimage_context *bzimg ) {
+static int bzimage_load_initrds ( struct image *image,
+ struct bzimage_context *bzimg ) {
struct image *initrd;
- userptr_t bottom;
- size_t len = 0;
+ size_t total_len = 0;
+ physaddr_t address;
int rc;
- /* Calculate total loaded length of initrds */
- for_each_image ( initrd ) {
+ /* Add up length of all initrd images */
+ for_each_image ( initrd )
+ total_len += bzimage_load_initrd ( image, initrd, UNULL );
- /* Skip kernel */
- if ( initrd == image )
- continue;
-
- /* Calculate length */
- len += bzimage_load_initrd ( image, initrd, UNULL );
+ /* Give up if no initrd images found */
+ if ( ! total_len )
+ return 0;
- DBGC ( image, "bzImage %p initrd %p from [%#08lx,%#08lx)%s%s\n",
- image, initrd, user_to_phys ( initrd->data, 0 ),
- user_to_phys ( initrd->data, initrd->len ),
- ( initrd->cmdline ? " " : "" ),
- ( initrd->cmdline ? initrd->cmdline : "" ) );
- DBGC2_MD5A ( image, user_to_phys ( initrd->data, 0 ),
- user_to_virt ( initrd->data, 0 ), initrd->len );
- }
-
- /* Calculate lowest usable address */
- bottom = userptr_add ( bzimg->pm_kernel, bzimg->pm_sz );
-
- /* Check that total length fits within space available for
- * reshuffling. This is a conservative check, since CPIO
- * headers are not present during reshuffling, but this
- * doesn't hurt and keeps the code simple.
+ /* Find a suitable start address. Try 1MB boundaries,
+ * starting from the downloaded kernel image itself and
+ * working downwards until we hit an available region.
*/
- if ( ( rc = initrd_reshuffle_check ( len, bottom ) ) != 0 ) {
- DBGC ( image, "bzImage %p failed reshuffle check: %s\n",
- image, strerror ( rc ) );
- return rc;
- }
-
- /* Check that total length fits within kernel's memory limit */
- if ( user_to_phys ( bottom, len ) > bzimg->mem_limit ) {
- DBGC ( image, "bzImage %p not enough space for initrds\n",
- image );
- return -ENOBUFS;
- }
-
- return 0;
-}
-
-/**
- * Load initrds, if any
- *
- * @v image bzImage image
- * @v bzimg bzImage context
- */
-static void bzimage_load_initrds ( struct image *image,
- struct bzimage_context *bzimg ) {
- struct image *initrd;
- struct image *highest = NULL;
- struct image *other;
- userptr_t top;
- userptr_t dest;
- size_t len;
-
- /* Reshuffle initrds into desired order */
- initrd_reshuffle ( userptr_add ( bzimg->pm_kernel, bzimg->pm_sz ) );
-
- /* Find highest initrd */
- for_each_image ( initrd ) {
- if ( ( highest == NULL ) ||
- ( userptr_sub ( initrd->data, highest->data ) > 0 ) ) {
- highest = initrd;
+ for ( address = ( user_to_phys ( image->data, 0 ) & ~0xfffff ) ; ;
+ address -= 0x100000 ) {
+ /* Check that we're not going to overwrite the
+ * kernel itself. This check isn't totally
+ * accurate, but errs on the side of caution.
+ */
+ if ( address <= ( BZI_LOAD_HIGH_ADDR + image->len ) ) {
+ DBGC ( image, "bzImage %p could not find a location "
+ "for initrd\n", image );
+ return -ENOBUFS;
}
+ /* Check that we are within the kernel's range */
+ if ( ( address + total_len - 1 ) > bzimg->mem_limit )
+ continue;
+ /* Prepare and verify segment */
+ if ( ( rc = prep_segment ( phys_to_user ( address ), 0,
+ total_len ) ) != 0 )
+ continue;
+ /* Use this address */
+ break;
}
- /* Do nothing if there are no initrds */
- if ( ! highest )
- return;
-
- /* Find highest usable address */
- top = userptr_add ( highest->data,
- ( ( highest->len + INITRD_ALIGN - 1 ) &
- ~( INITRD_ALIGN - 1 ) ) );
- if ( user_to_phys ( top, 0 ) > bzimg->mem_limit )
- top = phys_to_user ( bzimg->mem_limit );
- DBGC ( image, "bzImage %p loading initrds from %#08lx downwards\n",
- image, user_to_phys ( top, 0 ) );
+ /* Record initrd location */
+ bzimg->ramdisk_image = address;
+ bzimg->ramdisk_size = total_len;
- /* Load initrds in order */
+ /* Construct initrd */
+ DBGC ( image, "bzImage %p constructing initrd at [%lx,%lx)\n",
+ image, address, ( address + total_len ) );
for_each_image ( initrd ) {
-
- /* Calculate cumulative length of following
- * initrds (including padding).
- */
- len = 0;
- for_each_image ( other ) {
- if ( other == initrd )
- len = 0;
- len += bzimage_load_initrd ( image, other, UNULL );
- }
-
- /* Load initrd at this address */
- dest = userptr_add ( top, -len );
- bzimage_load_initrd ( image, initrd, dest );
-
- /* Record initrd location */
- if ( ! bzimg->ramdisk_image ) {
- bzimg->ramdisk_image = user_to_phys ( dest, 0 );
- bzimg->ramdisk_size = len;
- }
+ address += bzimage_load_initrd ( image, initrd,
+ phys_to_user ( address ) );
}
+
+ return 0;
}
/**
@@ -568,37 +472,33 @@
return rc;
}
- /* Parse command line for bootloader parameters */
- if ( ( rc = bzimage_parse_cmdline ( image, &bzimg, cmdline ) ) != 0)
- return rc;
-
- /* Check that initrds can be loaded */
- if ( ( rc = bzimage_check_initrds ( image, &bzimg ) ) != 0 )
- return rc;
-
- /* Remove kernel from image list (without invalidating image pointer) */
- unregister_image ( image_get ( image ) );
-
/* Load segments */
memcpy_user ( bzimg.rm_kernel, 0, image->data,
0, bzimg.rm_filesz );
memcpy_user ( bzimg.pm_kernel, 0, image->data,
bzimg.rm_filesz, bzimg.pm_sz );
- /* Store command line */
- bzimage_set_cmdline ( image, &bzimg, cmdline );
+ /* Update and write out header */
+ bzimage_update_header ( image, &bzimg, bzimg.rm_kernel );
- /* Prepare for exiting. Must do this before loading initrds,
- * since loading the initrds will corrupt the external heap.
- */
- shutdown_boot();
+ /* Parse command line for bootloader parameters */
+ if ( ( rc = bzimage_parse_cmdline ( image, &bzimg, cmdline ) ) != 0)
+ return rc;
+
+ /* Store command line */
+ if ( ( rc = bzimage_set_cmdline ( image, &bzimg, cmdline ) ) != 0 )
+ return rc;
/* Load any initrds */
- bzimage_load_initrds ( image, &bzimg );
+ if ( ( rc = bzimage_load_initrds ( image, &bzimg ) ) != 0 )
+ return rc;
/* Update kernel header */
bzimage_update_header ( image, &bzimg, bzimg.rm_kernel );
+ /* Prepare for exiting */
+ shutdown_boot();
+
DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
"(stack %04x:%04zx)\n", image, ( bzimg.rm_kernel_seg + 0x20 ),
bzimg.rm_kernel_seg, bzimg.rm_heap );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/com32.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/com32.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/com32.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/com32.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/comboot.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/comboot.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/comboot.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/comboot.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
@@ -229,7 +228,7 @@
++ext;
- if ( strcasecmp( ext, "cbt" ) ) {
+ if ( strcasecmp( ext, "com" ) && strcasecmp( ext, "cbt" ) ) {
DBGC ( image, "COMBOOT %p: unrecognized extension %s\n",
image, ext );
return -ENOEXEC;
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/elfboot.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/elfboot.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/elfboot.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/elfboot.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -43,11 +42,10 @@
*/
static int elfboot_exec ( struct image *image ) {
physaddr_t entry;
- physaddr_t max;
int rc;
/* Load the image using core ELF support */
- if ( ( rc = elf_load ( image, &entry, &max ) ) != 0 ) {
+ if ( ( rc = elf_load ( image, &entry ) ) != 0 ) {
DBGC ( image, "ELF %p could not load: %s\n",
image, strerror ( rc ) );
return rc;
@@ -60,11 +58,10 @@
/* Jump to OS with flat physical addressing */
DBGC ( image, "ELF %p starting execution at %lx\n", image, entry );
- __asm__ __volatile__ ( PHYS_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "call *%%edi\n\t"
- "popl %%ebp\n\t" /* gcc bug */ )
+ __asm__ __volatile__ ( PHYS_CODE ( "call *%%edi\n\t" )
: : "D" ( entry )
- : "eax", "ebx", "ecx", "edx", "esi", "memory" );
+ : "eax", "ebx", "ecx", "edx", "esi", "ebp",
+ "memory" );
DBGC ( image, "ELF %p returned\n", image );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/initrd.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/initrd.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/initrd.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/initrd.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,300 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** @file
- *
- * Initial ramdisk (initrd) reshuffling
- *
- */
-
-/** Maximum address available for initrd */
-userptr_t initrd_top;
-
-/** Minimum address available for initrd */
-userptr_t initrd_bottom;
-
-/**
- * Squash initrds as high as possible in memory
- *
- * @v top Highest possible address
- * @ret used Lowest address used by initrds
- */
-static userptr_t initrd_squash_high ( userptr_t top ) {
- userptr_t current = top;
- struct image *initrd;
- struct image *highest;
- size_t len;
-
- /* Squash up any initrds already within or below the region */
- while ( 1 ) {
-
- /* Find the highest image not yet in its final position */
- highest = NULL;
- for_each_image ( initrd ) {
- if ( ( userptr_sub ( initrd->data, current ) < 0 ) &&
- ( ( highest == NULL ) ||
- ( userptr_sub ( initrd->data,
- highest->data ) > 0 ) ) ) {
- highest = initrd;
- }
- }
- if ( ! highest )
- break;
-
- /* Move this image to its final position */
- len = ( ( highest->len + INITRD_ALIGN - 1 ) &
- ~( INITRD_ALIGN - 1 ) );
- current = userptr_sub ( current, len );
- DBGC ( &images, "INITRD squashing %s [%#08lx,%#08lx)->"
- "[%#08lx,%#08lx)\n", highest->name,
- user_to_phys ( highest->data, 0 ),
- user_to_phys ( highest->data, highest->len ),
- user_to_phys ( current, 0 ),
- user_to_phys ( current, highest->len ) );
- memmove_user ( current, 0, highest->data, 0, highest->len );
- highest->data = current;
- }
-
- /* Copy any remaining initrds (e.g. embedded images) to the region */
- for_each_image ( initrd ) {
- if ( userptr_sub ( initrd->data, top ) >= 0 ) {
- len = ( ( initrd->len + INITRD_ALIGN - 1 ) &
- ~( INITRD_ALIGN - 1 ) );
- current = userptr_sub ( current, len );
- DBGC ( &images, "INITRD copying %s [%#08lx,%#08lx)->"
- "[%#08lx,%#08lx)\n", initrd->name,
- user_to_phys ( initrd->data, 0 ),
- user_to_phys ( initrd->data, initrd->len ),
- user_to_phys ( current, 0 ),
- user_to_phys ( current, initrd->len ) );
- memcpy_user ( current, 0, initrd->data, 0,
- initrd->len );
- initrd->data = current;
- }
- }
-
- return current;
-}
-
-/**
- * Swap position of two adjacent initrds
- *
- * @v low Lower initrd
- * @v high Higher initrd
- * @v free Free space
- * @v free_len Length of free space
- */
-static void initrd_swap ( struct image *low, struct image *high,
- userptr_t free, size_t free_len ) {
- size_t len = 0;
- size_t frag_len;
- size_t new_len;
-
- DBGC ( &images, "INITRD swapping %s [%#08lx,%#08lx)<->[%#08lx,%#08lx) "
- "%s\n", low->name, user_to_phys ( low->data, 0 ),
- user_to_phys ( low->data, low->len ),
- user_to_phys ( high->data, 0 ),
- user_to_phys ( high->data, high->len ), high->name );
-
- /* Round down length of free space */
- free_len &= ~( INITRD_ALIGN - 1 );
- assert ( free_len > 0 );
-
- /* Swap image data */
- while ( len < high->len ) {
-
- /* Calculate maximum fragment length */
- frag_len = ( high->len - len );
- if ( frag_len > free_len )
- frag_len = free_len;
- new_len = ( ( len + frag_len + INITRD_ALIGN - 1 ) &
- ~( INITRD_ALIGN - 1 ) );
-
- /* Swap fragments */
- memcpy_user ( free, 0, high->data, len, frag_len );
- memmove_user ( low->data, new_len, low->data, len, low->len );
- memcpy_user ( low->data, len, free, 0, frag_len );
- len = new_len;
- }
-
- /* Adjust data pointers */
- high->data = low->data;
- low->data = userptr_add ( low->data, len );
-}
-
-/**
- * Swap position of any two adjacent initrds not currently in the correct order
- *
- * @v free Free space
- * @v free_len Length of free space
- * @ret swapped A pair of initrds was swapped
- */
-static int initrd_swap_any ( userptr_t free, size_t free_len ) {
- struct image *low;
- struct image *high;
- size_t padded_len;
- userptr_t adjacent;
-
- /* Find any pair of initrds that can be swapped */
- for_each_image ( low ) {
-
- /* Calculate location of adjacent image (if any) */
- padded_len = ( ( low->len + INITRD_ALIGN - 1 ) &
- ~( INITRD_ALIGN - 1 ) );
- adjacent = userptr_add ( low->data, padded_len );
-
- /* Search for adjacent image */
- for_each_image ( high ) {
-
- /* If we have found the adjacent image, swap and exit */
- if ( high->data == adjacent ) {
- initrd_swap ( low, high, free, free_len );
- return 1;
- }
-
- /* Stop search if all remaining potential
- * adjacent images are already in the correct
- * order.
- */
- if ( high == low )
- break;
- }
- }
-
- /* Nothing swapped */
- return 0;
-}
-
-/**
- * Dump initrd locations (for debug)
- *
- */
-static void initrd_dump ( void ) {
- struct image *initrd;
-
- /* Do nothing unless debugging is enabled */
- if ( ! DBG_LOG )
- return;
-
- /* Dump initrd locations */
- for_each_image ( initrd ) {
- DBGC ( &images, "INITRD %s at [%#08lx,%#08lx)\n",
- initrd->name, user_to_phys ( initrd->data, 0 ),
- user_to_phys ( initrd->data, initrd->len ) );
- DBGC2_MD5A ( &images, user_to_phys ( initrd->data, 0 ),
- user_to_virt ( initrd->data, 0 ), initrd->len );
- }
-}
-
-/**
- * Reshuffle initrds into desired order at top of memory
- *
- * @v bottom Lowest address available for initrds
- *
- * After this function returns, the initrds have been rearranged in
- * memory and the external heap structures will have been corrupted.
- * Reshuffling must therefore take place immediately prior to jumping
- * to the loaded OS kernel; no further execution within iPXE is
- * permitted.
- */
-void initrd_reshuffle ( userptr_t bottom ) {
- userptr_t top;
- userptr_t used;
- userptr_t free;
- size_t free_len;
-
- /* Calculate limits of available space for initrds */
- top = initrd_top;
- if ( userptr_sub ( initrd_bottom, bottom ) > 0 )
- bottom = initrd_bottom;
-
- /* Debug */
- DBGC ( &images, "INITRD region [%#08lx,%#08lx)\n",
- user_to_phys ( bottom, 0 ), user_to_phys ( top, 0 ) );
- initrd_dump();
-
- /* Squash initrds as high as possible in memory */
- used = initrd_squash_high ( top );
-
- /* Calculate available free space */
- free = bottom;
- free_len = userptr_sub ( used, free );
-
- /* Bubble-sort initrds into desired order */
- while ( initrd_swap_any ( free, free_len ) ) {}
-
- /* Debug */
- initrd_dump();
-}
-
-/**
- * Check that there is enough space to reshuffle initrds
- *
- * @v len Total length of initrds (including padding)
- * @v bottom Lowest address available for initrds
- * @ret rc Return status code
- */
-int initrd_reshuffle_check ( size_t len, userptr_t bottom ) {
- userptr_t top;
- size_t available;
-
- /* Calculate limits of available space for initrds */
- top = initrd_top;
- if ( userptr_sub ( initrd_bottom, bottom ) > 0 )
- bottom = initrd_bottom;
- available = userptr_sub ( top, bottom );
-
- /* Allow for a sensible minimum amount of free space */
- len += INITRD_MIN_FREE_LEN;
-
- /* Check for available space */
- return ( ( len < available ) ? 0 : -ENOBUFS );
-}
-
-/**
- * initrd startup function
- *
- */
-static void initrd_startup ( void ) {
- size_t len;
-
- /* Record largest memory block available. Do this after any
- * allocations made during driver startup (e.g. large host
- * memory blocks for Infiniband devices, which may still be in
- * use at the time of rearranging if a SAN device is hooked)
- * but before any allocations for downloaded images (which we
- * can safely reuse when rearranging).
- */
- len = largest_memblock ( &initrd_bottom );
- initrd_top = userptr_add ( initrd_bottom, len );
-}
-
-/** initrd startup function */
-struct startup_fn startup_initrd __startup_fn ( STARTUP_LATE ) = {
- .startup = initrd_startup,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/multiboot.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/multiboot.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/multiboot.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/multiboot.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -38,8 +37,6 @@
#include
#include
#include
-#include
-#include
FEATURE ( FEATURE_IMAGE, "MBOOT", DHCP_EB_FEATURE_MULTIBOOT, 1 );
@@ -142,60 +139,53 @@
/**
* Add command line in base memory
*
- * @v image Image
+ * @v imgname Image name
+ * @v cmdline Command line
* @ret physaddr Physical address of command line
*/
-static physaddr_t multiboot_add_cmdline ( struct image *image ) {
- char *mb_cmdline = ( mb_cmdlines + mb_cmdline_offset );
- size_t remaining = ( sizeof ( mb_cmdlines ) - mb_cmdline_offset );
- char *buf = mb_cmdline;
- size_t len;
-
- /* Copy image URI to base memory buffer as start of command line */
- len = ( unparse_uri ( buf, remaining, image->uri,
- URI_ALL ) + 1 /* NUL */ );
- if ( len > remaining )
- len = remaining;
- mb_cmdline_offset += len;
- buf += len;
- remaining -= len;
-
- /* Copy command line to base memory buffer, if present */
- if ( image->cmdline ) {
- mb_cmdline_offset--; /* Strip NUL */
- buf--;
- remaining++;
- len = ( snprintf ( buf, remaining, " %s",
- image->cmdline ) + 1 /* NUL */ );
- if ( len > remaining )
- len = remaining;
- mb_cmdline_offset += len;
- }
+physaddr_t multiboot_add_cmdline ( const char *imgname, const char *cmdline ) {
+ char *mb_cmdline;
+
+ if ( ! cmdline )
+ cmdline = "";
+
+ /* Copy command line to base memory buffer */
+ mb_cmdline = ( mb_cmdlines + mb_cmdline_offset );
+ mb_cmdline_offset +=
+ ( snprintf ( mb_cmdline,
+ ( sizeof ( mb_cmdlines ) - mb_cmdline_offset ),
+ "%s %s", imgname, cmdline ) + 1 );
+
+ /* Truncate to terminating NUL in buffer if necessary */
+ if ( mb_cmdline_offset > sizeof ( mb_cmdlines ) )
+ mb_cmdline_offset = ( sizeof ( mb_cmdlines ) - 1 );
return virt_to_phys ( mb_cmdline );
}
/**
- * Add multiboot modules
+ * Build multiboot module list
*
* @v image Multiboot image
- * @v start Start address for modules
- * @v mbinfo Multiboot information structure
- * @v modules Multiboot module list
- * @ret rc Return status code
+ * @v modules Module list to fill, or NULL
+ * @ret count Number of modules
*/
-static int multiboot_add_modules ( struct image *image, physaddr_t start,
- struct multiboot_info *mbinfo,
- struct multiboot_module *modules,
- unsigned int limit ) {
+static unsigned int
+multiboot_build_module_list ( struct image *image,
+ struct multiboot_module *modules,
+ unsigned int limit ) {
struct image *module_image;
struct multiboot_module *module;
- int rc;
+ unsigned int count = 0;
+ unsigned int insert;
+ physaddr_t start;
+ physaddr_t end;
+ unsigned int i;
/* Add each image as a multiboot module */
for_each_image ( module_image ) {
- if ( mbinfo->mods_count >= limit ) {
+ if ( count >= limit ) {
DBGC ( image, "MULTIBOOT %p limit of %d modules "
"reached\n", image, limit );
break;
@@ -205,36 +195,38 @@
if ( module_image == image )
continue;
- /* Page-align the module */
- start = ( ( start + 0xfff ) & ~0xfff );
-
- /* Prepare segment */
- if ( ( rc = prep_segment ( phys_to_user ( start ),
- module_image->len,
- module_image->len ) ) != 0 ) {
- DBGC ( image, "MULTIBOOT %p could not prepare module "
- "%s: %s\n", image, module_image->name,
- strerror ( rc ) );
- return rc;
+ /* At least some OSes expect the multiboot modules to
+ * be in ascending order, so we have to support it.
+ */
+ start = user_to_phys ( module_image->data, 0 );
+ end = user_to_phys ( module_image->data, module_image->len );
+ for ( insert = 0 ; insert < count ; insert++ ) {
+ if ( start < modules[insert].mod_start )
+ break;
}
-
- /* Copy module */
- memcpy_user ( phys_to_user ( start ), 0,
- module_image->data, 0, module_image->len );
-
- /* Add module to list */
- module = &modules[mbinfo->mods_count++];
+ module = &modules[insert];
+ memmove ( ( module + 1 ), module,
+ ( ( count - insert ) * sizeof ( *module ) ) );
module->mod_start = start;
- module->mod_end = ( start + module_image->len );
- module->string = multiboot_add_cmdline ( module_image );
+ module->mod_end = end;
+ module->string = multiboot_add_cmdline ( module_image->name,
+ module_image->cmdline );
module->reserved = 0;
- DBGC ( image, "MULTIBOOT %p module %s is [%x,%x)\n",
- image, module_image->name, module->mod_start,
- module->mod_end );
- start += module_image->len;
+
+ /* We promise to page-align modules */
+ assert ( ( module->mod_start & 0xfff ) == 0 );
+
+ count++;
}
- return 0;
+ /* Dump module configuration */
+ for ( i = 0 ; i < count ; i++ ) {
+ DBGC ( image, "MULTIBOOT %p module %d is [%x,%x)\n",
+ image, i, modules[i].mod_start,
+ modules[i].mod_end );
+ }
+
+ return count;
}
/**
@@ -248,7 +240,7 @@
#define mbinfo __use_data16 ( mbinfo )
/** The multiboot bootloader name */
-static char __bss16_array ( mb_bootloader_name, [32] );
+static char __data16_array ( mb_bootloader_name, [] ) = "iPXE " VERSION;
#define mb_bootloader_name __use_data16 ( mb_bootloader_name )
/** The multiboot memory map */
@@ -313,12 +305,11 @@
* @v image Multiboot file
* @v hdr Multiboot header descriptor
* @ret entry Entry point
- * @ret max Maximum used address
* @ret rc Return status code
*/
static int multiboot_load_raw ( struct image *image,
struct multiboot_header_info *hdr,
- physaddr_t *entry, physaddr_t *max ) {
+ physaddr_t *entry ) {
size_t offset;
size_t filesz;
size_t memsz;
@@ -349,9 +340,8 @@
/* Copy image to segment */
memcpy_user ( buffer, 0, image->data, offset, filesz );
- /* Record execution entry point and maximum used address */
+ /* Record execution entry point */
*entry = hdr->mb.entry_addr;
- *max = ( hdr->mb.load_addr + memsz );
return 0;
}
@@ -361,15 +351,13 @@
*
* @v image Multiboot file
* @ret entry Entry point
- * @ret max Maximum used address
* @ret rc Return status code
*/
-static int multiboot_load_elf ( struct image *image, physaddr_t *entry,
- physaddr_t *max ) {
+static int multiboot_load_elf ( struct image *image, physaddr_t *entry ) {
int rc;
/* Load ELF image*/
- if ( ( rc = elf_load ( image, entry, max ) ) != 0 ) {
+ if ( ( rc = elf_load ( image, entry ) ) != 0 ) {
DBGC ( image, "MULTIBOOT %p ELF image failed to load: %s\n",
image, strerror ( rc ) );
return rc;
@@ -387,7 +375,6 @@
static int multiboot_exec ( struct image *image ) {
struct multiboot_header_info hdr;
physaddr_t entry;
- physaddr_t max;
int rc;
/* Locate multiboot header, if present */
@@ -409,8 +396,8 @@
* the ELF header if present, and Solaris relies on this
* behaviour.
*/
- if ( ( ( rc = multiboot_load_elf ( image, &entry, &max ) ) != 0 ) &&
- ( ( rc = multiboot_load_raw ( image, &hdr, &entry, &max ) ) != 0 ))
+ if ( ( ( rc = multiboot_load_elf ( image, &entry ) ) != 0 ) &&
+ ( ( rc = multiboot_load_raw ( image, &hdr, &entry ) ) != 0 ) )
return rc;
/* Populate multiboot information structure */
@@ -418,16 +405,12 @@
mbinfo.flags = ( MBI_FLAG_LOADER | MBI_FLAG_MEM | MBI_FLAG_MMAP |
MBI_FLAG_CMDLINE | MBI_FLAG_MODS );
mb_cmdline_offset = 0;
- mbinfo.cmdline = multiboot_add_cmdline ( image );
+ mbinfo.cmdline = multiboot_add_cmdline ( image->name, image->cmdline );
+ mbinfo.mods_count = multiboot_build_module_list ( image, mbmodules,
+ ( sizeof(mbmodules) / sizeof(mbmodules[0]) ) );
mbinfo.mods_addr = virt_to_phys ( mbmodules );
mbinfo.mmap_addr = virt_to_phys ( mbmemmap );
- snprintf ( mb_bootloader_name, sizeof ( mb_bootloader_name ),
- "iPXE %s", product_version );
mbinfo.boot_loader_name = virt_to_phys ( mb_bootloader_name );
- if ( ( rc = multiboot_add_modules ( image, max, &mbinfo, mbmodules,
- ( sizeof ( mbmodules ) /
- sizeof ( mbmodules[0] ) ) ) ) !=0)
- return rc;
/* Multiboot images may not return and have no callback
* interface, so shut everything down prior to booting the OS.
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/nbi.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/nbi.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/nbi.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/nbi.c 2012-01-06 23:49:04.000000000 +0000
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
/** @file
*
@@ -95,6 +94,12 @@
uint16_t flags; /* Bit flags */
};
+/** Info passed to NBI image */
+static struct ebinfo loaderinfo = {
+ VERSION_MAJOR, VERSION_MINOR,
+ 0
+};
+
/**
* Prepare a segment for an NBI image
*
@@ -248,8 +253,7 @@
imgheader->execaddr.segoff.offset );
__asm__ __volatile__ (
- REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "pushw %%ds\n\t" /* far pointer to bootp data */
+ REAL_CODE ( "pushw %%ds\n\t" /* far pointer to bootp data */
"pushw %%bx\n\t"
"pushl %%esi\n\t" /* location */
"pushw %%cs\n\t" /* lcall execaddr */
@@ -259,14 +263,13 @@
"pushl %%edi\n\t"
"lret\n\t"
"\n2:\n\t"
- "addw $8,%%sp\n\t" /* clean up stack */
- "popl %%ebp\n\t" /* gcc bug */ )
+ "addw $8,%%sp\n\t" /* clean up stack */ )
: "=a" ( rc ), "=D" ( discard_D ), "=S" ( discard_S ),
"=b" ( discard_b )
: "D" ( imgheader->execaddr.segoff ),
"S" ( imgheader->location ),
"b" ( __from_data16 ( basemem_packet ) )
- : "ecx", "edx" );
+ : "ecx", "edx", "ebp" );
return rc;
}
@@ -278,10 +281,6 @@
* @ret rc Return status code, if image returns
*/
static int nbi_boot32 ( struct image *image, struct imgheader *imgheader ) {
- struct ebinfo loaderinfo = {
- product_major_version, product_minor_version,
- 0
- };
int discard_D, discard_S, discard_b;
int rc;
@@ -290,13 +289,11 @@
/* Jump to OS with flat physical addressing */
__asm__ __volatile__ (
- PHYS_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "pushl %%ebx\n\t" /* bootp data */
+ PHYS_CODE ( "pushl %%ebx\n\t" /* bootp data */
"pushl %%esi\n\t" /* imgheader */
"pushl %%eax\n\t" /* loaderinfo */
"call *%%edi\n\t"
- "addl $12, %%esp\n\t" /* clean up stack */
- "popl %%ebp\n\t" /* gcc bug */ )
+ "addl $12, %%esp\n\t" /* clean up stack */ )
: "=a" ( rc ), "=D" ( discard_D ), "=S" ( discard_S ),
"=b" ( discard_b )
: "D" ( imgheader->execaddr.linear ),
@@ -304,7 +301,7 @@
imgheader->location.offset ),
"b" ( virt_to_phys ( basemem_packet ) ),
"a" ( virt_to_phys ( &loaderinfo ) )
- : "ecx", "edx", "memory" );
+ : "ecx", "edx", "ebp", "memory" );
return rc;
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/pxe_image.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/pxe_image.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/pxe_image.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/pxe_image.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -36,9 +35,6 @@
FEATURE ( FEATURE_IMAGE, "PXE", DHCP_EB_FEATURE_PXE, 1 );
-/** PXE command line */
-const char *pxe_cmdline;
-
/**
* Execute PXE image
*
@@ -66,29 +62,16 @@
image );
return -ENODEV;
}
- netdev_get ( netdev );
/* Activate PXE */
pxe_activate ( netdev );
- /* Set PXE command line */
- pxe_cmdline = image->cmdline;
-
/* Start PXE NBP */
rc = pxe_start_nbp();
- /* Clear PXE command line */
- pxe_cmdline = NULL;
-
/* Deactivate PXE */
pxe_deactivate();
- /* Try to reopen network device. Ignore errors, since the NBP
- * may have called PXENV_STOP_UNDI.
- */
- netdev_open ( netdev );
- netdev_put ( netdev );
-
return rc;
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/sdi.c ipxe-1.0.1~lliurex1505/src/arch/i386/image/sdi.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/image/sdi.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/image/sdi.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** @file
- *
- * System Deployment Image (SDI)
- *
- * Based on the MSDN article "RAM boot using SDI in Windows XP
- * Embedded with Service Pack 1", available at the time of writing
- * from:
- *
- * http://msdn.microsoft.com/en-us/library/ms838543.aspx
- */
-
-FEATURE ( FEATURE_IMAGE, "SDI", DHCP_EB_FEATURE_SDI, 1 );
-
-/**
- * Parse SDI image header
- *
- * @v image SDI file
- * @v sdi SDI header to fill in
- * @ret rc Return status code
- */
-static int sdi_parse_header ( struct image *image, struct sdi_header *sdi ) {
-
- /* Sanity check */
- if ( image->len < sizeof ( *sdi ) ) {
- DBGC ( image, "SDI %p too short for SDI header\n", image );
- return -ENOEXEC;
- }
-
- /* Read in header */
- copy_from_user ( sdi, image->data, 0, sizeof ( *sdi ) );
-
- /* Check signature */
- if ( sdi->magic != SDI_MAGIC ) {
- DBGC ( image, "SDI %p is not an SDI image\n", image );
- return -ENOEXEC;
- }
-
- return 0;
-}
-
-/**
- * Execute SDI image
- *
- * @v image SDI file
- * @ret rc Return status code
- */
-static int sdi_exec ( struct image *image ) {
- struct sdi_header sdi;
- uint32_t sdiptr;
- int rc;
-
- /* Parse image header */
- if ( ( rc = sdi_parse_header ( image, &sdi ) ) != 0 )
- return rc;
-
- /* Check that image is bootable */
- if ( sdi.boot_size == 0 ) {
- DBGC ( image, "SDI %p is not bootable\n", image );
- return -ENOTTY;
- }
- DBGC ( image, "SDI %p image at %08lx+%08zx\n",
- image, user_to_phys ( image->data, 0 ), image->len );
- DBGC ( image, "SDI %p boot code at %08lx+%llx\n", image,
- user_to_phys ( image->data, sdi.boot_offset ), sdi.boot_size );
-
- /* Copy boot code */
- memcpy_user ( real_to_user ( SDI_BOOT_SEG, SDI_BOOT_OFF ), 0,
- image->data, sdi.boot_offset, sdi.boot_size );
-
- /* Jump to boot code */
- sdiptr = ( user_to_phys ( image->data, 0 ) | SDI_WTF );
- __asm__ __volatile__ ( REAL_CODE ( "ljmp %0, %1\n\t" )
- : : "i" ( SDI_BOOT_SEG ),
- "i" ( SDI_BOOT_OFF ),
- "d" ( sdiptr ) );
-
- /* There is no way for the image to return, since we provide
- * no return address.
- */
- assert ( 0 );
-
- return -ECANCELED; /* -EIMPOSSIBLE */
-}
-
-/**
- * Probe SDI image
- *
- * @v image SDI file
- * @ret rc Return status code
- */
-static int sdi_probe ( struct image *image ) {
- struct sdi_header sdi;
- int rc;
-
- /* Parse image */
- if ( ( rc = sdi_parse_header ( image, &sdi ) ) != 0 )
- return rc;
-
- return 0;
-}
-
-/** SDI image type */
-struct image_type sdi_image_type __image_type ( PROBE_NORMAL ) = {
- .name = "SDI",
- .probe = sdi_probe,
- .exec = sdi_exec,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bios.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bios.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bios.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bios.h 2012-01-06 23:49:04.000000000 +0000
@@ -4,10 +4,7 @@
FILE_LICENCE ( GPL2_OR_LATER );
#define BDA_SEG 0x0040
-#define BDA_EQUIPMENT_WORD 0x0010
#define BDA_FBMS 0x0013
-#define BDA_REBOOT 0x0072
-#define BDA_REBOOT_WARM 0x1234
#define BDA_NUM_DRIVES 0x0075
#endif /* BIOS_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/byteswap.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/byteswap.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/byteswap.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/byteswap.h 2012-01-06 23:49:04.000000000 +0000
@@ -1,70 +1,43 @@
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H
-
-/** @file
- *
- * Byte-order swapping functions
- *
- */
-
-#include
+#ifndef ETHERBOOT_BITS_BYTESWAP_H
+#define ETHERBOOT_BITS_BYTESWAP_H
FILE_LICENCE ( GPL2_OR_LATER );
-static inline __attribute__ (( always_inline, const )) uint16_t
-__bswap_variable_16 ( uint16_t x ) {
- __asm__ ( "xchgb %b0,%h0" : "=q" ( x ) : "0" ( x ) );
+static inline __attribute__ ((always_inline, const)) uint16_t
+__bswap_variable_16(uint16_t x)
+{
+ __asm__("xchgb %b0,%h0\n\t"
+ : "=q" (x)
+ : "0" (x));
return x;
}
-static inline __attribute__ (( always_inline )) void
-__bswap_16s ( uint16_t *x ) {
- __asm__ ( "rorw $8, %0" : "+m" ( *x ) );
-}
-
-static inline __attribute__ (( always_inline, const )) uint32_t
-__bswap_variable_32 ( uint32_t x ) {
- __asm__ ( "bswapl %0" : "=r" ( x ) : "0" ( x ) );
+static inline __attribute__ ((always_inline, const)) uint32_t
+__bswap_variable_32(uint32_t x)
+{
+ __asm__("xchgb %b0,%h0\n\t"
+ "rorl $16,%0\n\t"
+ "xchgb %b0,%h0"
+ : "=q" (x)
+ : "0" (x));
return x;
}
-static inline __attribute__ (( always_inline )) void
-__bswap_32s ( uint32_t *x ) {
- __asm__ ( "bswapl %0" : "=r" ( *x ) : "0" ( *x ) );
-}
-
-static inline __attribute__ (( always_inline, const )) uint64_t
-__bswap_variable_64 ( uint64_t x ) {
- uint32_t in_high = ( x >> 32 );
- uint32_t in_low = ( x & 0xffffffffUL );
- uint32_t out_high;
- uint32_t out_low;
-
- __asm__ ( "bswapl %0\n\t"
- "bswapl %1\n\t"
- "xchgl %0,%1\n\t"
- : "=r" ( out_high ), "=r" ( out_low )
- : "0" ( in_high ), "1" ( in_low ) );
-
- return ( ( ( ( uint64_t ) out_high ) << 32 ) |
- ( ( uint64_t ) out_low ) );
-}
-
-static inline __attribute__ (( always_inline )) void
-__bswap_64s ( uint64_t *x ) {
- struct {
- uint32_t __attribute__ (( may_alias )) low;
- uint32_t __attribute__ (( may_alias )) high;
- } __attribute__ (( may_alias )) *dwords = ( ( void * ) x );
- uint32_t discard;
-
- __asm__ ( "movl %0,%2\n\t"
- "bswapl %2\n\t"
- "xchgl %2,%1\n\t"
- "bswapl %2\n\t"
- "movl %2,%0\n\t"
- : "+m" ( dwords->low ), "+m" ( dwords->high ),
- "=r" ( discard ) );
+static inline __attribute__ ((always_inline, const)) uint64_t
+__bswap_variable_64(uint64_t x)
+{
+ union {
+ uint64_t qword;
+ uint32_t dword[2];
+ } u;
+
+ u.qword = x;
+ u.dword[0] = __bswap_variable_32(u.dword[0]);
+ u.dword[1] = __bswap_variable_32(u.dword[1]);
+ __asm__("xchgl %0,%1"
+ : "=r" ( u.dword[0] ), "=r" ( u.dword[1] )
+ : "0" ( u.dword[0] ), "1" ( u.dword[1] ) );
+ return u.qword;
}
-#endif /* _BITS_BYTESWAP_H */
+#endif /* ETHERBOOT_BITS_BYTESWAP_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/cpu.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/cpu.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/cpu.h 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/cpu.h 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,86 @@
+#ifndef I386_BITS_CPU_H
+#define I386_BITS_CPU_H
+
+/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */
+#define X86_FEATURE_FPU 0 /* Onboard FPU */
+#define X86_FEATURE_VME 1 /* Virtual Mode Extensions */
+#define X86_FEATURE_DE 2 /* Debugging Extensions */
+#define X86_FEATURE_PSE 3 /* Page Size Extensions */
+#define X86_FEATURE_TSC 4 /* Time Stamp Counter */
+#define X86_FEATURE_MSR 5 /* Model-Specific Registers, RDMSR, WRMSR */
+#define X86_FEATURE_PAE 6 /* Physical Address Extensions */
+#define X86_FEATURE_MCE 7 /* Machine Check Architecture */
+#define X86_FEATURE_CX8 8 /* CMPXCHG8 instruction */
+#define X86_FEATURE_APIC 9 /* Onboard APIC */
+#define X86_FEATURE_SEP 11 /* SYSENTER/SYSEXIT */
+#define X86_FEATURE_MTRR 12 /* Memory Type Range Registers */
+#define X86_FEATURE_PGE 13 /* Page Global Enable */
+#define X86_FEATURE_MCA 14 /* Machine Check Architecture */
+#define X86_FEATURE_CMOV 15 /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */
+#define X86_FEATURE_PAT 16 /* Page Attribute Table */
+#define X86_FEATURE_PSE36 17 /* 36-bit PSEs */
+#define X86_FEATURE_PN 18 /* Processor serial number */
+#define X86_FEATURE_CLFLSH 19 /* Supports the CLFLUSH instruction */
+#define X86_FEATURE_DTES 21 /* Debug Trace Store */
+#define X86_FEATURE_ACPI 22 /* ACPI via MSR */
+#define X86_FEATURE_MMX 23 /* Multimedia Extensions */
+#define X86_FEATURE_FXSR 24 /* FXSAVE and FXRSTOR instructions (fast save and restore */
+ /* of FPU context), and CR4.OSFXSR available */
+#define X86_FEATURE_XMM 25 /* Streaming SIMD Extensions */
+#define X86_FEATURE_XMM2 26 /* Streaming SIMD Extensions-2 */
+#define X86_FEATURE_SELFSNOOP 27 /* CPU self snoop */
+#define X86_FEATURE_HT 28 /* Hyper-Threading */
+#define X86_FEATURE_ACC 29 /* Automatic clock control */
+#define X86_FEATURE_IA64 30 /* IA-64 processor */
+
+/* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
+/* Don't duplicate feature flags which are redundant with Intel! */
+#define X86_FEATURE_SYSCALL 11 /* SYSCALL/SYSRET */
+#define X86_FEATURE_MMXEXT 22 /* AMD MMX extensions */
+#define X86_FEATURE_LM 29 /* Long Mode (x86-64) */
+#define X86_FEATURE_3DNOWEXT 30 /* AMD 3DNow! extensions */
+#define X86_FEATURE_3DNOW 31 /* 3DNow! */
+
+/** x86 CPU information */
+struct cpuinfo_x86 {
+ /** CPU features */
+ unsigned int features;
+ /** 64-bit CPU features */
+ unsigned int amd_features;
+};
+
+/*
+ * EFLAGS bits
+ */
+#define X86_EFLAGS_CF 0x00000001 /* Carry Flag */
+#define X86_EFLAGS_PF 0x00000004 /* Parity Flag */
+#define X86_EFLAGS_AF 0x00000010 /* Auxillary carry Flag */
+#define X86_EFLAGS_ZF 0x00000040 /* Zero Flag */
+#define X86_EFLAGS_SF 0x00000080 /* Sign Flag */
+#define X86_EFLAGS_TF 0x00000100 /* Trap Flag */
+#define X86_EFLAGS_IF 0x00000200 /* Interrupt Flag */
+#define X86_EFLAGS_DF 0x00000400 /* Direction Flag */
+#define X86_EFLAGS_OF 0x00000800 /* Overflow Flag */
+#define X86_EFLAGS_IOPL 0x00003000 /* IOPL mask */
+#define X86_EFLAGS_NT 0x00004000 /* Nested Task */
+#define X86_EFLAGS_RF 0x00010000 /* Resume Flag */
+#define X86_EFLAGS_VM 0x00020000 /* Virtual Mode */
+#define X86_EFLAGS_AC 0x00040000 /* Alignment Check */
+#define X86_EFLAGS_VIF 0x00080000 /* Virtual Interrupt Flag */
+#define X86_EFLAGS_VIP 0x00100000 /* Virtual Interrupt Pending */
+#define X86_EFLAGS_ID 0x00200000 /* CPUID detection flag */
+
+/*
+ * Generic CPUID function
+ */
+static inline __attribute__ (( always_inline )) void
+cpuid ( int op, unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx ) {
+ __asm__ ( "cpuid" :
+ "=a" ( *eax ), "=b" ( *ebx ), "=c" ( *ecx ), "=d" ( *edx )
+ : "0" ( op ) );
+}
+
+extern void get_cpuinfo ( struct cpuinfo_x86 *cpu );
+
+#endif /* I386_BITS_CPU_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/entropy.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/entropy.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/entropy.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/entropy.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-#ifndef _BITS_ENTROPY_H
-#define _BITS_ENTROPY_H
-
-/** @file
- *
- * i386-specific entropy API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-#endif /* _BITS_ENTROPY_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/errfile.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/errfile.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/errfile.h 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/errfile.h 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,43 @@
+#ifndef _BITS_ERRFILE_H
+#define _BITS_ERRFILE_H
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+/**
+ * @addtogroup errfile Error file identifiers
+ * @{
+ */
+
+#define ERRFILE_memtop_umalloc ( ERRFILE_ARCH | ERRFILE_CORE | 0x00000000 )
+#define ERRFILE_memmap ( ERRFILE_ARCH | ERRFILE_CORE | 0x00010000 )
+#define ERRFILE_pnpbios ( ERRFILE_ARCH | ERRFILE_CORE | 0x00020000 )
+#define ERRFILE_bios_smbios ( ERRFILE_ARCH | ERRFILE_CORE | 0x00030000 )
+#define ERRFILE_biosint ( ERRFILE_ARCH | ERRFILE_CORE | 0x00040000 )
+#define ERRFILE_int13 ( ERRFILE_ARCH | ERRFILE_CORE | 0x00050000 )
+#define ERRFILE_pxeparent ( ERRFILE_ARCH | ERRFILE_CORE | 0x00060000 )
+#define ERRFILE_runtime ( ERRFILE_ARCH | ERRFILE_CORE | 0x00070000 )
+
+#define ERRFILE_bootsector ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00000000 )
+#define ERRFILE_bzimage ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00010000 )
+#define ERRFILE_eltorito ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00020000 )
+#define ERRFILE_multiboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00030000 )
+#define ERRFILE_nbi ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00040000 )
+#define ERRFILE_pxe_image ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00050000 )
+#define ERRFILE_elfboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00060000 )
+#define ERRFILE_comboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00070000 )
+#define ERRFILE_com32 ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00080000 )
+#define ERRFILE_comboot_resolv ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00090000 )
+#define ERRFILE_comboot_call ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x000a0000 )
+
+#define ERRFILE_undi ( ERRFILE_ARCH | ERRFILE_NET | 0x00000000 )
+#define ERRFILE_undiload ( ERRFILE_ARCH | ERRFILE_NET | 0x00010000 )
+#define ERRFILE_undinet ( ERRFILE_ARCH | ERRFILE_NET | 0x00020000 )
+#define ERRFILE_undionly ( ERRFILE_ARCH | ERRFILE_NET | 0x00030000 )
+#define ERRFILE_undirom ( ERRFILE_ARCH | ERRFILE_NET | 0x00040000 )
+
+#define ERRFILE_timer_rdtsc ( ERRFILE_ARCH | ERRFILE_DRIVER | 0x00000000 )
+#define ERRFILE_timer_bios ( ERRFILE_ARCH | ERRFILE_DRIVER | 0x00010000 )
+
+/** @} */
+
+#endif /* _BITS_ERRFILE_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/io.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/io.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/io.h 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/io.h 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,14 @@
+#ifndef _BITS_IO_H
+#define _BITS_IO_H
+
+/** @file
+ *
+ * i386-specific I/O API implementations
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include
+
+#endif /* _BITS_IO_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/reboot.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/reboot.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/reboot.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/reboot.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-#ifndef _BITS_REBOOT_H
-#define _BITS_REBOOT_H
-
-/** @file
- *
- * i386-specific reboot API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-#endif /* _BITS_REBOOT_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/time.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/time.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/bits/time.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/bits/time.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-#ifndef _BITS_TIME_H
-#define _BITS_TIME_H
-
-/** @file
- *
- * i386-specific time API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-#endif /* _BITS_TIME_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/initrd.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/initrd.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/initrd.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/initrd.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,30 +0,0 @@
-#ifndef _INITRD_H
-#define _INITRD_H
-
-/** @file
- *
- * Initial ramdisk (initrd) reshuffling
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-/** Minimum alignment for initrds
- *
- * Some versions of Linux complain about initrds that are not
- * page-aligned.
- */
-#define INITRD_ALIGN 4096
-
-/** Minimum free space required to reshuffle initrds
- *
- * Chosen to avoid absurdly long reshuffling times
- */
-#define INITRD_MIN_FREE_LEN ( 512 * 1024 )
-
-extern void initrd_reshuffle ( userptr_t bottom );
-extern int initrd_reshuffle_check ( size_t len, userptr_t bottom );
-
-#endif /* _INITRD_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/int13.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/int13.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/int13.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/int13.h 2012-01-06 23:49:04.000000000 +0000
@@ -71,19 +71,6 @@
/** Block size for non-extended INT 13 calls */
#define INT13_BLKSIZE 512
-/** @defgroup int13fddtype INT 13 floppy disk drive types
- * @{
- */
-
-/** 360K */
-#define INT13_FDD_TYPE_360K 0x01
-/** 1.2M */
-#define INT13_FDD_TYPE_1M2 0x02
-/** 720K */
-#define INT13_FDD_TYPE_720K 0x03
-/** 1.44M */
-#define INT13_FDD_TYPE_1M44 0x04
-
/** An INT 13 disk address packet */
struct int13_disk_address {
/** Size of the packet, in bytes */
@@ -291,43 +278,120 @@
/** MBR magic signature */
#define INT13_MBR_MAGIC 0xaa55
-/** A floppy disk geometry */
-struct int13_fdd_geometry {
- /** Number of tracks */
- uint8_t tracks;
- /** Number of heads and sectors per track */
- uint8_t heads_spt;
+/** ISO9660 block size */
+#define ISO9660_BLKSIZE 2048
+
+/** An ISO9660 Primary Volume Descriptor (fixed portion) */
+struct iso9660_primary_descriptor_fixed {
+ /** Descriptor type */
+ uint8_t type;
+ /** Identifier ("CD001") */
+ uint8_t id[5];
+} __attribute__ (( packed ));
+
+/** An ISO9660 Primary Volume Descriptor */
+struct iso9660_primary_descriptor {
+ /** Fixed portion */
+ struct iso9660_primary_descriptor_fixed fixed;
+} __attribute__ (( packed ));
+
+/** ISO9660 Primary Volume Descriptor type */
+#define ISO9660_TYPE_PRIMARY 0x01
+
+/** ISO9660 identifier */
+#define ISO9660_ID "CD001"
+
+/** ISO9660 Primary Volume Descriptor block address */
+#define ISO9660_PRIMARY_LBA 16
+
+/** An El Torito Boot Record Volume Descriptor (fixed portion) */
+struct eltorito_descriptor_fixed {
+ /** Descriptor type */
+ uint8_t type;
+ /** Identifier ("CD001") */
+ uint8_t id[5];
+ /** Version, must be 1 */
+ uint8_t version;
+ /** Boot system indicator; must be "EL TORITO SPECIFICATION" */
+ uint8_t system_id[32];
+} __attribute__ (( packed ));
+
+/** An El Torito Boot Record Volume Descriptor */
+struct eltorito_descriptor {
+ /** Fixed portion */
+ struct eltorito_descriptor_fixed fixed;
+ /** Unused */
+ uint8_t unused[32];
+ /** Boot catalog sector */
+ uint32_t sector;
+} __attribute__ (( packed ));
+
+/** ISO9660 Boot Volume Descriptor type */
+#define ISO9660_TYPE_BOOT 0x00
+
+/** El Torito Boot Record Volume Descriptor block address */
+#define ELTORITO_LBA 17
+
+/** An El Torito Boot Catalog Validation Entry */
+struct eltorito_validation_entry {
+ /** Header ID; must be 1 */
+ uint8_t header_id;
+ /** Platform ID
+ *
+ * 0 = 80x86
+ * 1 = PowerPC
+ * 2 = Mac
+ */
+ uint8_t platform_id;
+ /** Reserved */
+ uint16_t reserved;
+ /** ID string */
+ uint8_t id_string[24];
+ /** Checksum word */
+ uint16_t checksum;
+ /** Signature; must be 0xaa55 */
+ uint16_t signature;
+} __attribute__ (( packed ));
+
+/** El Torito platform IDs */
+enum eltorito_platform_id {
+ ELTORITO_PLATFORM_X86 = 0x00,
+ ELTORITO_PLATFORM_POWERPC = 0x01,
+ ELTORITO_PLATFORM_MAC = 0x02,
};
-/** Define a floppy disk geometry */
-#define INT13_FDD_GEOMETRY( cylinders, heads, sectors ) \
- { \
- .tracks = (cylinders), \
- .heads_spt = ( ( (heads) << 6 ) | (sectors) ), \
- }
-
-/** Get floppy disk number of cylinders */
-#define INT13_FDD_CYLINDERS( geometry ) ( (geometry)->tracks )
-
-/** Get floppy disk number of heads */
-#define INT13_FDD_HEADS( geometry ) ( (geometry)->heads_spt >> 6 )
-
-/** Get floppy disk number of sectors per track */
-#define INT13_FDD_SECTORS( geometry ) ( (geometry)->heads_spt & 0x3f )
-
-/** A floppy drive parameter table */
-struct int13_fdd_parameters {
- uint8_t step_rate__head_unload;
- uint8_t head_load__ndma;
- uint8_t motor_off_delay;
- uint8_t bytes_per_sector;
- uint8_t sectors_per_track;
- uint8_t gap_length;
- uint8_t data_length;
- uint8_t format_gap_length;
- uint8_t format_filler;
- uint8_t head_settle_time;
- uint8_t motor_start_time;
+/** A bootable entry in the El Torito Boot Catalog */
+struct eltorito_boot_entry {
+ /** Boot indicator
+ *
+ * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
+ */
+ uint8_t indicator;
+ /** Media type
+ *
+ */
+ uint8_t media_type;
+ /** Load segment */
+ uint16_t load_segment;
+ /** System type */
+ uint8_t filesystem;
+ /** Unused */
+ uint8_t reserved_a;
+ /** Sector count */
+ uint16_t length;
+ /** Starting sector */
+ uint32_t start;
+ /** Unused */
+ uint8_t reserved_b[20];
} __attribute__ (( packed ));
+/** Boot indicator for a bootable ISO image */
+#define ELTORITO_BOOTABLE 0x88
+
+/** El Torito media types */
+enum eltorito_media_type {
+ /** No emulation */
+ ELTORITO_NO_EMULATION = 0,
+};
+
#endif /* INT13_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/bios_reboot.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/bios_reboot.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/bios_reboot.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/bios_reboot.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,18 +0,0 @@
-#ifndef _IPXE_BIOS_REBOOT_H
-#define _IPXE_BIOS_REBOOT_H
-
-/** @file
- *
- * Standard PC-BIOS reboot mechanism
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#ifdef REBOOT_PCBIOS
-#define REBOOT_PREFIX_pcbios
-#else
-#define REBOOT_PREFIX_pcbios __pcbios_
-#endif
-
-#endif /* _IPXE_BIOS_REBOOT_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/errno/pcbios.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/errno/pcbios.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/errno/pcbios.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/errno/pcbios.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,115 +0,0 @@
-#ifndef _IPXE_ERRNO_PCBIOS_H
-#define _IPXE_ERRNO_PCBIOS_H
-
-/**
- * @file
- *
- * PC-BIOS platform error codes
- *
- * We use the PXE-specified error codes as the platform error codes
- * for the PC-BIOS platform.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-/**
- * Convert platform error code to platform component of iPXE error code
- *
- * @v platform Platform error code
- * @ret errno Platform component of iPXE error code
- */
-#define PLATFORM_TO_ERRNO( platform ) ( (platform) & 0xff )
-
-/**
- * Convert iPXE error code to platform error code
- *
- * @v errno iPXE error code
- * @ret platform Platform error code
- */
-#define ERRNO_TO_PLATFORM( errno ) ( (errno) & 0xff )
-
-/* Platform-specific error codes */
-#define PLATFORM_ENOERR PXENV_STATUS_SUCCESS
-#define PLATFORM_E2BIG PXENV_STATUS_BAD_FUNC
-#define PLATFORM_EACCES PXENV_STATUS_TFTP_ACCESS_VIOLATION
-#define PLATFORM_EADDRINUSE PXENV_STATUS_UDP_OPEN
-#define PLATFORM_EADDRNOTAVAIL PXENV_STATUS_UDP_OPEN
-#define PLATFORM_EAFNOSUPPORT PXENV_STATUS_UNSUPPORTED
-#define PLATFORM_EAGAIN PXENV_STATUS_FAILURE
-#define PLATFORM_EALREADY PXENV_STATUS_UDP_OPEN
-#define PLATFORM_EBADF PXENV_STATUS_TFTP_CLOSED
-#define PLATFORM_EBADMSG PXENV_STATUS_FAILURE
-#define PLATFORM_EBUSY PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_ECANCELED PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE
-#define PLATFORM_ECHILD PXENV_STATUS_TFTP_FILE_NOT_FOUND
-#define PLATFORM_ECONNABORTED PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION
-#define PLATFORM_ECONNREFUSED PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION
-#define PLATFORM_ECONNRESET PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION
-#define PLATFORM_EDEADLK PXENV_STATUS_FAILURE
-#define PLATFORM_EDESTADDRREQ PXENV_STATUS_BAD_FUNC
-#define PLATFORM_EDOM PXENV_STATUS_FAILURE
-#define PLATFORM_EDQUOT PXENV_STATUS_FAILURE
-#define PLATFORM_EEXIST PXENV_STATUS_FAILURE
-#define PLATFORM_EFAULT PXENV_STATUS_MCOPY_PROBLEM
-#define PLATFORM_EFBIG PXENV_STATUS_MCOPY_PROBLEM
-#define PLATFORM_EHOSTUNREACH PXENV_STATUS_ARP_TIMEOUT
-#define PLATFORM_EIDRM PXENV_STATUS_FAILURE
-#define PLATFORM_EILSEQ PXENV_STATUS_FAILURE
-#define PLATFORM_EINPROGRESS PXENV_STATUS_FAILURE
-#define PLATFORM_EINTR PXENV_STATUS_FAILURE
-#define PLATFORM_EINVAL PXENV_STATUS_BAD_FUNC
-#define PLATFORM_EIO PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION
-#define PLATFORM_EISCONN PXENV_STATUS_UDP_OPEN
-#define PLATFORM_EISDIR PXENV_STATUS_FAILURE
-#define PLATFORM_ELOOP PXENV_STATUS_FAILURE
-#define PLATFORM_EMFILE PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_EMLINK PXENV_STATUS_FAILURE
-#define PLATFORM_EMSGSIZE PXENV_STATUS_BAD_FUNC
-#define PLATFORM_EMULTIHOP PXENV_STATUS_FAILURE
-#define PLATFORM_ENAMETOOLONG PXENV_STATUS_FAILURE
-#define PLATFORM_ENETDOWN PXENV_STATUS_ARP_TIMEOUT
-#define PLATFORM_ENETRESET PXENV_STATUS_FAILURE
-#define PLATFORM_ENETUNREACH PXENV_STATUS_ARP_TIMEOUT
-#define PLATFORM_ENFILE PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_ENOBUFS PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_ENODATA PXENV_STATUS_FAILURE
-#define PLATFORM_ENODEV PXENV_STATUS_TFTP_FILE_NOT_FOUND
-#define PLATFORM_ENOENT PXENV_STATUS_TFTP_FILE_NOT_FOUND
-#define PLATFORM_ENOEXEC PXENV_STATUS_FAILURE
-#define PLATFORM_ENOLCK PXENV_STATUS_FAILURE
-#define PLATFORM_ENOLINK PXENV_STATUS_FAILURE
-#define PLATFORM_ENOMEM PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_ENOMSG PXENV_STATUS_FAILURE
-#define PLATFORM_ENOPROTOOPT PXENV_STATUS_UNSUPPORTED
-#define PLATFORM_ENOSPC PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_ENOSR PXENV_STATUS_OUT_OF_RESOURCES
-#define PLATFORM_ENOSTR PXENV_STATUS_FAILURE
-#define PLATFORM_ENOSYS PXENV_STATUS_UNSUPPORTED
-#define PLATFORM_ENOTCONN PXENV_STATUS_FAILURE
-#define PLATFORM_ENOTDIR PXENV_STATUS_FAILURE
-#define PLATFORM_ENOTEMPTY PXENV_STATUS_FAILURE
-#define PLATFORM_ENOTSOCK PXENV_STATUS_FAILURE
-#define PLATFORM_ENOTSUP PXENV_STATUS_UNSUPPORTED
-#define PLATFORM_ENOTTY PXENV_STATUS_FAILURE
-#define PLATFORM_ENXIO PXENV_STATUS_TFTP_FILE_NOT_FOUND
-#define PLATFORM_EOPNOTSUPP PXENV_STATUS_UNSUPPORTED
-#define PLATFORM_EOVERFLOW PXENV_STATUS_FAILURE
-#define PLATFORM_EPERM PXENV_STATUS_TFTP_ACCESS_VIOLATION
-#define PLATFORM_EPIPE PXENV_STATUS_FAILURE
-#define PLATFORM_EPROTO PXENV_STATUS_FAILURE
-#define PLATFORM_EPROTONOSUPPORT PXENV_STATUS_UNSUPPORTED
-#define PLATFORM_EPROTOTYPE PXENV_STATUS_FAILURE
-#define PLATFORM_ERANGE PXENV_STATUS_FAILURE
-#define PLATFORM_EROFS PXENV_STATUS_FAILURE
-#define PLATFORM_ESPIPE PXENV_STATUS_FAILURE
-#define PLATFORM_ESRCH PXENV_STATUS_TFTP_FILE_NOT_FOUND
-#define PLATFORM_ESTALE PXENV_STATUS_FAILURE
-#define PLATFORM_ETIME PXENV_STATUS_FAILURE
-#define PLATFORM_ETIMEDOUT PXENV_STATUS_TFTP_READ_TIMEOUT
-#define PLATFORM_ETXTBSY PXENV_STATUS_FAILURE
-#define PLATFORM_EWOULDBLOCK PXENV_STATUS_TFTP_OPEN
-#define PLATFORM_EXDEV PXENV_STATUS_FAILURE
-
-#endif /* _IPXE_ERRNO_PCBIOS_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/guestrpc.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/guestrpc.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/guestrpc.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/guestrpc.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,68 +0,0 @@
-#ifndef _IPXE_GUESTRPC_H
-#define _IPXE_GUESTRPC_H
-
-/** @file
- *
- * VMware GuestRPC mechanism
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-
-/** GuestRPC magic number */
-#define GUESTRPC_MAGIC 0x49435052 /* "RPCI" */
-
-/** Open RPC channel */
-#define GUESTRPC_OPEN 0x00
-
-/** Open RPC channel success status */
-#define GUESTRPC_OPEN_SUCCESS 0x00010000
-
-/** Send RPC command length */
-#define GUESTRPC_COMMAND_LEN 0x01
-
-/** Send RPC command length success status */
-#define GUESTRPC_COMMAND_LEN_SUCCESS 0x00810000
-
-/** Send RPC command data */
-#define GUESTRPC_COMMAND_DATA 0x02
-
-/** Send RPC command data success status */
-#define GUESTRPC_COMMAND_DATA_SUCCESS 0x00010000
-
-/** Receive RPC reply length */
-#define GUESTRPC_REPLY_LEN 0x03
-
-/** Receive RPC reply length success status */
-#define GUESTRPC_REPLY_LEN_SUCCESS 0x00830000
-
-/** Receive RPC reply data */
-#define GUESTRPC_REPLY_DATA 0x04
-
-/** Receive RPC reply data success status */
-#define GUESTRPC_REPLY_DATA_SUCCESS 0x00010000
-
-/** Finish receiving RPC reply */
-#define GUESTRPC_REPLY_FINISH 0x05
-
-/** Finish receiving RPC reply success status */
-#define GUESTRPC_REPLY_FINISH_SUCCESS 0x00010000
-
-/** Close RPC channel */
-#define GUESTRPC_CLOSE 0x06
-
-/** Close RPC channel success status */
-#define GUESTRPC_CLOSE_SUCCESS 0x00010000
-
-/** RPC command success status */
-#define GUESTRPC_SUCCESS 0x2031 /* "1 " */
-
-extern int guestrpc_open ( void );
-extern void guestrpc_close ( int channel );
-extern int guestrpc_command ( int channel, const char *command, char *reply,
- size_t reply_len );
-
-#endif /* _IPXE_GUESTRPC_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/rtc_entropy.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/rtc_entropy.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/rtc_entropy.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/rtc_entropy.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,62 +0,0 @@
-#ifndef _IPXE_RTC_ENTROPY_H
-#define _IPXE_RTC_ENTROPY_H
-
-/** @file
- *
- * RTC-based entropy source
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-#ifdef ENTROPY_RTC
-#define ENTROPY_PREFIX_rtc
-#else
-#define ENTROPY_PREFIX_rtc __rtc_
-#endif
-
-/**
- * min-entropy per sample
- *
- * @ret min_entropy min-entropy of each sample
- */
-static inline __always_inline double
-ENTROPY_INLINE ( rtc, min_entropy_per_sample ) ( void ) {
-
- /* The min-entropy has been measured on several platforms
- * using the entropy_sample test code. Modelling the samples
- * as independent, and using a confidence level of 99.99%, the
- * measurements were as follows:
- *
- * qemu-kvm : 7.38 bits
- * VMware : 7.46 bits
- * Physical hardware : 2.67 bits
- *
- * We choose the lowest of these (2.67 bits) and apply a 50%
- * safety margin to allow for some potential non-independence
- * of samples.
- */
- return 1.3;
-}
-
-extern uint8_t rtc_sample ( void );
-
-/**
- * Get noise sample
- *
- * @ret noise Noise sample
- * @ret rc Return status code
- */
-static inline __always_inline int
-ENTROPY_INLINE ( rtc, get_noise ) ( noise_sample_t *noise ) {
-
- /* Get sample */
- *noise = rtc_sample();
-
- /* Always successful */
- return 0;
-}
-
-#endif /* _IPXE_RTC_ENTROPY_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/rtc_time.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/rtc_time.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/rtc_time.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/rtc_time.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,18 +0,0 @@
-#ifndef _IPXE_RTC_TIME_H
-#define _IPXE_RTC_TIME_H
-
-/** @file
- *
- * RTC-based time source
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#ifdef TIME_RTC
-#define TIME_PREFIX_rtc
-#else
-#define TIME_PREFIX_rtc __rtc_
-#endif
-
-#endif /* _IPXE_RTC_TIME_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/vmware.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/vmware.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/vmware.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/vmware.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,81 +0,0 @@
-#ifndef _IPXE_VMWARE_H
-#define _IPXE_VMWARE_H
-
-/** @file
- *
- * VMware backdoor mechanism
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-/** VMware backdoor I/O port */
-#define VMW_PORT 0x5658
-
-/** VMware backdoor magic value */
-#define VMW_MAGIC 0x564d5868 /* "VMXh" */
-
-/** VMware backdoor magic instruction */
-#define VMW_BACKDOOR "inl %%dx, %%eax"
-
-/** Get VMware version */
-#define VMW_CMD_GET_VERSION 0x0a
-
-/** Issue GuestRPC command */
-#define VMW_CMD_GUESTRPC 0x1e
-
-/**
- * Get VMware version
- *
- * @ret version VMware version(?)
- * @ret magic VMware magic number, if present
- * @ret product_type VMware product type
- */
-static inline __attribute__ (( always_inline )) void
-vmware_cmd_get_version ( uint32_t *version, uint32_t *magic,
- uint32_t *product_type ) {
- uint32_t discard_d;
-
- /* Perform backdoor call */
- __asm__ __volatile__ ( VMW_BACKDOOR
- : "=a" ( *version ), "=b" ( *magic ),
- "=c" ( *product_type ), "=d" ( discard_d )
- : "0" ( VMW_MAGIC ), "1" ( 0 ),
- "2" ( VMW_CMD_GET_VERSION ),
- "3" ( VMW_PORT ) );
-}
-
-/**
- * Issue GuestRPC command
- *
- * @v channel Channel number
- * @v subcommand GuestRPC subcommand
- * @v parameter Subcommand-specific parameter
- * @ret edxhi Subcommand-specific result
- * @ret ebx Subcommand-specific result
- * @ret status Command status
- */
-static inline __attribute__ (( always_inline )) uint32_t
-vmware_cmd_guestrpc ( int channel, uint16_t subcommand, uint32_t parameter,
- uint16_t *edxhi, uint32_t *ebx ) {
- uint32_t discard_a;
- uint32_t status;
- uint32_t edx;
-
- /* Perform backdoor call */
- __asm__ __volatile__ ( VMW_BACKDOOR
- : "=a" ( discard_a ), "=b" ( *ebx ),
- "=c" ( status ), "=d" ( edx )
- : "0" ( VMW_MAGIC ), "1" ( parameter ),
- "2" ( VMW_CMD_GUESTRPC | ( subcommand << 16 )),
- "3" ( VMW_PORT | ( channel << 16 ) ) );
- *edxhi = ( edx >> 16 );
-
- return status;
-}
-
-extern int vmware_present ( void );
-
-#endif /* _IPXE_VMWARE_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/x86_io.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/x86_io.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/ipxe/x86_io.h 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/ipxe/x86_io.h 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,153 @@
+#ifndef _IPXE_X86_IO_H
+#define _IPXE_X86_IO_H
+
+/** @file
+ *
+ * iPXE I/O API for x86
+ *
+ * i386 uses direct pointer dereferences for accesses to memory-mapped
+ * I/O space, and the inX/outX instructions for accesses to
+ * port-mapped I/O space.
+ *
+ * 64-bit atomic accesses (readq() and writeq()) use MMX instructions,
+ * and will crash original Pentium and earlier CPUs. Fortunately, no
+ * hardware that requires atomic 64-bit accesses will physically fit
+ * into a machine with such an old CPU anyway.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#ifdef IOAPI_X86
+#define IOAPI_PREFIX_x86
+#else
+#define IOAPI_PREFIX_x86 __x86_
+#endif
+
+/*
+ * Memory space mappings
+ *
+ */
+
+/*
+ * Physical<->Bus and Bus<->I/O address mappings
+ *
+ */
+
+static inline __always_inline unsigned long
+IOAPI_INLINE ( x86, phys_to_bus ) ( unsigned long phys_addr ) {
+ return phys_addr;
+}
+
+static inline __always_inline unsigned long
+IOAPI_INLINE ( x86, bus_to_phys ) ( unsigned long bus_addr ) {
+ return bus_addr;
+}
+
+static inline __always_inline void *
+IOAPI_INLINE ( x86, ioremap ) ( unsigned long bus_addr, size_t len __unused ) {
+ return phys_to_virt ( bus_addr );
+}
+
+static inline __always_inline void
+IOAPI_INLINE ( x86, iounmap ) ( volatile const void *io_addr __unused ) {
+ /* Nothing to do */
+}
+
+static inline __always_inline unsigned long
+IOAPI_INLINE ( x86, io_to_bus ) ( volatile const void *io_addr ) {
+ return virt_to_phys ( io_addr );
+}
+
+/*
+ * MMIO reads and writes up to 32 bits
+ *
+ */
+
+#define X86_READX( _api_func, _type ) \
+static inline __always_inline _type \
+IOAPI_INLINE ( x86, _api_func ) ( volatile _type *io_addr ) { \
+ return *io_addr; \
+}
+X86_READX ( readb, uint8_t );
+X86_READX ( readw, uint16_t );
+X86_READX ( readl, uint32_t );
+
+#define X86_WRITEX( _api_func, _type ) \
+static inline __always_inline void \
+IOAPI_INLINE ( x86, _api_func ) ( _type data, \
+ volatile _type *io_addr ) { \
+ *io_addr = data; \
+}
+X86_WRITEX ( writeb, uint8_t );
+X86_WRITEX ( writew, uint16_t );
+X86_WRITEX ( writel, uint32_t );
+
+/*
+ * PIO reads and writes up to 32 bits
+ *
+ */
+
+#define X86_INX( _insn_suffix, _type, _reg_prefix ) \
+static inline __always_inline _type \
+IOAPI_INLINE ( x86, in ## _insn_suffix ) ( volatile _type *io_addr ) { \
+ _type data; \
+ __asm__ __volatile__ ( "in" #_insn_suffix " %w1, %" _reg_prefix "0" \
+ : "=a" ( data ) : "Nd" ( io_addr ) ); \
+ return data; \
+} \
+static inline __always_inline void \
+IOAPI_INLINE ( x86, ins ## _insn_suffix ) ( volatile _type *io_addr, \
+ _type *data, \
+ unsigned int count ) { \
+ unsigned int discard_D; \
+ __asm__ __volatile__ ( "rep ins" #_insn_suffix \
+ : "=D" ( discard_D ) \
+ : "d" ( io_addr ), "c" ( count ), \
+ "0" ( data ) ); \
+}
+X86_INX ( b, uint8_t, "b" );
+X86_INX ( w, uint16_t, "w" );
+X86_INX ( l, uint32_t, "k" );
+
+#define X86_OUTX( _insn_suffix, _type, _reg_prefix ) \
+static inline __always_inline void \
+IOAPI_INLINE ( x86, out ## _insn_suffix ) ( _type data, \
+ volatile _type *io_addr ) { \
+ __asm__ __volatile__ ( "out" #_insn_suffix " %" _reg_prefix "0, %w1" \
+ : : "a" ( data ), "Nd" ( io_addr ) ); \
+} \
+static inline __always_inline void \
+IOAPI_INLINE ( x86, outs ## _insn_suffix ) ( volatile _type *io_addr, \
+ const _type *data, \
+ unsigned int count ) { \
+ unsigned int discard_S; \
+ __asm__ __volatile__ ( "rep outs" #_insn_suffix \
+ : "=S" ( discard_S ) \
+ : "d" ( io_addr ), "c" ( count ), \
+ "0" ( data ) ); \
+}
+X86_OUTX ( b, uint8_t, "b" );
+X86_OUTX ( w, uint16_t, "w" );
+X86_OUTX ( l, uint32_t, "k" );
+
+/*
+ * Slow down I/O
+ *
+ */
+
+static inline __always_inline void
+IOAPI_INLINE ( x86, iodelay ) ( void ) {
+ __asm__ __volatile__ ( "outb %al, $0x80" );
+}
+
+/*
+ * Memory barrier
+ *
+ */
+
+static inline __always_inline void
+IOAPI_INLINE ( x86, mb ) ( void ) {
+ __asm__ __volatile__ ( "lock; addl $0, 0(%%esp)" : : : "memory" );
+}
+
+#endif /* _IPXE_X86_IO_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/librm.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/librm.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/librm.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/librm.h 2012-01-06 23:49:04.000000000 +0000
@@ -68,12 +68,6 @@
return trivial_userptr_add ( userptr, offset );
}
-static inline __always_inline off_t
-UACCESS_INLINE ( librm, userptr_sub ) ( userptr_t userptr,
- userptr_t subtrahend ) {
- return trivial_userptr_sub ( userptr, subtrahend );
-}
-
static inline __always_inline void
UACCESS_INLINE ( librm, memcpy_user ) ( userptr_t dest, off_t dest_off,
userptr_t src, off_t src_off,
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pic8259.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/pic8259.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pic8259.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/pic8259.h 2012-01-06 23:49:04.000000000 +0000
@@ -9,8 +9,6 @@
#ifndef PIC8259_H
#define PIC8259_H
-#include
-
/* For segoff_t */
#include "realmode.h"
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pxe_api.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/pxe_api.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pxe_api.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/pxe_api.h 2012-01-06 23:49:04.000000000 +0000
@@ -14,8 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* As an alternative, at your option, you may use this file under the
* following terms, known as the "MIT license":
@@ -1691,27 +1690,6 @@
/** @} */ /* pxenv_file_exit_hook */
-/** @defgroup pxenv_file_cmdline PXENV_FILE_CMDLINE
- *
- * FILE CMDLINE
- *
- * @{
- */
-
-/** PXE API function code for pxenv_file_cmdline() */
-#define PXENV_FILE_CMDLINE 0x00e8
-
-/** Parameter block for pxenv_file_cmdline() */
-struct s_PXENV_FILE_CMDLINE {
- PXENV_STATUS_t Status; /**< PXE status code */
- UINT16_t BufferSize; /**< Data buffer size */
- SEGOFF16_t Buffer; /**< Data buffer */
-} __attribute__ (( packed ));
-
-typedef struct s_PXENV_FILE_CMDLINE PXENV_FILE_CMDLINE_t;
-
-/** @} */ /* pxe_file_cmdline */
-
/** @} */ /* pxe_file_api */
/** @defgroup pxe_loader_api PXE Loader API
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pxe_error.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/pxe_error.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pxe_error.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/pxe_error.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,123 +0,0 @@
-#ifndef PXE_ERROR_H
-#define PXE_ERROR_H
-
-/** @file
- *
- * Preboot eXecution Environment (PXE) error definitions
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/**
- * @defgroup pxeerrors PXE error codes
- *
- * @{
- */
-
-/* Generic errors */
-#define PXENV_STATUS_SUCCESS 0x0000
-#define PXENV_STATUS_FAILURE 0x0001
-#define PXENV_STATUS_BAD_FUNC 0x0002
-#define PXENV_STATUS_UNSUPPORTED 0x0003
-#define PXENV_STATUS_KEEP_UNDI 0x0004
-#define PXENV_STATUS_KEEP_ALL 0x0005
-#define PXENV_STATUS_OUT_OF_RESOURCES 0x0006
-
-/* ARP errors (0x0010 to 0x001f) */
-#define PXENV_STATUS_ARP_TIMEOUT 0x0011
-
-/* Base-Code state errors */
-#define PXENV_STATUS_UDP_CLOSED 0x0018
-#define PXENV_STATUS_UDP_OPEN 0x0019
-#define PXENV_STATUS_TFTP_CLOSED 0x001a
-#define PXENV_STATUS_TFTP_OPEN 0x001b
-
-/* BIOS/system errors (0x0020 to 0x002f) */
-#define PXENV_STATUS_MCOPY_PROBLEM 0x0020
-#define PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x0021
-#define PXENV_STATUS_BIS_VALIDATE_FAILURE 0x0022
-#define PXENV_STATUS_BIS_INIT_FAILURE 0x0023
-#define PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x0024
-#define PXENV_STATUS_BIS_GBOA_FAILURE 0x0025
-#define PXENV_STATUS_BIS_FREE_FAILURE 0x0026
-#define PXENV_STATUS_BIS_GSI_FAILURE 0x0027
-#define PXENV_STATUS_BIS_BAD_CKSUM 0x0028
-
-/* TFTP/MTFTP errors (0x0030 to 0x003f) */
-#define PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x0030
-#define PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x0032
-#define PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x0033
-#define PXENV_STATUS_TFTP_READ_TIMEOUT 0x0035
-#define PXENV_STATUS_TFTP_ERROR_OPCODE 0x0036
-#define PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x0038
-#define PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x0039
-#define PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x003a
-#define PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x003b
-#define PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x003c
-#define PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x003d
-#define PXENV_STATUS_TFTP_NO_FILESIZE 0x003e
-#define PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x003f
-
-/* Reserved errors 0x0040 to 0x004f) */
-
-/* DHCP/BOOTP errors (0x0050 to 0x005f) */
-#define PXENV_STATUS_DHCP_TIMEOUT 0x0051
-#define PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x0052
-#define PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x0053
-#define PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x0054
-
-/* Driver errors (0x0060 to 0x006f) */
-#define PXENV_STATUS_UNDI_INVALID_FUNCTION 0x0060
-#define PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x0061
-#define PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x0062
-#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x0063
-#define PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x0064
-#define PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x0065
-#define PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x0066
-#define PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x0067
-#define PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x0068
-#define PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x0069
-#define PXENV_STATUS_UNDI_INVALID_STATE 0x006a
-#define PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x006b
-#define PXENV_STATUS_UNDI_INVALID_PARAMETER 0x006c
-
-/* ROM and NBP bootstrap errors (0x0070 to 0x007f) */
-#define PXENV_STATUS_BSTRAP_PROMPT_MENU 0x0074
-#define PXENV_STATUS_BSTRAP_MCAST_ADDR 0x0076
-#define PXENV_STATUS_BSTRAP_MISSING_LIST 0x0077
-#define PXENV_STATUS_BSTRAP_NO_RESPONSE 0x0078
-#define PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x0079
-
-/* Environment NBP errors (0x0080 to 0x008f) */
-
-/* Reserved errors (0x0090 to 0x009f) */
-
-/* Miscellaneous errors (0x00a0 to 0x00af) */
-#define PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0x00a0
-#define PXENV_STATUS_BINL_NO_PXE_SERVER 0x00a1
-#define PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0x00a2
-#define PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0x00a3
-
-/* BUSD errors (0x00b0 to 0x00bf) */
-#define PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0x00b0
-
-/* Loader errors (0x00c0 to 0x00cf) */
-#define PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0x00c0
-#define PXENV_STATUS_LOADER_NO_BC_ROMID 0x00c1
-#define PXENV_STATUS_LOADER_BAD_BC_ROMID 0x00c2
-#define PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0x00c3
-#define PXENV_STATUS_LOADER_NO_UNDI_ROMID 0x00c4
-#define PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0x00c5
-#define PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0x00c6
-#define PXENV_STATUS_LOADER_NO_PXE_STRUCT 0x00c8
-#define PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0x00c9
-#define PXENV_STATUS_LOADER_UNDI_START 0x00ca
-#define PXENV_STATUS_LOADER_BC_START 0x00cb
-
-/** @} */
-
-/** Derive PXENV_STATUS code from iPXE error number */
-#define PXENV_STATUS( rc ) ( (-(rc)) & 0x00ff )
-
-#endif /* PXE_ERROR_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pxe.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/pxe.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/pxe.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/pxe.h 2012-01-06 23:49:04.000000000 +0000
@@ -4,7 +4,6 @@
FILE_LICENCE ( GPL2_OR_LATER );
#include "pxe_types.h"
-#include "pxe_error.h"
#include "pxe_api.h"
#include
#include
@@ -189,7 +188,6 @@
( ( 'P' << 0 ) + ( 'C' << 8 ) + ( 'I' << 16 ) + ( 'R' << 24 ) )
extern struct net_device *pxe_netdev;
-extern const char *pxe_cmdline;
extern void pxe_set_netdev ( struct net_device *netdev );
extern PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/rtc.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/rtc.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/rtc.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/rtc.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,83 +0,0 @@
-#ifndef _RTC_H
-#define _RTC_H
-
-/** @file
- *
- * CMOS Real-Time Clock (RTC)
- *
- * The CMOS/RTC registers are documented (with varying degrees of
- * accuracy and consistency) at
- *
- * http://www.nondot.org/sabre/os/files/MiscHW/RealtimeClockFAQ.txt
- * http://wiki.osdev.org/RTC
- * http://wiki.osdev.org/CMOS
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-/** RTC IRQ */
-#define RTC_IRQ 8
-
-/** RTC interrupt vector */
-#define RTC_INT IRQ_INT ( RTC_IRQ )
-
-/** CMOS/RTC address (and NMI) register */
-#define CMOS_ADDRESS 0x70
-
-/** NMI disable bit */
-#define CMOS_DISABLE_NMI 0x80
-
-/** CMOS/RTC data register */
-#define CMOS_DATA 0x71
-
-/** RTC seconds */
-#define RTC_SEC 0x00
-
-/** RTC minutes */
-#define RTC_MIN 0x02
-
-/** RTC hours */
-#define RTC_HOUR 0x04
-
-/** RTC weekday */
-#define RTC_WDAY 0x06
-
-/** RTC day of month */
-#define RTC_MDAY 0x07
-
-/** RTC month */
-#define RTC_MON 0x08
-
-/** RTC year */
-#define RTC_YEAR 0x09
-
-/** RTC status register A */
-#define RTC_STATUS_A 0x0a
-
-/** RTC update in progress bit */
-#define RTC_STATUS_A_UPDATE_IN_PROGRESS 0x80
-
-/** RTC status register B */
-#define RTC_STATUS_B 0x0b
-
-/** RTC 24 hour format bit */
-#define RTC_STATUS_B_24_HOUR 0x02
-
-/** RTC binary mode bit */
-#define RTC_STATUS_B_BINARY 0x04
-
-/** RTC Periodic Interrupt Enabled bit */
-#define RTC_STATUS_B_PIE 0x40
-
-/** RTC status register C */
-#define RTC_STATUS_C 0x0c
-
-/** RTC status register D */
-#define RTC_STATUS_D 0x0d
-
-/** CMOS default address */
-#define CMOS_DEFAULT_ADDRESS RTC_STATUS_D
-
-#endif /* _RTC_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/sdi.h ipxe-1.0.1~lliurex1505/src/arch/i386/include/sdi.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/include/sdi.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/include/sdi.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,39 +0,0 @@
-#ifndef _SDI_H
-#define _SDI_H
-
-/** @file
- *
- * System Deployment Image (SDI)
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** SDI image header */
-struct sdi_header {
- /** Signature */
- uint32_t magic;
- /** Version (as an ASCII string) */
- uint32_t version;
- /** Reserved */
- uint8_t reserved[8];
- /** Boot code offset */
- uint64_t boot_offset;
- /** Boot code size */
- uint64_t boot_size;
-} __attribute__ (( packed ));
-
-/** SDI image signature */
-#define SDI_MAGIC \
- ( ( '$' << 0 ) | ( 'S' << 8 ) | ( 'D' << 16 ) | ( 'I' << 24 ) )
-
-/** SDI boot segment */
-#define SDI_BOOT_SEG 0x0000
-
-/** SDI boot offset */
-#define SDI_BOOT_OFF 0x7c00
-
-/** Constant to binary-OR with physical address of SDI image */
-#define SDI_WTF 0x41
-
-#endif /* _SDI_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/apm.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/apm.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/apm.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/apm.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2013 Marin Hannache .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/**
- * @file
- *
- * Advanced Power Management
- *
- */
-
-#include
-#include
-#include
-
-/**
- * Power off the computer using APM
- *
- * @ret rc Return status code
- */
-static int apm_poweroff ( void ) {
- uint16_t apm_version;
- uint16_t apm_signature;
- uint16_t apm_flags;
- uint16_t carry;
-
- /* APM check */
- __asm__ __volatile__ ( REAL_CODE ( "int $0x15\n\t"
- "adc %%edx,0\n\t" )
- : "=a" ( apm_version ), "=b" ( apm_signature ),
- "=c" ( apm_flags ), "=d" ( carry )
- : "a" ( 0x5300 ), "b" ( 0x0000 ),
- "d" ( 0x0000 ) );
- if ( carry ) {
- DBG ( "APM not present\n" );
- return -ENOTSUP;
- }
- if ( apm_signature != 0x504d ) { /* signature 'PM' */
- DBG ( "APM not present\n" );
- return -ENOTSUP;
- }
- if ( apm_version < 0x0101 ) { /* Need version 1.1+ */
- DBG ( "APM 1.1+ not supported\n" );
- return -ENOTSUP;
- }
- if ( ( apm_flags & 0x8 ) == 0x8 ) {
- DBG ( "APM power management disabled\n" );
- return -EPERM;
- }
- DBG2 ( "APM check completed\n" );
-
- /* APM initialisation */
- __asm__ __volatile__ ( REAL_CODE ( "int $0x15\n\t"
- "adc %%edx,0\n\t" )
- : "=d" ( carry )
- : "a" ( 0x5301 ), "b" ( 0x0000 ),
- "d" ( 0x0000 ) );
- if ( carry ) {
- DBG ( "APM initialisation failed\n" );
- return -EIO;
- }
- DBG2 ( "APM initialisation completed\n" );
-
- /* Set APM driver version */
- __asm__ __volatile__ ( REAL_CODE ( "int $0x15\n\t"
- "adc %%edx,0\n\t" )
- : "=d" ( carry )
- : "a" ( 0x530e ), "b" ( 0x0000 ),
- "c" ( 0x0101 ), "d" ( 0x0000 ) );
- if ( carry ) {
- DBG ( "APM setting driver version failed\n" );
- return -EIO;
- }
- DBG2 ( "APM driver version set\n" );
-
- /* Setting power state to off */
- __asm__ __volatile__ ( REAL_CODE ( "int $0x15\n\t"
- "adc %%edx,0\n\t" )
- : "=d" ( carry )
- : "a" ( 0x5307 ), "b" ( 0x0001 ),
- "c" ( 0x0003 ), "d" ( 0x0000) );
- if ( carry ) {
- DBG ( "APM setting power state failed\n" );
- return -ENOTTY;
- }
-
- /* Should never happen */
- return -ECANCELED;
-}
-
-PROVIDE_REBOOT ( pcbios, poweroff, apm_poweroff );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/bios_reboot.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/bios_reboot.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/bios_reboot.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/bios_reboot.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2010 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * Standard PC-BIOS reboot mechanism
- *
- */
-
-#include
-#include
-#include
-
-/**
- * Reboot system
- *
- * @v warm Perform a warm reboot
- */
-static void bios_reboot ( int warm ) {
- uint16_t flag;
-
- /* Configure BIOS for cold/warm reboot */
- flag = ( warm ? BDA_REBOOT_WARM : 0 );
- put_real ( flag, BDA_SEG, BDA_REBOOT );
-
- /* Jump to system reset vector */
- __asm__ __volatile__ ( REAL_CODE ( "ljmp $0xf000, $0xfff0" ) : : );
-}
-
-PROVIDE_REBOOT ( pcbios, reboot, bios_reboot );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/bios_smbios.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/bios_smbios.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/bios_smbios.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/bios_smbios.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -77,8 +76,6 @@
smbios->address = phys_to_user ( u.entry.smbios_address );
smbios->len = u.entry.smbios_len;
smbios->count = u.entry.smbios_count;
- smbios->version =
- SMBIOS_VERSION ( u.entry.major, u.entry.minor );
return 0;
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/bios_timer.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/bios_timer.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/bios_timer.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/bios_timer.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/int13.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/int13.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/int13.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/int13.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -38,8 +37,6 @@
#include
#include
#include
-#include
-#include
#include
#include
#include
@@ -78,9 +75,9 @@
/** Underlying block device interface */
struct interface block;
- /** BIOS in-use drive number (0x00-0xff) */
+ /** BIOS in-use drive number (0x80-0xff) */
unsigned int drive;
- /** BIOS natural drive number (0x00-0xff)
+ /** BIOS natural drive number (0x80-0xff)
*
* This is the drive number that would have been assigned by
* 'naturally' appending the drive to the end of the BIOS
@@ -145,44 +142,17 @@
/** Assembly wrapper */
extern void int13_wrapper ( void );
-/** Dummy floppy disk parameter table */
-static struct int13_fdd_parameters __data16 ( int13_fdd_params ) = {
- /* 512 bytes per sector */
- .bytes_per_sector = 0x02,
- /* Highest sectors per track that we ever return */
- .sectors_per_track = 48,
-};
-#define int13_fdd_params __use_data16 ( int13_fdd_params )
-
/** List of registered emulated drives */
static LIST_HEAD ( int13s );
/**
- * Equipment word
- *
- * This is a cached copy of the BIOS Data Area equipment word at
- * 40:10.
- */
-static uint16_t equipment_word;
-
-/**
- * Number of BIOS floppy disk drives
+ * Number of BIOS drives
*
- * This is derived from the equipment word. It is held in .text16 to
- * allow for easy access by the INT 13,08 wrapper.
+ * Note that this is the number of drives in the system as a whole
+ * (i.e. a mirror of the counter at 40:75), rather than a count of the
+ * number of emulated drives.
*/
-static uint8_t __text16 ( num_fdds );
-#define num_fdds __use_text16 ( num_fdds )
-
-/**
- * Number of BIOS hard disk drives
- *
- * This is a cached copy of the BIOS Data Area number of hard disk
- * drives at 40:75. It is held in .text16 to allow for easy access by
- * the INT 13,08 wrapper.
- */
-static uint8_t __text16 ( num_drives );
-#define num_drives __use_text16 ( num_drives )
+static uint8_t num_drives;
/**
* Calculate INT 13 drive sector size
@@ -190,7 +160,7 @@
* @v int13 Emulated drive
* @ret blksize Sector size
*/
-static inline size_t int13_blksize ( struct int13_drive *int13 ) {
+static inline unsigned int int13_blksize ( struct int13_drive *int13 ) {
return ( int13->capacity.blksize << int13->blksize_shift );
}
@@ -215,16 +185,6 @@
return ( ( capacity <= 0xffffffffUL ) ? capacity : 0xffffffff );
}
-/**
- * Test if INT 13 drive is a floppy disk drive
- *
- * @v int13 Emulated drive
- * @ret is_fdd Emulated drive is a floppy disk
- */
-static inline int int13_is_fdd ( struct int13_drive *int13 ) {
- return ( ! ( int13->drive & 0x80 ) );
-}
-
/** An INT 13 command */
struct int13_command {
/** Status */
@@ -539,33 +499,33 @@
}
/**
- * Guess INT 13 hard disk drive geometry
+ * Guess INT 13 drive geometry
*
* @v int13 Emulated drive
* @v scratch Scratch area for single-sector reads
- * @ret heads Guessed number of heads
- * @ret sectors Guessed number of sectors per track
* @ret rc Return status code
*
* Guesses the drive geometry by inspecting the partition table.
*/
-static int int13_guess_geometry_hdd ( struct int13_drive *int13, void *scratch,
- unsigned int *heads,
- unsigned int *sectors ) {
+static int int13_guess_geometry ( struct int13_drive *int13, void *scratch ) {
struct master_boot_record *mbr = scratch;
struct partition_table_entry *partition;
+ unsigned int guessed_heads = 255;
+ unsigned int guessed_sectors_per_track = 63;
+ unsigned int blocks;
+ unsigned int blocks_per_cyl;
unsigned int i;
int rc;
- /* Default guess is xx/255/63 */
- *heads = 255;
- *sectors = 63;
+ /* Don't even try when the blksize is invalid for C/H/S access */
+ if ( int13_blksize ( int13 ) != INT13_BLKSIZE )
+ return 0;
/* Read partition table */
if ( ( rc = int13_rw ( int13, 0, 1, virt_to_user ( mbr ),
block_read ) ) != 0 ) {
- DBGC ( int13, "INT13 drive %02x could not read "
- "partition table to guess geometry: %s\n",
+ DBGC ( int13, "INT13 drive %02x could not read partition "
+ "table to guess geometry: %s\n",
int13->drive, strerror ( rc ) );
return rc;
}
@@ -574,126 +534,25 @@
DBGC ( int13, "INT13 drive %02x has signature %08x\n",
int13->drive, mbr->signature );
- /* Scan through partition table and modify guesses for
- * heads and sectors_per_track if we find any used
- * partitions.
+ /* Scan through partition table and modify guesses for heads
+ * and sectors_per_track if we find any used partitions.
*/
for ( i = 0 ; i < 4 ; i++ ) {
partition = &mbr->partitions[i];
if ( ! partition->type )
continue;
- *heads = ( PART_HEAD ( partition->chs_end ) + 1 );
- *sectors = PART_SECTOR ( partition->chs_end );
+ guessed_heads = ( PART_HEAD ( partition->chs_end ) + 1 );
+ guessed_sectors_per_track = PART_SECTOR ( partition->chs_end );
DBGC ( int13, "INT13 drive %02x guessing C/H/S xx/%d/%d based "
- "on partition %d\n",
- int13->drive, *heads, *sectors, ( i + 1 ) );
- }
-
- return 0;
-}
-
-/** Recognised floppy disk geometries */
-static const struct int13_fdd_geometry int13_fdd_geometries[] = {
- INT13_FDD_GEOMETRY ( 40, 1, 8 ),
- INT13_FDD_GEOMETRY ( 40, 1, 9 ),
- INT13_FDD_GEOMETRY ( 40, 2, 8 ),
- INT13_FDD_GEOMETRY ( 40, 1, 9 ),
- INT13_FDD_GEOMETRY ( 80, 2, 8 ),
- INT13_FDD_GEOMETRY ( 80, 2, 9 ),
- INT13_FDD_GEOMETRY ( 80, 2, 15 ),
- INT13_FDD_GEOMETRY ( 80, 2, 18 ),
- INT13_FDD_GEOMETRY ( 80, 2, 20 ),
- INT13_FDD_GEOMETRY ( 80, 2, 21 ),
- INT13_FDD_GEOMETRY ( 82, 2, 21 ),
- INT13_FDD_GEOMETRY ( 83, 2, 21 ),
- INT13_FDD_GEOMETRY ( 80, 2, 22 ),
- INT13_FDD_GEOMETRY ( 80, 2, 23 ),
- INT13_FDD_GEOMETRY ( 80, 2, 24 ),
- INT13_FDD_GEOMETRY ( 80, 2, 36 ),
- INT13_FDD_GEOMETRY ( 80, 2, 39 ),
- INT13_FDD_GEOMETRY ( 80, 2, 40 ),
- INT13_FDD_GEOMETRY ( 80, 2, 44 ),
- INT13_FDD_GEOMETRY ( 80, 2, 48 ),
-};
-
-/**
- * Guess INT 13 floppy disk drive geometry
- *
- * @v int13 Emulated drive
- * @ret heads Guessed number of heads
- * @ret sectors Guessed number of sectors per track
- * @ret rc Return status code
- *
- * Guesses the drive geometry by inspecting the disk size.
- */
-static int int13_guess_geometry_fdd ( struct int13_drive *int13,
- unsigned int *heads,
- unsigned int *sectors ) {
- unsigned int blocks = int13_capacity ( int13 );
- const struct int13_fdd_geometry *geometry;
- unsigned int cylinders;
- unsigned int i;
-
- /* Look for a match against a known geometry */
- for ( i = 0 ; i < ( sizeof ( int13_fdd_geometries ) /
- sizeof ( int13_fdd_geometries[0] ) ) ; i++ ) {
- geometry = &int13_fdd_geometries[i];
- cylinders = INT13_FDD_CYLINDERS ( geometry );
- *heads = INT13_FDD_HEADS ( geometry );
- *sectors = INT13_FDD_SECTORS ( geometry );
- if ( ( cylinders * (*heads) * (*sectors) ) == blocks ) {
- DBGC ( int13, "INT13 drive %02x guessing C/H/S "
- "%d/%d/%d based on size %dK\n", int13->drive,
- cylinders, *heads, *sectors, ( blocks / 2 ) );
- return 0;
- }
- }
-
- /* Otherwise, assume a partial disk image in the most common
- * format (1440K, 80/2/18).
- */
- *heads = 2;
- *sectors = 18;
- DBGC ( int13, "INT13 drive %02x guessing C/H/S xx/%d/%d based on size "
- "%dK\n", int13->drive, *heads, *sectors, ( blocks / 2 ) );
- return 0;
-}
-
-/**
- * Guess INT 13 drive geometry
- *
- * @v int13 Emulated drive
- * @v scratch Scratch area for single-sector reads
- * @ret rc Return status code
- */
-static int int13_guess_geometry ( struct int13_drive *int13, void *scratch ) {
- unsigned int guessed_heads;
- unsigned int guessed_sectors;
- unsigned int blocks;
- unsigned int blocks_per_cyl;
- int rc;
-
- /* Don't even try when the blksize is invalid for C/H/S access */
- if ( int13_blksize ( int13 ) != INT13_BLKSIZE )
- return 0;
-
- /* Guess geometry according to drive type */
- if ( int13_is_fdd ( int13 ) ) {
- if ( ( rc = int13_guess_geometry_fdd ( int13, &guessed_heads,
- &guessed_sectors )) != 0)
- return rc;
- } else {
- if ( ( rc = int13_guess_geometry_hdd ( int13, scratch,
- &guessed_heads,
- &guessed_sectors )) != 0)
- return rc;
+ "on partition %d\n", int13->drive, guessed_heads,
+ guessed_sectors_per_track, ( i + 1 ) );
}
/* Apply guesses if no geometry already specified */
if ( ! int13->heads )
int13->heads = guessed_heads;
if ( ! int13->sectors_per_track )
- int13->sectors_per_track = guessed_sectors;
+ int13->sectors_per_track = guessed_sectors_per_track;
if ( ! int13->cylinders ) {
/* Avoid attempting a 64-bit divide on a 32-bit system */
blocks = int13_capacity32 ( int13 );
@@ -710,40 +569,19 @@
/**
* Update BIOS drive count
*/
-static void int13_sync_num_drives ( void ) {
+static void int13_set_num_drives ( void ) {
struct int13_drive *int13;
- uint8_t *counter;
- uint8_t max_drive;
- uint8_t required;
- /* Get current drive counts */
- get_real ( equipment_word, BDA_SEG, BDA_EQUIPMENT_WORD );
+ /* Get current drive count */
get_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
- num_fdds = ( ( equipment_word & 0x0001 ) ?
- ( ( ( equipment_word >> 6 ) & 0x3 ) + 1 ) : 0 );
/* Ensure count is large enough to cover all of our emulated drives */
list_for_each_entry ( int13, &int13s, list ) {
- counter = ( int13_is_fdd ( int13 ) ? &num_fdds : &num_drives );
- max_drive = int13->drive;
- if ( max_drive < int13->natural_drive )
- max_drive = int13->natural_drive;
- required = ( ( max_drive & 0x7f ) + 1 );
- if ( *counter < required ) {
- *counter = required;
- DBGC ( int13, "INT13 drive %02x added to drive count: "
- "%d HDDs, %d FDDs\n",
- int13->drive, num_drives, num_fdds );
- }
+ if ( num_drives <= ( int13->drive & 0x7f ) )
+ num_drives = ( ( int13->drive & 0x7f ) + 1 );
}
/* Update current drive count */
- equipment_word &= ~( ( 0x3 << 6 ) | 0x0001 );
- if ( num_fdds ) {
- equipment_word |= ( 0x0001 |
- ( ( ( num_fdds - 1 ) & 0x3 ) << 6 ) );
- }
- put_real ( equipment_word, BDA_SEG, BDA_EQUIPMENT_WORD );
put_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
}
@@ -751,14 +589,13 @@
* Check number of drives
*/
static void int13_check_num_drives ( void ) {
- uint16_t check_equipment_word;
uint8_t check_num_drives;
- get_real ( check_equipment_word, BDA_SEG, BDA_EQUIPMENT_WORD );
get_real ( check_num_drives, BDA_SEG, BDA_NUM_DRIVES );
- if ( ( check_equipment_word != equipment_word ) ||
- ( check_num_drives != num_drives ) ) {
- int13_sync_num_drives();
+ if ( check_num_drives != num_drives ) {
+ int13_set_num_drives();
+ DBG ( "INT13 fixing up number of drives from %d to %d\n",
+ check_num_drives, num_drives );
}
}
@@ -832,19 +669,14 @@
int13->drive, int13_blksize ( int13 ) );
return -INT13_STATUS_INVALID;
}
-
+
/* Calculate parameters */
cylinder = ( ( ( ix86->regs.cl & 0xc0 ) << 2 ) | ix86->regs.ch );
+ assert ( cylinder < int13->cylinders );
head = ix86->regs.dh;
+ assert ( head < int13->heads );
sector = ( ix86->regs.cl & 0x3f );
- if ( ( cylinder >= int13->cylinders ) ||
- ( head >= int13->heads ) ||
- ( sector < 1 ) || ( sector > int13->sectors_per_track ) ) {
- DBGC ( int13, "C/H/S %d/%d/%d out of range for geometry "
- "%d/%d/%d\n", cylinder, head, sector, int13->cylinders,
- int13->heads, int13->sectors_per_track );
- return -INT13_STATUS_INVALID;
- }
+ assert ( ( sector >= 1 ) && ( sector <= int13->sectors_per_track ) );
lba = ( ( ( ( cylinder * int13->heads ) + head )
* int13->sectors_per_track ) + sector - 1 );
count = ix86->regs.al;
@@ -929,19 +761,10 @@
return -INT13_STATUS_INVALID;
}
- /* Common parameters */
ix86->regs.ch = ( max_cylinder & 0xff );
ix86->regs.cl = ( ( ( max_cylinder >> 8 ) << 6 ) | max_sector );
ix86->regs.dh = max_head;
- ix86->regs.dl = ( int13_is_fdd ( int13 ) ? num_fdds : num_drives );
-
- /* Floppy-specific parameters */
- if ( int13_is_fdd ( int13 ) ) {
- ix86->regs.bl = INT13_FDD_TYPE_1M44;
- ix86->segs.es = rm_ds;
- ix86->regs.di = __from_data16 ( &int13_fdd_params );
- }
-
+ get_real ( ix86->regs.dl, BDA_SEG, BDA_NUM_DRIVES );
return 0;
}
@@ -958,15 +781,10 @@
uint32_t blocks;
DBGC2 ( int13, "Get disk type\n" );
-
- if ( int13_is_fdd ( int13 ) ) {
- return INT13_DISK_TYPE_FDD;
- } else {
- blocks = int13_capacity32 ( int13 );
- ix86->regs.cx = ( blocks >> 16 );
- ix86->regs.dx = ( blocks & 0xffff );
- return INT13_DISK_TYPE_HDD;
- }
+ blocks = int13_capacity32 ( int13 );
+ ix86->regs.cx = ( blocks >> 16 );
+ ix86->regs.dx = ( blocks & 0xffff );
+ return INT13_DISK_TYPE_HDD;
}
/**
@@ -1015,13 +833,6 @@
userptr_t buffer;
int rc;
- /* Extended reads are not allowed on floppy drives.
- * ELTORITO.SYS seems to assume that we are really a CD-ROM if
- * we support extended reads for a floppy drive.
- */
- if ( int13_is_fdd ( int13 ) )
- return -INT13_STATUS_INVALID;
-
/* Get buffer size */
get_real ( bufsize, ix86->segs.ds,
( ix86->regs.si + offsetof ( typeof ( addr ), bufsize ) ) );
@@ -1489,28 +1300,26 @@
"popw 6(%%bp)\n\t"
/* Fix up %dl:
*
- * INT 13,15 : do nothing if hard disk
+ * INT 13,15 : do nothing
* INT 13,08 : load with number of drives
* all others: restore original value
*/
"cmpb $0x15, -1(%%bp)\n\t"
- "jne 2f\n\t"
- "testb $0x80, -4(%%bp)\n\t"
- "jnz 3f\n\t"
- "\n2:\n\t"
+ "je 2f\n\t"
"movb -4(%%bp), %%dl\n\t"
"cmpb $0x08, -1(%%bp)\n\t"
- "jne 3f\n\t"
- "testb $0x80, %%dl\n\t"
- "movb %%cs:num_drives, %%dl\n\t"
- "jnz 3f\n\t"
- "movb %%cs:num_fdds, %%dl\n\t"
+ "jne 2f\n\t"
+ "pushw %%ds\n\t"
+ "pushw %1\n\t"
+ "popw %%ds\n\t"
+ "movb %c2, %%dl\n\t"
+ "popw %%ds\n\t"
/* Return */
- "\n3:\n\t"
+ "\n2:\n\t"
"movw %%bp, %%sp\n\t"
"popw %%bp\n\t"
"iret\n\t" )
- : : "i" ( int13 ) );
+ : : "i" ( int13 ), "i" ( BDA_SEG ), "i" ( BDA_NUM_DRIVES ) );
hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
&int13_vector );
@@ -1595,13 +1404,14 @@
*/
static int int13_hook ( struct uri *uri, unsigned int drive ) {
struct int13_drive *int13;
+ uint8_t num_drives;
unsigned int natural_drive;
void *scratch;
int rc;
/* Calculate natural drive number */
- int13_sync_num_drives();
- natural_drive = ( ( drive & 0x80 ) ? ( num_drives | 0x80 ) : num_fdds );
+ get_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
+ natural_drive = ( num_drives | 0x80 );
/* Check that drive number is not in use */
list_for_each_entry ( int13, &int13s, list ) {
@@ -1658,7 +1468,7 @@
list_add ( &int13->list, &int13s );
/* Update BIOS drive count */
- int13_sync_num_drives();
+ int13_set_num_drives();
free ( scratch );
return 0;
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/memtop_umalloc.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/memtop_umalloc.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/memtop_umalloc.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/memtop_umalloc.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -31,7 +30,6 @@
#include
#include
#include
-#include
#include
/** Alignment of external allocated memory */
@@ -54,20 +52,56 @@
/** Bottom of heap (current lowest allocated block) */
static userptr_t bottom = UNULL;
-/** Remaining space on heap */
-static size_t heap_size;
-
/**
* Initialise external heap
*
+ * @ret rc Return status code
*/
-static void init_eheap ( void ) {
- userptr_t base;
+static int init_eheap ( void ) {
+ struct memory_map memmap;
+ unsigned long heap_size = 0;
+ unsigned int i;
+
+ DBG ( "Allocating external heap\n" );
+
+ get_memmap ( &memmap );
+ for ( i = 0 ; i < memmap.count ; i++ ) {
+ struct memory_region *region = &memmap.regions[i];
+ unsigned long r_start, r_end;
+ unsigned long r_size;
+
+ DBG ( "Considering [%llx,%llx)\n", region->start, region->end);
+
+ /* Truncate block to 4GB */
+ if ( region->start > UINT_MAX ) {
+ DBG ( "...starts after 4GB\n" );
+ continue;
+ }
+ r_start = region->start;
+ if ( region->end > UINT_MAX ) {
+ DBG ( "...end truncated to 4GB\n" );
+ r_end = 0; /* =4GB, given the wraparound */
+ } else {
+ r_end = region->end;
+ }
+
+ /* Use largest block */
+ r_size = ( r_end - r_start );
+ if ( r_size > heap_size ) {
+ DBG ( "...new best block found\n" );
+ top = bottom = phys_to_user ( r_end );
+ heap_size = r_size;
+ }
+ }
+
+ if ( ! heap_size ) {
+ DBG ( "No external heap available\n" );
+ return -ENOMEM;
+ }
- heap_size = largest_memblock ( &base );
- bottom = top = userptr_add ( base, heap_size );
- DBG ( "External heap grows downwards from %lx (size %zx)\n",
- user_to_phys ( top, 0 ), heap_size );
+ DBG ( "External heap grows downwards from %lx\n",
+ user_to_phys ( top, 0 ) );
+ return 0;
}
/**
@@ -76,7 +110,6 @@
*/
static void ecollect_free ( void ) {
struct external_memory extmem;
- size_t len;
/* Walk the free list and collect empty blocks */
while ( bottom != top ) {
@@ -86,9 +119,8 @@
break;
DBG ( "EXTMEM freeing [%lx,%lx)\n", user_to_phys ( bottom, 0 ),
user_to_phys ( bottom, extmem.size ) );
- len = ( extmem.size + sizeof ( extmem ) );
- bottom = userptr_add ( bottom, len );
- heap_size += len;
+ bottom = userptr_add ( bottom,
+ ( extmem.size + sizeof ( extmem ) ) );
}
}
@@ -106,10 +138,13 @@
struct external_memory extmem;
userptr_t new = ptr;
size_t align;
+ int rc;
- /* (Re)initialise external memory allocator if necessary */
- if ( bottom == top )
- init_eheap();
+ /* Initialise external memory allocator if necessary */
+ if ( bottom == top ) {
+ if ( ( rc = init_eheap() ) != 0 )
+ return UNULL;
+ }
/* Get block properties into extmem */
if ( ptr && ( ptr != UNOWHERE ) ) {
@@ -118,12 +153,7 @@
sizeof ( extmem ) );
} else {
/* Create a zero-length block */
- if ( heap_size < sizeof ( extmem ) ) {
- DBG ( "EXTMEM out of space\n" );
- return UNULL;
- }
ptr = bottom = userptr_add ( bottom, -sizeof ( extmem ) );
- heap_size -= sizeof ( extmem );
DBG ( "EXTMEM allocating [%lx,%lx)\n",
user_to_phys ( ptr, 0 ), user_to_phys ( ptr, 0 ) );
extmem.size = 0;
@@ -133,10 +163,6 @@
/* Expand/shrink block if possible */
if ( ptr == bottom ) {
/* Update block */
- if ( new_size > ( heap_size - extmem.size ) ) {
- DBG ( "EXTMEM out of space\n" );
- return UNULL;
- }
new = userptr_add ( ptr, - ( new_size - extmem.size ) );
align = ( user_to_phys ( new, 0 ) & ( EM_ALIGN - 1 ) );
new_size += align;
@@ -148,9 +174,8 @@
user_to_phys ( new, new_size ));
memmove_user ( new, 0, ptr, 0, ( ( extmem.size < new_size ) ?
extmem.size : new_size ) );
- bottom = new;
- heap_size -= ( new_size - extmem.size );
extmem.size = new_size;
+ bottom = new;
} else {
/* Cannot expand; can only pretend to shrink */
if ( new_size > extmem.size ) {
@@ -168,8 +193,7 @@
/* Collect any free blocks and update hidden memory region */
ecollect_free();
- hide_umalloc ( user_to_phys ( bottom, ( ( bottom == top ) ?
- 0 : -sizeof ( extmem ) ) ),
+ hide_umalloc ( user_to_phys ( bottom, -sizeof ( extmem ) ),
user_to_phys ( top, 0 ) );
return ( new_size ? new : UNOWHERE );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/pcibios.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/pcibios.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/pcibios.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/pcibios.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/rtc_entropy.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/rtc_entropy.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/rtc_entropy.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/rtc_entropy.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * RTC-based entropy source
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** RTC "interrupt triggered" flag */
-static uint8_t __text16 ( rtc_flag );
-#define rtc_flag __use_text16 ( rtc_flag )
-
-/** RTC interrupt handler */
-extern void rtc_isr ( void );
-
-/** Previous RTC interrupt handler */
-static struct segoff rtc_old_handler;
-
-/**
- * Hook RTC interrupt handler
- *
- */
-static void rtc_hook_isr ( void ) {
-
- /* RTC interrupt handler */
- __asm__ __volatile__ (
- TEXT16_CODE ( "\nrtc_isr:\n\t"
- /* Preserve registers */
- "pushw %%ax\n\t"
- /* Set "interrupt triggered" flag */
- "cs movb $0x01, %c0\n\t"
- /* Read RTC status register C to
- * acknowledge interrupt
- */
- "movb %3, %%al\n\t"
- "outb %%al, %1\n\t"
- "inb %2\n\t"
- /* Send EOI */
- "movb $0x20, %%al\n\t"
- "outb %%al, $0xa0\n\t"
- "outb %%al, $0x20\n\t"
- /* Restore registers and return */
- "popw %%ax\n\t"
- "iret\n\t" )
- :
- : "p" ( __from_text16 ( &rtc_flag ) ),
- "i" ( CMOS_ADDRESS ), "i" ( CMOS_DATA ),
- "i" ( RTC_STATUS_C ) );
-
- hook_bios_interrupt ( RTC_INT, ( unsigned int ) rtc_isr,
- &rtc_old_handler );
-}
-
-/**
- * Unhook RTC interrupt handler
- *
- */
-static void rtc_unhook_isr ( void ) {
- int rc;
-
- rc = unhook_bios_interrupt ( RTC_INT, ( unsigned int ) rtc_isr,
- &rtc_old_handler );
- assert ( rc == 0 ); /* Should always be able to unhook */
-}
-
-/**
- * Enable RTC interrupts
- *
- */
-static void rtc_enable_int ( void ) {
- uint8_t status_b;
-
- /* Set Periodic Interrupt Enable bit in status register B */
- outb ( ( RTC_STATUS_B | CMOS_DISABLE_NMI ), CMOS_ADDRESS );
- status_b = inb ( CMOS_DATA );
- outb ( ( RTC_STATUS_B | CMOS_DISABLE_NMI ), CMOS_ADDRESS );
- outb ( ( status_b | RTC_STATUS_B_PIE ), CMOS_DATA );
-
- /* Re-enable NMI and reset to default address */
- outb ( CMOS_DEFAULT_ADDRESS, CMOS_ADDRESS );
- inb ( CMOS_DATA ); /* Discard; may be needed on some platforms */
-}
-
-/**
- * Disable RTC interrupts
- *
- */
-static void rtc_disable_int ( void ) {
- uint8_t status_b;
-
- /* Clear Periodic Interrupt Enable bit in status register B */
- outb ( ( RTC_STATUS_B | CMOS_DISABLE_NMI ), CMOS_ADDRESS );
- status_b = inb ( CMOS_DATA );
- outb ( ( RTC_STATUS_B | CMOS_DISABLE_NMI ), CMOS_ADDRESS );
- outb ( ( status_b & ~RTC_STATUS_B_PIE ), CMOS_DATA );
-
- /* Re-enable NMI and reset to default address */
- outb ( CMOS_DEFAULT_ADDRESS, CMOS_ADDRESS );
- inb ( CMOS_DATA ); /* Discard; may be needed on some platforms */
-}
-
-/**
- * Enable entropy gathering
- *
- * @ret rc Return status code
- */
-static int rtc_entropy_enable ( void ) {
-
- rtc_hook_isr();
- enable_irq ( RTC_IRQ );
- rtc_enable_int();
-
- return 0;
-}
-
-/**
- * Disable entropy gathering
- *
- */
-static void rtc_entropy_disable ( void ) {
-
- rtc_disable_int();
- disable_irq ( RTC_IRQ );
- rtc_unhook_isr();
-}
-
-/**
- * Measure a single RTC tick
- *
- * @ret delta Length of RTC tick (in TSC units)
- */
-uint8_t rtc_sample ( void ) {
- uint32_t before;
- uint32_t after;
- uint32_t temp;
-
- __asm__ __volatile__ (
- REAL_CODE ( /* Enable interrupts */
- "sti\n\t"
- /* Wait for RTC interrupt */
- "cs movb %b2, %c4\n\t"
- "\n1:\n\t"
- "cs xchgb %b2, %c4\n\t" /* Serialize */
- "testb %b2, %b2\n\t"
- "jz 1b\n\t"
- /* Read "before" TSC */
- "rdtsc\n\t"
- /* Store "before" TSC on stack */
- "pushl %0\n\t"
- /* Wait for another RTC interrupt */
- "xorb %b2, %b2\n\t"
- "cs movb %b2, %c4\n\t"
- "\n1:\n\t"
- "cs xchgb %b2, %c4\n\t" /* Serialize */
- "testb %b2, %b2\n\t"
- "jz 1b\n\t"
- /* Read "after" TSC */
- "rdtsc\n\t"
- /* Retrieve "before" TSC on stack */
- "popl %1\n\t"
- /* Disable interrupts */
- "cli\n\t"
- )
- : "=a" ( after ), "=d" ( before ), "=q" ( temp )
- : "2" ( 0 ), "p" ( __from_text16 ( &rtc_flag ) ) );
-
- return ( after - before );
-}
-
-PROVIDE_ENTROPY_INLINE ( rtc, min_entropy_per_sample );
-PROVIDE_ENTROPY ( rtc, entropy_enable, rtc_entropy_enable );
-PROVIDE_ENTROPY ( rtc, entropy_disable, rtc_entropy_disable );
-PROVIDE_ENTROPY_INLINE ( rtc, get_noise );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/rtc_time.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/rtc_time.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pcbios/rtc_time.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pcbios/rtc_time.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * RTC-based time source
- *
- */
-
-#include
-#include
-#include
-#include
-
-/**
- * Read RTC register
- *
- * @v address Register address
- * @ret data Data
- */
-static unsigned int rtc_readb ( int address ) {
- outb ( address, CMOS_ADDRESS );
- return inb ( CMOS_DATA );
-}
-
-/**
- * Check if RTC update is in progress
- *
- * @ret is_busy RTC update is in progress
- */
-static int rtc_is_busy ( void ) {
- return ( rtc_readb ( RTC_STATUS_A ) & RTC_STATUS_A_UPDATE_IN_PROGRESS );
-}
-
-/**
- * Read RTC BCD register
- *
- * @v address Register address
- * @ret value Value
- */
-static unsigned int rtc_readb_bcd ( int address ) {
- unsigned int bcd;
-
- bcd = rtc_readb ( address );
- return ( bcd - ( 6 * ( bcd >> 4 ) ) );
-}
-
-/**
- * Read RTC time
- *
- * @ret time Time, in seconds
- */
-static time_t rtc_read_time ( void ) {
- unsigned int status_b;
- int is_binary;
- int is_24hour;
- unsigned int ( * read_component ) ( int address );
- struct tm tm;
- int is_pm;
- unsigned int hour;
- time_t time;
-
- /* Wait for any in-progress update to complete */
- while ( rtc_is_busy() ) {}
-
- /* Determine RTC mode */
- status_b = rtc_readb ( RTC_STATUS_B );
- is_binary = ( status_b & RTC_STATUS_B_BINARY );
- is_24hour = ( status_b & RTC_STATUS_B_24_HOUR );
- read_component = ( is_binary ? rtc_readb : rtc_readb_bcd );
-
- /* Read time values */
- tm.tm_sec = read_component ( RTC_SEC );
- tm.tm_min = read_component ( RTC_MIN );
- hour = read_component ( RTC_HOUR );
- if ( ! is_24hour ) {
- is_pm = ( hour >= 80 );
- hour = ( ( ( ( hour & 0x7f ) % 80 ) % 12 ) +
- ( is_pm ? 12 : 0 ) );
- }
- tm.tm_hour = hour;
- tm.tm_mday = read_component ( RTC_MDAY );
- tm.tm_mon = ( read_component ( RTC_MON ) - 1 );
- tm.tm_year = ( read_component ( RTC_YEAR ) +
- 100 /* Assume we are in the 21st century, since
- * this code was written in 2012 */ );
-
- DBGC ( RTC_STATUS_A, "RTCTIME is %04d-%02d-%02d %02d:%02d:%02d "
- "(%s,%d-hour)\n", ( tm.tm_year + 1900 ), ( tm.tm_mon + 1 ),
- tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec,
- ( is_binary ? "binary" : "BCD" ), ( is_24hour ? 24 : 12 ) );
-
- /* Convert to seconds since the Epoch */
- time = mktime ( &tm );
-
- return time;
-}
-
-/**
- * Get current time in seconds
- *
- * @ret time Time, in seconds
- */
-static time_t rtc_now ( void ) {
- time_t time = 0;
- time_t last_time;
-
- /* Read time until we get two matching values in a row, in
- * case we end up reading a corrupted value in the middle of
- * an update.
- */
- do {
- last_time = time;
- time = rtc_read_time();
- } while ( time != last_time );
-
- return time;
-}
-
-PROVIDE_TIME ( rtc, time_now, rtc_now );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_call.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_call.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_call.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_call.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -32,12 +31,6 @@
* PXE API entry point
*/
-/* Disambiguate the various error causes */
-#define EINFO_EPXENBP \
- __einfo_uniqify ( EINFO_EPLATFORM, 0x01, \
- "External PXE NBP error" )
-#define EPXENBP( status ) EPLATFORM ( EINFO_EPXENBP, status )
-
/** Vector for chaining INT 1A */
extern struct segoff __text16 ( pxe_int_1a_vector );
#define pxe_int_1a_vector __use_text16 ( pxe_int_1a_vector )
@@ -263,7 +256,7 @@
int pxe_start_nbp ( void ) {
int jmp;
int discard_b, discard_c, discard_d, discard_D;
- uint16_t status;
+ uint16_t rc;
/* Allow restarting NBP via PXENV_RESTART_TFTP */
jmp = rmsetjmp ( pxe_restart_nbp );
@@ -271,26 +264,22 @@
DBG ( "Restarting NBP (%x)\n", jmp );
/* Far call to PXE NBP */
- __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "movw %%cx, %%es\n\t"
+ __asm__ __volatile__ ( REAL_CODE ( "movw %%cx, %%es\n\t"
"pushw %%es\n\t"
"pushw %%di\n\t"
"sti\n\t"
"lcall $0, $0x7c00\n\t"
- "popl %%ebp\n\t" /* discard */
- "popl %%ebp\n\t" /* gcc bug */ )
- : "=a" ( status ), "=b" ( discard_b ),
+ "addw $4, %%sp\n\t" )
+ : "=a" ( rc ), "=b" ( discard_b ),
"=c" ( discard_c ), "=d" ( discard_d ),
"=D" ( discard_D )
: "a" ( 0 ), "b" ( __from_text16 ( &pxenv ) ),
"c" ( rm_cs ),
"d" ( virt_to_phys ( &pxenv ) ),
"D" ( __from_text16 ( &ppxe ) )
- : "esi", "memory" );
- if ( status )
- return -EPXENBP ( status );
+ : "esi", "ebp", "memory" );
- return 0;
+ return rc;
}
REQUIRE_OBJECT ( pxe_preboot );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_entry.S ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_entry.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_entry.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_entry.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_exit_hook.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_exit_hook.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_exit_hook.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_exit_hook.c 2012-01-06 23:49:04.000000000 +0000
@@ -19,8 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_file.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_file.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_file.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_file.c 2012-01-06 23:49:04.000000000 +0000
@@ -29,8 +29,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -234,42 +233,6 @@
}
/**
- * FILE CMDLINE
- *
- * @v file_cmdline Pointer to a struct s_PXENV_FILE_CMDLINE
- * @v s_PXENV_FILE_CMDLINE::Buffer Buffer to contain command line
- * @v s_PXENV_FILE_CMDLINE::BufferSize Size of buffer
- * @ret #PXENV_EXIT_SUCCESS Command was executed successfully
- * @ret #PXENV_EXIT_FAILURE Command was not executed successfully
- * @ret s_PXENV_FILE_EXEC::Status PXE status code
- * @ret s_PXENV_FILE_EXEC::BufferSize Length of command line (including NUL)
- *
- */
-static PXENV_EXIT_t
-pxenv_file_cmdline ( struct s_PXENV_FILE_CMDLINE *file_cmdline ) {
- userptr_t buffer;
- size_t max_len;
- size_t len;
-
- DBG ( "PXENV_FILE_CMDLINE to %04x:%04x+%04x \"%s\"\n",
- file_cmdline->Buffer.segment, file_cmdline->Buffer.offset,
- file_cmdline->BufferSize, pxe_cmdline );
-
- buffer = real_to_user ( file_cmdline->Buffer.segment,
- file_cmdline->Buffer.offset );
- len = file_cmdline->BufferSize;
- max_len = ( pxe_cmdline ?
- ( strlen ( pxe_cmdline ) + 1 /* NUL */ ) : 0 );
- if ( len > max_len )
- len = max_len;
- copy_to_user ( buffer, 0, pxe_cmdline, len );
- file_cmdline->BufferSize = max_len;
-
- file_cmdline->Status = PXENV_STATUS_SUCCESS;
- return PXENV_EXIT_SUCCESS;
-}
-
-/**
* FILE API CHECK
*
* @v file_exec Pointer to a struct s_PXENV_FILE_API_CHECK
@@ -335,8 +298,6 @@
struct s_PXENV_GET_FILE_SIZE ),
PXE_API_CALL ( PXENV_FILE_EXEC, pxenv_file_exec,
struct s_PXENV_FILE_EXEC ),
- PXE_API_CALL ( PXENV_FILE_CMDLINE, pxenv_file_cmdline,
- struct s_PXENV_FILE_CMDLINE ),
PXE_API_CALL ( PXENV_FILE_API_CHECK, pxenv_file_api_check,
struct s_PXENV_FILE_API_CHECK ),
};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_loader.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_loader.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_loader.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_loader.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_preboot.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_preboot.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_preboot.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_preboot.c 2012-01-06 23:49:04.000000000 +0000
@@ -20,8 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_tftp.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_tftp.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_tftp.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_tftp.c 2012-01-06 23:49:04.000000000 +0000
@@ -19,8 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -72,17 +71,6 @@
}
/**
- * Check flow control window
- *
- * @v pxe_tftp PXE TFTP connection
- * @ret len Length of window
- */
-static size_t pxe_tftp_xfer_window ( struct pxe_tftp_connection *pxe_tftp ) {
-
- return pxe_tftp->blksize;
-}
-
-/**
* Receive new data
*
* @v pxe_tftp PXE TFTP connection
@@ -139,8 +127,6 @@
static struct interface_operation pxe_tftp_xfer_ops[] = {
INTF_OP ( xfer_deliver, struct pxe_tftp_connection *,
pxe_tftp_xfer_deliver ),
- INTF_OP ( xfer_window, struct pxe_tftp_connection *,
- pxe_tftp_xfer_window ),
INTF_OP ( intf_close, struct pxe_tftp_connection *, pxe_tftp_close ),
};
@@ -180,19 +166,19 @@
/* Reset PXE TFTP connection structure */
memset ( &pxe_tftp, 0, sizeof ( pxe_tftp ) );
intf_init ( &pxe_tftp.xfer, &pxe_tftp_xfer_desc, NULL );
- if ( blksize < TFTP_DEFAULT_BLKSIZE )
- blksize = TFTP_DEFAULT_BLKSIZE;
- pxe_tftp.blksize = blksize;
pxe_tftp.rc = -EINPROGRESS;
/* Construct URI string */
address.s_addr = ipaddress;
if ( ! port )
port = htons ( TFTP_PORT );
- snprintf ( uri_string, sizeof ( uri_string ), "tftp%s://%s:%d%s%s",
- sizeonly ? "size" : "", inet_ntoa ( address ),
- ntohs ( port ), ( ( filename[0] == '/' ) ? "" : "/" ),
- filename );
+ if ( blksize < TFTP_DEFAULT_BLKSIZE )
+ blksize = TFTP_DEFAULT_BLKSIZE;
+ snprintf ( uri_string, sizeof ( uri_string ),
+ "tftp%s://%s:%d%s%s?blksize=%zd",
+ sizeonly ? "size" : "",
+ inet_ntoa ( address ), ntohs ( port ),
+ ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize );
DBG ( " %s", uri_string );
/* Open PXE TFTP connection */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_udp.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_udp.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_udp.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_udp.c 2012-01-06 23:49:04.000000000 +0000
@@ -28,8 +28,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_undi.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_undi.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxe/pxe_undi.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxe/pxe_undi.c 2012-01-06 23:49:04.000000000 +0000
@@ -19,8 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -358,8 +357,7 @@
}
/* Allocate and fill I/O buffer */
- iobuf = alloc_iob ( MAX_LL_HEADER_LEN +
- ( ( len > IOB_ZLEN ) ? len : IOB_ZLEN ) );
+ iobuf = alloc_iob ( MAX_LL_HEADER_LEN + len );
if ( ! iobuf ) {
DBGC2 ( &pxe_netdev, " could not allocate iobuf\n" );
undi_transmit->Status = PXENV_STATUS_OUT_OF_RESOURCES;
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxeparent/pxeparent.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxeparent/pxeparent.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxeparent/pxeparent.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxeparent/pxeparent.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
@@ -31,12 +30,6 @@
*
*/
-/* Disambiguate the various error causes */
-#define EINFO_EPXECALL \
- __einfo_uniqify ( EINFO_EPLATFORM, 0x01, \
- "External PXE API error" )
-#define EPXECALL( status ) EPLATFORM ( EINFO_EPXECALL, status )
-
/**
* Name PXE API call
*
@@ -143,24 +136,30 @@
/* Call real-mode entry point. This calling convention will
* work with both the !PXE and the PXENV+ entry points.
*/
- __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
- "pushw %%es\n\t"
+ __asm__ __volatile__ ( REAL_CODE ( "pushw %%es\n\t"
"pushw %%di\n\t"
"pushw %%bx\n\t"
"lcall *pxeparent_entry_point\n\t"
- "addw $6, %%sp\n\t"
- "popl %%ebp\n\t" /* gcc bug */ )
+ "addw $6, %%sp\n\t" )
: "=a" ( exit ), "=b" ( discard_b ),
"=D" ( discard_D )
: "b" ( function ),
"D" ( __from_data16 ( &pxeparent_params ) )
- : "ecx", "edx", "esi" );
+ : "ecx", "edx", "esi", "ebp" );
/* Determine return status code based on PXENV_EXIT and
* PXENV_STATUS
*/
- rc = ( ( exit == PXENV_EXIT_SUCCESS ) ?
- 0 : -EPXECALL ( pxeparent_params.Status ) );
+ if ( exit == PXENV_EXIT_SUCCESS ) {
+ rc = 0;
+ } else {
+ rc = -pxeparent_params.Status;
+ /* Paranoia; don't return success for the combination
+ * of PXENV_EXIT_FAILURE but PXENV_STATUS_SUCCESS
+ */
+ if ( rc == 0 )
+ rc = -EIO;
+ }
/* If anything goes wrong, print as much debug information as
* it's possible to give.
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/pxeparent/pxeparent_dhcp.c 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2009 Joshua Oreman .
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**
+ * Present cached DHCP packet if it exists
+ */
+void get_cached_dhcpack ( void ) {
+ struct undi_device *undi;
+ struct s_PXENV_GET_CACHED_INFO get_cached_info;
+ int rc;
+
+ /* Use preloaded UNDI device to get at PXE entry point */
+ undi = &preloaded_undi;
+ if ( ! undi->entry.segment ) {
+ DBG ( "PXEDHCP no preloaded UNDI device found\n" );
+ return;
+ }
+
+ /* Check that stack is available to get cached info */
+ if ( ! ( undi->flags & UNDI_FL_KEEP_ALL ) ) {
+ DBG ( "PXEDHCP stack was unloaded, no cache available\n" );
+ return;
+ }
+
+ /* Obtain cached DHCP packet */
+ memset ( &get_cached_info, 0, sizeof ( get_cached_info ) );
+ get_cached_info.PacketType = PXENV_PACKET_TYPE_DHCP_ACK;
+
+ if ( ( rc = pxeparent_call ( undi->entry, PXENV_GET_CACHED_INFO,
+ &get_cached_info,
+ sizeof ( get_cached_info ) ) ) != 0 ) {
+ DBG ( "PXEDHCP GET_CACHED_INFO failed: %s\n", strerror ( rc ) );
+ return;
+ }
+
+ DBG ( "PXEDHCP got cached info at %04x:%04x length %d\n",
+ get_cached_info.Buffer.segment, get_cached_info.Buffer.offset,
+ get_cached_info.BufferSize );
+
+ /* Present cached DHCP packet */
+ store_cached_dhcpack ( real_to_user ( get_cached_info.Buffer.segment,
+ get_cached_info.Buffer.offset ),
+ get_cached_info.BufferSize );
+}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/syslinux/com32_call.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/syslinux/com32_call.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/syslinux/com32_call.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/syslinux/com32_call.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/syslinux/com32_wrapper.S ipxe-1.0.1~lliurex1505/src/arch/i386/interface/syslinux/com32_wrapper.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/syslinux/com32_wrapper.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/syslinux/com32_wrapper.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER )
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/syslinux/comboot_call.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/syslinux/comboot_call.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/syslinux/comboot_call.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/syslinux/comboot_call.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
@@ -39,13 +38,12 @@
#include
#include
#include
-#include
#include
#include "config/console.h"
#include "config/serial.h"
/** The "SYSLINUX" version string */
-static char __bss16_array ( syslinux_version, [32] );
+static char __data16_array ( syslinux_version, [] ) = "\r\niPXE " VERSION;
#define syslinux_version __use_data16 ( syslinux_version )
/** The "SYSLINUX" copyright string */
@@ -168,8 +166,6 @@
* Fetch kernel and optional initrd
*/
static int comboot_fetch_kernel ( char *kernel_file, char *cmdline ) {
- struct image *kernel;
- struct image *initrd;
char *initrd_file;
int rc;
@@ -188,7 +184,8 @@
DBG ( "COMBOOT: fetching initrd '%s'\n", initrd_file );
/* Fetch initrd */
- if ( ( rc = imgdownload_string ( initrd_file, &initrd ) ) != 0){
+ if ( ( rc = imgdownload_string ( initrd_file, NULL, NULL,
+ NULL ) ) != 0 ) {
DBG ( "COMBOOT: could not fetch initrd: %s\n",
strerror ( rc ) );
return rc;
@@ -201,20 +198,14 @@
DBG ( "COMBOOT: fetching kernel '%s'\n", kernel_file );
- /* Fetch kernel */
- if ( ( rc = imgdownload_string ( kernel_file, &kernel ) ) != 0 ) {
+ /* Allocate and fetch kernel */
+ if ( ( rc = imgdownload_string ( kernel_file, NULL, cmdline,
+ image_replace ) ) != 0 ) {
DBG ( "COMBOOT: could not fetch kernel: %s\n",
strerror ( rc ) );
return rc;
}
- /* Replace comboot image with kernel */
- if ( ( rc = image_replace ( kernel ) ) != 0 ) {
- DBG ( "COMBOOT: could not replace with kernel: %s\n",
- strerror ( rc ) );
- return rc;
- }
-
return 0;
}
@@ -327,10 +318,6 @@
/* SYSLINUX derivative ID */
ix86->regs.dl = BZI_LOADER_TYPE_IPXE;
- /* SYSLINUX version */
- snprintf ( syslinux_version, sizeof ( syslinux_version ),
- "\r\niPXE %s", product_version );
-
/* SYSLINUX version and copyright strings */
ix86->segs.es = rm_ds;
ix86->regs.si = ( ( unsigned ) __from_data16 ( syslinux_version ) );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/guestinfo.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/guestinfo.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/guestinfo.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/guestinfo.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,271 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * VMware GuestInfo settings
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** GuestInfo GuestRPC channel */
-static int guestinfo_channel;
-
-/**
- * Fetch value of typed GuestInfo setting
- *
- * @v settings Settings block
- * @v setting Setting to fetch
- * @v type Setting type to attempt (or NULL for default)
- * @v data Buffer to fill with setting data
- * @v len Length of buffer
- * @ret found Setting found in GuestInfo
- * @ret len Length of setting data, or negative error
- */
-static int guestinfo_fetch_type ( struct settings *settings,
- struct setting *setting,
- struct setting_type *type,
- void *data, size_t len, int *found ) {
- const char *parent_name = settings->parent->name;
- char command[ 24 /* "info-get guestinfo.ipxe." */ +
- strlen ( parent_name ) + 1 /* "." */ +
- strlen ( setting->name ) + 1 /* "." */ +
- ( type ? strlen ( type->name ) : 0 ) + 1 /* NUL */ ];
- struct setting *predefined;
- char *info;
- int info_len;
- int check_len;
- int ret;
-
- /* Construct info-get command */
- snprintf ( command, sizeof ( command ),
- "info-get guestinfo.ipxe.%s%s%s%s%s",
- parent_name, ( parent_name[0] ? "." : "" ), setting->name,
- ( type ? "." : "" ), ( type ? type->name : "" ) );
-
- /* Check for existence and obtain length of GuestInfo value */
- info_len = guestrpc_command ( guestinfo_channel, command, NULL, 0 );
- if ( info_len < 0 ) {
- ret = info_len;
- goto err_get_info_len;
- }
-
- /* Mark as found */
- *found = 1;
-
- /* Determine default type if necessary */
- if ( ! type ) {
- predefined = find_setting ( setting->name );
- type = ( predefined ? predefined->type : &setting_type_string );
- }
- assert ( type != NULL );
-
- /* Allocate temporary block to hold GuestInfo value */
- info = zalloc ( info_len + 1 /* NUL */ );
- if ( ! info ) {
- DBGC ( settings, "GuestInfo %p could not allocate %d bytes\n",
- settings, info_len );
- ret = -ENOMEM;
- goto err_alloc;
- }
- info[info_len] = '\0';
-
- /* Fetch GuestInfo value */
- check_len = guestrpc_command ( guestinfo_channel, command,
- info, info_len );
- if ( check_len < 0 ) {
- ret = check_len;
- goto err_get_info;
- }
- if ( check_len != info_len ) {
- DBGC ( settings, "GuestInfo %p length mismatch (expected %d, "
- "got %d)\n", settings, info_len, check_len );
- ret = -EIO;
- goto err_get_info;
- }
- DBGC2 ( settings, "GuestInfo %p found %s = \"%s\"\n",
- settings, &command[9] /* Skip "info-get " */, info );
-
- /* Parse GuestInfo value according to type */
- ret = setting_parse ( type, info, data, len );
- if ( ret < 0 ) {
- DBGC ( settings, "GuestInfo %p could not parse \"%s\" as %s: "
- "%s\n", settings, info, type->name, strerror ( ret ) );
- goto err_parse;
- }
-
- err_parse:
- err_get_info:
- free ( info );
- err_alloc:
- err_get_info_len:
- return ret;
-}
-
-/**
- * Fetch value of GuestInfo setting
- *
- * @v settings Settings block
- * @v setting Setting to fetch
- * @v data Buffer to fill with setting data
- * @v len Length of buffer
- * @ret len Length of setting data, or negative error
- */
-static int guestinfo_fetch ( struct settings *settings,
- struct setting *setting,
- void *data, size_t len ) {
- struct setting_type *type;
- int found = 0;
- int ret;
-
- /* Try default type first */
- ret = guestinfo_fetch_type ( settings, setting, NULL,
- data, len, &found );
- if ( found )
- return ret;
-
- /* Otherwise, try all possible types */
- for_each_table_entry ( type, SETTING_TYPES ) {
- ret = guestinfo_fetch_type ( settings, setting, type,
- data, len, &found );
- if ( found )
- return ret;
- }
-
- /* Not found */
- return -ENOENT;
-}
-
-/** GuestInfo settings operations */
-static struct settings_operations guestinfo_settings_operations = {
- .fetch = guestinfo_fetch,
-};
-
-/** GuestInfo settings */
-static struct settings guestinfo_settings = {
- .refcnt = NULL,
- .siblings = LIST_HEAD_INIT ( guestinfo_settings.siblings ),
- .children = LIST_HEAD_INIT ( guestinfo_settings.children ),
- .op = &guestinfo_settings_operations,
-};
-
-/** Initialise GuestInfo settings */
-static void guestinfo_init ( void ) {
- int rc;
-
- /* Open GuestRPC channel */
- guestinfo_channel = guestrpc_open();
- if ( guestinfo_channel < 0 ) {
- rc = guestinfo_channel;
- DBG ( "GuestInfo could not open channel: %s\n",
- strerror ( rc ) );
- return;
- }
-
- /* Register root GuestInfo settings */
- if ( ( rc = register_settings ( &guestinfo_settings, NULL,
- "vmware" ) ) != 0 ) {
- DBG ( "GuestInfo could not register settings: %s\n",
- strerror ( rc ) );
- return;
- }
-}
-
-/** GuestInfo settings initialiser */
-struct init_fn guestinfo_init_fn __init_fn ( INIT_NORMAL ) = {
- .initialise = guestinfo_init,
-};
-
-/**
- * Create per-netdevice GuestInfo settings
- *
- * @v netdev Network device
- * @ret rc Return status code
- */
-static int guestinfo_net_probe ( struct net_device *netdev ) {
- struct settings *settings;
- int rc;
-
- /* Do nothing unless we have a GuestInfo channel available */
- if ( guestinfo_channel < 0 )
- return 0;
-
- /* Allocate and initialise settings block */
- settings = zalloc ( sizeof ( *settings ) );
- if ( ! settings ) {
- rc = -ENOMEM;
- goto err_alloc;
- }
- settings_init ( settings, &guestinfo_settings_operations, NULL, NULL );
-
- /* Register settings */
- if ( ( rc = register_settings ( settings, netdev_settings ( netdev ),
- "vmware" ) ) != 0 ) {
- DBGC ( settings, "GuestInfo %p could not register for %s: %s\n",
- settings, netdev->name, strerror ( rc ) );
- goto err_register;
- }
- DBGC ( settings, "GuestInfo %p registered for %s\n",
- settings, netdev->name );
-
- return 0;
-
- err_register:
- free ( settings );
- err_alloc:
- return rc;
-}
-
-/**
- * Remove per-netdevice GuestInfo settings
- *
- * @v netdev Network device
- */
-static void guestinfo_net_remove ( struct net_device *netdev ) {
- struct settings *parent = netdev_settings ( netdev );
- struct settings *settings;
-
- list_for_each_entry ( settings, &parent->children, siblings ) {
- if ( settings->op == &guestinfo_settings_operations ) {
- DBGC ( settings, "GuestInfo %p unregistered for %s\n",
- settings, netdev->name );
- unregister_settings ( settings );
- free ( settings );
- return;
- }
- }
-}
-
-/** GuestInfo per-netdevice driver */
-struct net_driver guestinfo_net_driver __net_driver = {
- .name = "GuestInfo",
- .probe = guestinfo_net_probe,
- .remove = guestinfo_net_remove,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/guestrpc.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/guestrpc.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/guestrpc.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/guestrpc.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,328 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * VMware GuestRPC mechanism
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* Disambiguate the various error causes */
-#define EPROTO_OPEN __einfo_error ( EINFO_EPROTO_OPEN )
-#define EINFO_EPROTO_OPEN \
- __einfo_uniqify ( EINFO_EPROTO, 0x00, "GuestRPC open failed" )
-#define EPROTO_COMMAND_LEN __einfo_error ( EINFO_EPROTO_COMMAND_LEN )
-#define EINFO_EPROTO_COMMAND_LEN \
- __einfo_uniqify ( EINFO_EPROTO, 0x01, "GuestRPC command length failed" )
-#define EPROTO_COMMAND_DATA __einfo_error ( EINFO_EPROTO_COMMAND_DATA )
-#define EINFO_EPROTO_COMMAND_DATA \
- __einfo_uniqify ( EINFO_EPROTO, 0x02, "GuestRPC command data failed" )
-#define EPROTO_REPLY_LEN __einfo_error ( EINFO_EPROTO_REPLY_LEN )
-#define EINFO_EPROTO_REPLY_LEN \
- __einfo_uniqify ( EINFO_EPROTO, 0x03, "GuestRPC reply length failed" )
-#define EPROTO_REPLY_DATA __einfo_error ( EINFO_EPROTO_REPLY_DATA )
-#define EINFO_EPROTO_REPLY_DATA \
- __einfo_uniqify ( EINFO_EPROTO, 0x04, "GuestRPC reply data failed" )
-#define EPROTO_REPLY_FINISH __einfo_error ( EINFO_EPROTO_REPLY_FINISH )
-#define EINFO_EPROTO_REPLY_FINISH \
- __einfo_uniqify ( EINFO_EPROTO, 0x05, "GuestRPC reply finish failed" )
-#define EPROTO_CLOSE __einfo_error ( EINFO_EPROTO_CLOSE )
-#define EINFO_EPROTO_CLOSE \
- __einfo_uniqify ( EINFO_EPROTO, 0x06, "GuestRPC close failed" )
-
-/**
- * Open GuestRPC channel
- *
- * @ret channel Channel number, or negative error
- */
-int guestrpc_open ( void ) {
- uint16_t channel;
- uint32_t discard_b;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( 0, GUESTRPC_OPEN, GUESTRPC_MAGIC,
- &channel, &discard_b );
- if ( status != GUESTRPC_OPEN_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC open failed: status %08x\n",
- status );
- return -EPROTO_OPEN;
- }
-
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d opened\n", channel );
- return channel;
-}
-
-/**
- * Send GuestRPC command length
- *
- * @v channel Channel number
- * @v len Command length
- * @ret rc Return status code
- */
-static int guestrpc_command_len ( int channel, size_t len ) {
- uint16_t discard_d;
- uint32_t discard_b;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( channel, GUESTRPC_COMMAND_LEN, len,
- &discard_d, &discard_b );
- if ( status != GUESTRPC_COMMAND_LEN_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d send command "
- "length %zd failed: status %08x\n",
- channel, len, status );
- return -EPROTO_COMMAND_LEN;
- }
-
- return 0;
-}
-
-/**
- * Send GuestRPC command data
- *
- * @v channel Channel number
- * @v data Command data
- * @ret rc Return status code
- */
-static int guestrpc_command_data ( int channel, uint32_t data ) {
- uint16_t discard_d;
- uint32_t discard_b;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( channel, GUESTRPC_COMMAND_DATA, data,
- &discard_d, &discard_b );
- if ( status != GUESTRPC_COMMAND_DATA_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d send command "
- "data %08x failed: status %08x\n",
- channel, data, status );
- return -EPROTO_COMMAND_DATA;
- }
-
- return 0;
-}
-
-/**
- * Receive GuestRPC reply length
- *
- * @v channel Channel number
- * @ret reply_id Reply ID
- * @ret len Reply length, or negative error
- */
-static int guestrpc_reply_len ( int channel, uint16_t *reply_id ) {
- uint32_t len;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( channel, GUESTRPC_REPLY_LEN, 0,
- reply_id, &len );
- if ( status != GUESTRPC_REPLY_LEN_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d receive reply "
- "length failed: status %08x\n", channel, status );
- return -EPROTO_REPLY_LEN;
- }
-
- return len;
-}
-
-/**
- * Receive GuestRPC reply data
- *
- * @v channel Channel number
- * @v reply_id Reply ID
- * @ret data Reply data
- * @ret rc Return status code
- */
-static int guestrpc_reply_data ( int channel, uint16_t reply_id,
- uint32_t *data ) {
- uint16_t discard_d;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( channel, GUESTRPC_REPLY_DATA, reply_id,
- &discard_d, data );
- if ( status != GUESTRPC_REPLY_DATA_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d receive reply "
- "%d data failed: status %08x\n",
- channel, reply_id, status );
- return -EPROTO_REPLY_DATA;
- }
-
- return 0;
-}
-
-/**
- * Finish receiving GuestRPC reply
- *
- * @v channel Channel number
- * @v reply_id Reply ID
- * @ret rc Return status code
- */
-static int guestrpc_reply_finish ( int channel, uint16_t reply_id ) {
- uint16_t discard_d;
- uint32_t discard_b;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( channel, GUESTRPC_REPLY_FINISH, reply_id,
- &discard_d, &discard_b );
- if ( status != GUESTRPC_REPLY_FINISH_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d finish reply %d "
- "failed: status %08x\n", channel, reply_id, status );
- return -EPROTO_REPLY_FINISH;
- }
-
- return 0;
-}
-
-/**
- * Close GuestRPC channel
- *
- * @v channel Channel number
- */
-void guestrpc_close ( int channel ) {
- uint16_t discard_d;
- uint32_t discard_b;
- uint32_t status;
-
- /* Issue GuestRPC command */
- status = vmware_cmd_guestrpc ( channel, GUESTRPC_CLOSE, 0,
- &discard_d, &discard_b );
- if ( status != GUESTRPC_CLOSE_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d close failed: "
- "status %08x\n", channel, status );
- return;
- }
-
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d closed\n", channel );
-}
-
-/**
- * Issue GuestRPC command
- *
- * @v channel Channel number
- * @v command Command
- * @v reply Reply buffer
- * @v reply_len Length of reply buffer
- * @ret len Length of reply, or negative error
- *
- * The actual length of the reply will be returned even if the buffer
- * was too small.
- */
-int guestrpc_command ( int channel, const char *command, char *reply,
- size_t reply_len ) {
- const uint8_t *command_bytes = ( ( const void * ) command );
- uint8_t *reply_bytes = ( ( void * ) reply );
- size_t command_len = strlen ( command );
- int orig_reply_len = reply_len;
- uint16_t status;
- uint8_t *status_bytes = ( ( void * ) &status );
- size_t status_len = sizeof ( status );
- uint32_t data;
- uint16_t reply_id;
- int len;
- int remaining;
- unsigned int i;
- int rc;
-
- DBGC2 ( GUESTRPC_MAGIC, "GuestRPC channel %d issuing command:\n",
- channel );
- DBGC2_HDA ( GUESTRPC_MAGIC, 0, command, command_len );
-
- /* Sanity check */
- assert ( ( reply != NULL ) || ( reply_len == 0 ) );
-
- /* Send command length */
- if ( ( rc = guestrpc_command_len ( channel, command_len ) ) < 0 )
- return rc;
-
- /* Send command data */
- while ( command_len ) {
- data = 0;
- for ( i = sizeof ( data ) ; i ; i-- ) {
- if ( command_len ) {
- data = ( ( data & ~0xff ) |
- *(command_bytes++) );
- command_len--;
- }
- data = ( ( data << 24 ) | ( data >> 8 ) );
- }
- if ( ( rc = guestrpc_command_data ( channel, data ) ) < 0 )
- return rc;
- }
-
- /* Receive reply length */
- if ( ( len = guestrpc_reply_len ( channel, &reply_id ) ) < 0 ) {
- rc = len;
- return rc;
- }
-
- /* Receive reply */
- for ( remaining = len ; remaining > 0 ; remaining -= sizeof ( data ) ) {
- if ( ( rc = guestrpc_reply_data ( channel, reply_id,
- &data ) ) < 0 ) {
- return rc;
- }
- for ( i = sizeof ( data ) ; i ; i-- ) {
- if ( status_len ) {
- *(status_bytes++) = ( data & 0xff );
- status_len--;
- len--;
- } else if ( reply_len ) {
- *(reply_bytes++) = ( data & 0xff );
- reply_len--;
- }
- data = ( ( data << 24 ) | ( data >> 8 ) );
- }
- }
-
- /* Finish receiving RPC reply */
- if ( ( rc = guestrpc_reply_finish ( channel, reply_id ) ) < 0 )
- return rc;
-
- DBGC2 ( GUESTRPC_MAGIC, "GuestRPC channel %d received reply (id %d, "
- "length %d):\n", channel, reply_id, len );
- DBGC2_HDA ( GUESTRPC_MAGIC, 0, &status, sizeof ( status ) );
- DBGC2_HDA ( GUESTRPC_MAGIC, sizeof ( status ), reply,
- ( ( len < orig_reply_len ) ? len : orig_reply_len ) );
-
- /* Check reply status */
- if ( status != GUESTRPC_SUCCESS ) {
- DBGC ( GUESTRPC_MAGIC, "GuestRPC channel %d command failed "
- "(status %04x, reply id %d, reply length %d):\n",
- channel, status, reply_id, len );
- DBGC_HDA ( GUESTRPC_MAGIC, 0, command, command_len );
- DBGC_HDA ( GUESTRPC_MAGIC, 0, &status, sizeof ( status ) );
- DBGC_HDA ( GUESTRPC_MAGIC, sizeof ( status ), reply,
- ( ( len < orig_reply_len ) ? len : orig_reply_len ));
- return -EIO;
- }
-
- return len;
-}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/vmconsole.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/vmconsole.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/vmconsole.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/vmconsole.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * VMware logfile console
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** VMware logfile console buffer size */
-#define VMCONSOLE_BUFSIZE 128
-
-/* Set default console usage if applicable */
-#if ! ( defined ( CONSOLE_VMWARE ) && CONSOLE_EXPLICIT ( CONSOLE_VMWARE ) )
-#undef CONSOLE_VMWARE
-#define CONSOLE_VMWARE ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )
-#endif
-
-/** VMware logfile console GuestRPC channel */
-static int vmconsole_channel;
-
-/** VMware logfile console line buffer */
-static struct {
- char prefix[4];
- char message[VMCONSOLE_BUFSIZE];
-} vmconsole_buffer = {
- .prefix = "log ",
-};
-
-/** VMware logfile console ANSI escape sequence handlers */
-static struct ansiesc_handler vmconsole_handlers[] = {
- { 0, NULL }
-};
-
-/** VMware logfile line console */
-static struct line_console vmconsole_line = {
- .buffer = vmconsole_buffer.message,
- .len = sizeof ( vmconsole_buffer.message ),
- .ctx = {
- .handlers = vmconsole_handlers,
- },
-};
-
-/** VMware logfile console recursion marker */
-static int vmconsole_entered;
-
-/**
- * Print a character to VMware logfile console
- *
- * @v character Character to be printed
- */
-static void vmconsole_putchar ( int character ) {
- int rc;
-
- /* Ignore if we are already mid-logging */
- if ( vmconsole_entered )
- return;
-
- /* Fill line buffer */
- if ( line_putchar ( &vmconsole_line, character ) == 0 )
- return;
-
- /* Guard against re-entry */
- vmconsole_entered = 1;
-
- /* Send log message */
- if ( ( rc = guestrpc_command ( vmconsole_channel,
- vmconsole_buffer.prefix, NULL, 0 ) ) <0){
- DBG ( "VMware console could not send log message: %s\n",
- strerror ( rc ) );
- }
-
- /* Clear re-entry flag */
- vmconsole_entered = 0;
-}
-
-/** VMware logfile console driver */
-struct console_driver vmconsole __console_driver = {
- .putchar = vmconsole_putchar,
- .disabled = 1,
- .usage = CONSOLE_VMWARE,
-};
-
-/**
- * Initialise VMware logfile console
- *
- */
-static void vmconsole_init ( void ) {
- int rc;
-
- /* Attempt to open console */
- vmconsole_channel = guestrpc_open();
- if ( vmconsole_channel < 0 ) {
- rc = vmconsole_channel;
- DBG ( "VMware console could not be initialised: %s\n",
- strerror ( rc ) );
- return;
- }
-
- /* Mark console as available */
- vmconsole.disabled = 0;
-}
-
-/**
- * VMware logfile console initialisation function
- */
-struct init_fn vmconsole_init_fn __init_fn ( INIT_CONSOLE ) = {
- .initialise = vmconsole_init,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/vmware.c ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/vmware.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/interface/vmware/vmware.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/interface/vmware/vmware.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * VMware backdoor mechanism
- *
- * Based on the unofficial documentation at
- *
- * http://sites.google.com/site/chitchatvmback/backdoor
- *
- */
-
-#include
-#include
-#include
-
-/**
- * Detect VMware presence
- *
- * @ret rc Return status code
- */
-int vmware_present ( void ) {
- uint32_t version;
- uint32_t magic;
- uint32_t product_type;
-
- /* Perform backdoor call */
- vmware_cmd_get_version ( &version, &magic, &product_type );
-
- /* Check for VMware presence */
- if ( magic != VMW_MAGIC ) {
- DBGC ( VMW_MAGIC, "VMware not present\n" );
- return -ENOENT;
- }
-
- DBGC ( VMW_MAGIC, "VMware product type %04x version %08x detected\n",
- product_type, version );
- return 0;
-}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/Makefile ipxe-1.0.1~lliurex1505/src/arch/i386/Makefile
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/Makefile 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/Makefile 2012-01-06 23:49:04.000000000 +0000
@@ -54,8 +54,6 @@
ASFLAGS += --32
ifeq ($(HOST_OS),FreeBSD)
LDFLAGS += -m elf_i386_fbsd
-else ifeq ($(HOST_OS),OpenBSD)
-LDFLAGS += -m elf_i386_obsd
else
LDFLAGS += -m elf_i386
endif
@@ -87,9 +85,15 @@
SRCDIRS += arch/i386/interface/pxe
SRCDIRS += arch/i386/interface/pxeparent
SRCDIRS += arch/i386/interface/syslinux
-SRCDIRS += arch/i386/interface/vmware
SRCDIRS += arch/i386/hci/commands
+# The various xxx_loader.c files are #included into core/loader.c and
+# should not be compiled directly.
+#
+NON_AUTO_SRCS += arch/i386/core/aout_loader.c
+NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
+NON_AUTO_SRCS += arch/i386/core/wince_loader.c
+
# Include common x86 Makefile
#
MAKEDEPS += arch/x86/Makefile
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/Makefile.pcbios ipxe-1.0.1~lliurex1505/src/arch/i386/Makefile.pcbios
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/Makefile.pcbios 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/Makefile.pcbios 2012-01-06 23:49:04.000000000 +0000
@@ -29,22 +29,17 @@
# Padding rules
#
-PAD_rom = $(PERL) $(PADIMG) --blksize=512 --byte=0xff
+PAD_rom = $(PERL) $(PADIMG) --blksize=512 --byte=0xff $@
PAD_mrom = $(PAD_rom)
-PAD_dsk = $(PERL) $(PADIMG) --blksize=512
-PAD_hd = $(PERL) $(PADIMG) --blksize=32768
-PAD_exe = $(PERL) $(PADIMG) --blksize=512
+PAD_dsk = $(PERL) $(PADIMG) --blksize=512 $@
+PAD_hd = $(PERL) $(PADIMG) --blksize=32768 $@
+PAD_exe = $(PERL) $(PADIMG) --blksize=512 $@
# Finalisation rules
#
-FINALISE_rom = $(PERL) $(FIXROM)
+FINALISE_rom = $(PERL) $(FIXROM) $@
FINALISE_mrom = $(FINALISE_rom)
-# Use $(ROMS) rather than $(DRIVERS) for "allroms" and "allmroms"
-#
-LIST_NAME_rom := ROMS
-LIST_NAME_mrom := ROMS
-
# rule to make a non-emulation ISO boot image
NON_AUTO_MEDIA += iso
%iso: %lkrn util/geniso
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/exeprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/exeprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/exeprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/exeprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
@@ -114,7 +113,7 @@
call alloc_basemem
xorl %esi, %esi
movl $EXE_DECOMPRESS_ADDRESS, %edi
- orl $0xffffffff, %ebp /* Allow arbitrary relocation */
+ xorl %ebp, %ebp
call install_prealloc
/* Set up real-mode stack */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/libprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/libprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/libprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/libprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
@@ -50,7 +49,7 @@
.section ".prefix.data", "aw", @progbits
progress_\@:
.asciz "\message"
- .size progress_\@, . - progress_\@
+ .size progress_\@, . - progress\@
.previous
.endm
#endif
@@ -545,7 +544,8 @@
* Free space allocated with alloc_basemem.
*
* Parameters:
- * none (.text16 segment address is implicit in %cs)
+ * %ax : .text16 segment address
+ * %bx : .data16 segment address
* Returns:
* %ax : 0 if successfully freed
* Corrupts:
@@ -558,14 +558,14 @@
free_basemem:
/* Preserve registers */
pushw %fs
- pushw %ax
/* Check FBMS counter */
- movw %cs, %ax
+ pushw %ax
shrw $6, %ax
pushw $0x40
popw %fs
cmpw %ax, %fs:0x13
+ popw %ax
jne 1f
/* Check hooked interrupt count */
@@ -573,7 +573,6 @@
jne 1f
/* OK to free memory */
- movw %cs, %ax
addw $_text16_memsz_pgh, %ax
addw $_data16_memsz_pgh, %ax
shrw $6, %ax
@@ -581,7 +580,6 @@
xorw %ax, %ax
1: /* Restore registers and return */
- popw %ax
popw %fs
ret
.size free_basemem, . - free_basemem
@@ -622,7 +620,7 @@
/* Image destination = default */
xorl %edi, %edi
/* Allow arbitrary relocation */
- orl $0xffffffff, %ebp
+ xorl %ebp, %ebp
/* Install text and data segments */
call install_prealloc
/* Restore registers and return */
@@ -642,9 +640,7 @@
* %bx : .data16 segment address
* %esi : Image source physical address (or zero for %cs:0000)
* %edi : Decompression temporary area physical address (or zero for default)
- * %ebp : Maximum end address for relocation
- * - 0xffffffff for no maximum
- * - 0x00000000 to inhibit use of INT 15,e820 and INT 15,e801
+ * %ebp : Maximum end address for relocation (or zero for no maximum)
* Corrupts:
* none
****************************************************************************
@@ -667,22 +663,18 @@
/* Save decompression temporary area physical address */
pushl %edi
- /* Install .text16.early and calculate %ecx as offset to next block */
+ /* Install .text16.early */
progress " .text16.early\n"
pushl %esi
xorl %esi, %esi
movw %cs, %si
shll $4, %esi
- pushl %esi /* Save original %cs:0000 */
addl $_text16_early_lma, %esi
movzwl %ax, %edi
shll $4, %edi
movl $_text16_early_filesz, %ecx
movl $_text16_early_memsz, %edx
call install_block /* .text16.early */
- popl %ecx /* Calculate offset to next block */
- subl %esi, %ecx
- negl %ecx
popl %esi
#ifndef KEEP_IT_REAL
@@ -737,7 +729,7 @@
jnz 1f
movw %cs, %si
shll $4, %esi
-1: addl %ecx, %esi
+1: addl payload_lma, %esi
/* Install .text16.late and .data16 */
progress " .text16.late\n"
@@ -798,13 +790,6 @@
movw %ax, (init_librm_vector+2)
lcall *init_librm_vector
- /* Inhibit INT 15,e820 and INT 15,e801 if applicable */
- testl %ebp, %ebp
- jnz 1f
- incb memmap_post
- decl %ebp
-1:
-
/* Call relocate() to determine target address for relocation.
* relocate() will return with %esi, %edi and %ecx set up
* ready for the copy to the new location.
@@ -865,6 +850,17 @@
.word 0
.size close_payload_vector, . - close_payload_vector
+ /* Payload address */
+ .section ".prefix.lib", "awx", @progbits
+payload_lma:
+ .long 0
+ .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
+ .ascii "ADHL"
+ .long payload_lma
+ .long 1
+ .long 0
+ .previous
+
/* Dummy routines to open and close payload */
.section ".text16.early.data", "aw", @progbits
.weak open_payload
@@ -882,7 +878,8 @@
* Uninstall all text and data segments.
*
* Parameters:
- * none (.text16 segment address is implicit in %cs)
+ * %ax : .text16 segment address
+ * %bx : .data16 segment address
* Returns:
* none
* Corrupts:
@@ -917,10 +914,6 @@
.ascii "PAYL"
.long 0
.long 0
- .long _payload_align
- .ascii "COPY"
- .long _pprefix_lma
- .long _pprefix_filesz
.long _max_align
.ascii PACK_OR_COPY
.long _text16_late_lma
@@ -934,6 +927,3 @@
.long _textdata_lma
.long _textdata_filesz
.long _max_align
-
- .weak _payload_align
- .equ _payload_align, 1
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/lkrnprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/lkrnprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/lkrnprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/lkrnprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -188,55 +188,17 @@
We're now at the beginning of the kernel proper.
*/
run_ipxe:
- /* Set up stack just below 0x7c00 and clear direction flag */
+ /* Set up stack just below 0x7c00 */
xorw %ax, %ax
movw %ax, %ss
movw $0x7c00, %sp
- cld
/* Retrieve command-line pointer */
- movl %ds:cmd_line_ptr, %edx
- testl %edx, %edx
- jz no_cmd_line
-
- /* Set up %es:%di to point to command line */
- movl %edx, %edi
- andl $0xf, %edi
- rorl $4, %edx
- movw %dx, %es
-
- /* Find length of command line */
- pushw %di
- movw $0xffff, %cx
- repnz scasb
- notw %cx
- popw %si
-
- /* Make space for command line on stack */
- movw %sp, %di
- subw %cx, %di
- andw $~0xf, %di
- movw %di, %sp
-
- /* Copy command line to stack */
- pushw %ds
- pushw %es
- popw %ds
- pushw %ss
- popw %es
- rep movsb
- popw %ds
-
- /* Store new command-line pointer */
- movzwl %sp, %edx
-no_cmd_line:
-
- /* Calculate maximum relocation address */
- movl ramdisk_image, %ebp
- testl %ebp, %ebp
- jnz 1f
- orl $0xffffffff, %ebp /* Allow arbitrary relocation if no initrd */
-1:
+ movl %es:cmd_line_ptr, %edx
+
+ /* Retrieve initrd pointer and size */
+ movl %es:ramdisk_image, %ebp
+ movl %es:ramdisk_size, %ecx
/* Install iPXE */
call alloc_basemem
@@ -254,10 +216,6 @@
lret
.section ".text16", "awx", @progbits
1:
- /* Retrieve initrd pointer and size */
- movl ramdisk_image, %ebp
- movl ramdisk_size, %ecx
-
/* Set up %ds for access to .data16 */
movw %bx, %ds
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/mromprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/mromprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/mromprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/mromprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
@@ -31,7 +30,6 @@
#define PCI_BAR_EXPROM 0x30
#define ROMPREFIX_EXCLUDE_PAYLOAD 1
-#define ROMPREFIX_MORE_IMAGES 1
#define _rom_start _mrom_start
#include "romprefix.S"
@@ -48,10 +46,8 @@
* Parameters:
* %ds:0000 : Prefix
* %esi : Buffer for copy of image source (or zero if no buffer available)
- * %ecx : Expected offset within buffer of first payload block
* Returns:
* %esi : Valid image source address (buffered or unbuffered)
- * %ecx : Actual offset within buffer of first payload block
* CF set on error
*/
.section ".text16.early", "awx", @progbits
@@ -60,25 +56,23 @@
/* Preserve registers */
pushl %eax
pushw %bx
+ pushl %ecx
pushl %edx
pushl %edi
pushw %bp
- pushw %es
pushw %ds
- /* Retrieve bus:dev.fn from .prefix */
+ /* Retrieve bus:dev.fn and image source length from .prefix */
movw init_pci_busdevfn, %bx
+ movl image_source_len_dword, %ecx
/* Set up %ds for access to .text16.early */
pushw %cs
popw %ds
- /* Set up %es for access to flat address space */
- xorw %ax, %ax
- movw %ax, %es
-
- /* Store bus:dev.fn to .text16.early */
+ /* Store bus:dev.fn and image source length to .text16.early */
movw %bx, payload_pci_busdevfn
+ movl %ecx, rom_bar_copy_len_dword
/* Get expansion ROM BAR current value */
movw $PCI_BAR_EXPROM, %di
@@ -98,7 +92,6 @@
cmpw $PCI_BAR_5, %di
jle 1f
stc
- movl $0xbabababa, %esi /* Report "No suitable BAR" */
jmp 99f
1: movw $4, %bp
@@ -156,20 +149,6 @@
movw $PCI_BAR_EXPROM, %di
call pci_write_config_dword
- /* Locate our ROM image */
-1: addr32 es cmpw $0xaa55, (%eax)
- je 2f
- stc
- movl %eax, %esi /* Report failure address */
- jmp 99f
-2: addr32 es cmpl $_build_id, build_id(%eax)
- je 3f
- addr32 es movzbl 2(%eax), %ecx
- shll $9, %ecx
- addl %ecx, %eax
- jmp 1b
-3:
-
/* Copy payload to buffer, or set buffer address to BAR address */
testl %esi, %esi
jz 1f
@@ -180,32 +159,27 @@
* properly support flat real mode, it will die horribly.)
*/
pushl %esi
+ pushw %es
movl %esi, %edi
movl %eax, %esi
- addr32 es movzbl 2(%esi), %ecx
- shll $7, %ecx
- addr32 es movzbl 2(%esi,%ecx,4), %edx
- shll $7, %edx
- addl %edx, %ecx
+ movl rom_bar_copy_len_dword, %ecx
+ xorw %ax, %ax
+ movw %ax, %es
addr32 es rep movsl
+ popw %es
popl %esi
jmp 2f
1: /* We have no buffer; set %esi to the BAR address */
movl %eax, %esi
2:
- /* Locate first payload block (after the dummy ROM header) */
- addr32 es movzbl 2(%esi), %ecx
- shll $9, %ecx
- addl $_pprefix_skip, %ecx
-
clc
/* Restore registers and return */
99: popw %ds
- popw %es
popw %bp
popl %edi
popl %edx
+ popl %ecx
popw %bx
popl %eax
lret
@@ -227,6 +201,11 @@
.size rom_bar_size, . - rom_bar_size
.section ".text16.early.data", "aw", @progbits
+rom_bar_copy_len_dword:
+ .long 0
+ .size rom_bar_copy_len_dword, . - rom_bar_copy_len_dword
+
+ .section ".text16.early.data", "aw", @progbits
stolen_bar_register:
.word 0
.size stolen_bar_register, . - stolen_bar_register
@@ -440,68 +419,16 @@
ret
.size pci_set_mem_access, . - pci_set_mem_access
-/* Payload prefix
+/* Image source area length (in dwords)
*
- * We include a dummy ROM header to cover the "hidden" portion of the
- * overall ROM image.
*/
- .globl _payload_align
- .equ _payload_align, 512
- .section ".pprefix", "ax", @progbits
- .org 0x00
-mromheader:
- .word 0xaa55 /* BIOS extension signature */
-mromheader_size: .byte 0 /* Size in 512-byte blocks */
- .org 0x18
- .word mpciheader
- .org 0x1a
- .word 0
- .size mromheader, . - mromheader
-
- .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
- .ascii "APPB"
- .long mromheader_size
- .long 512
+ .section ".prefix", "ax", @progbits
+image_source_len_dword:
.long 0
- .previous
-
-mpciheader:
- .ascii "PCIR" /* Signature */
- .word pci_vendor_id /* Vendor identification */
- .word pci_device_id /* Device identification */
- .word 0x0000 /* Device list pointer */
- .word mpciheader_len /* PCI data structure length */
- .byte 0x03 /* PCI data structure revision */
- .byte 0x02, 0x00, 0x00 /* Class code */
-mpciheader_image_length:
- .word 0 /* Image length */
- .word 0x0001 /* Revision level */
- .byte 0xff /* Code type */
- .byte 0x80 /* Last image indicator */
-mpciheader_runtime_length:
- .word 0 /* Maximum run-time image length */
- .word 0x0000 /* Configuration utility code header */
- .word 0x0000 /* DMTF CLP entry point */
- .equ mpciheader_len, . - mpciheader
- .size mpciheader, . - mpciheader
-
- .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
- .ascii "APPW"
- .long mpciheader_image_length
- .long 512
- .long 0
- .ascii "APPW"
- .long mpciheader_runtime_length
- .long 512
- .long 0
- .previous
-
-/* Fix up additional image source size
- *
- */
+ .size image_source_len_dword, . - image_source_len_dword
.section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
- .ascii "ADPW"
- .long extra_size
- .long 512
+ .ascii "ADDL"
+ .long image_source_len_dword
+ .long 4
.long 0
.previous
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/nbiprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/nbiprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/nbiprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/nbiprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -54,10 +54,6 @@
/* Install iPXE */
call install
- /* Set up real-mode stack */
- movw %bx, %ss
- movw $_estack16, %sp
-
/* Jump to .text16 segment */
pushw %ax
pushw $1f
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/pxeprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/pxeprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/pxeprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/pxeprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -5,9 +5,6 @@
#define PXENV_UNDI_GET_IFACE_INFO 0x0013
#define PXENV_STOP_UNDI 0x0015
#define PXENV_UNLOAD_STACK 0x0070
-#define PXENV_GET_CACHED_INFO 0x0071
-#define PXENV_PACKET_TYPE_DHCP_ACK 0x0002
-#define PXENV_FILE_CMDLINE 0x00e8
#define PXE_HACK_EB54 0x0001
@@ -22,19 +19,6 @@
#define EB_MAGIC_1 ( 'E' + ( 't' << 8 ) + ( 'h' << 16 ) + ( 'e' << 24 ) )
#define EB_MAGIC_2 ( 'r' + ( 'b' << 8 ) + ( 'o' << 16 ) + ( 'o' << 24 ) )
-/* Prefix memory layout:
- *
- * iPXE binary image
- * Temporary stack
- * Temporary copy of DHCPACK packet
- * Temporary copy of command line
- */
-#define PREFIX_STACK_SIZE 2048
-#define PREFIX_TEMP_DHCPACK PREFIX_STACK_SIZE
-#define PREFIX_TEMP_DHCPACK_SIZE ( 1260 /* sizeof ( BOOTPLAYER_t ) */ )
-#define PREFIX_TEMP_CMDLINE ( PREFIX_TEMP_DHCPACK + PREFIX_TEMP_DHCPACK_SIZE )
-#define PREFIX_TEMP_CMDLINE_SIZE 4096
-
/*****************************************************************************
* Entry point: set operating context, print welcome message
*****************************************************************************
@@ -62,11 +46,10 @@
movw %ax, %ds
movw $0x40, %ax /* BIOS data segment access */
movw %ax, %fs
- /* Set up temporary stack immediately after the iPXE image */
- movw %cs, %ax
- addw image_size_pgh, %ax
+ /* Set up stack just below 0x7c00 */
+ xorw %ax, %ax
movw %ax, %ss
- movl $PREFIX_STACK_SIZE, %esp
+ movl $0x7c00, %esp
/* Clear direction flag, for the sake of sanity */
cld
/* Print welcome message */
@@ -77,18 +60,6 @@
10: .asciz "PXE->EB:"
.previous
- /* Image size (for stack placement calculation) */
- .section ".prefix.data", "aw", @progbits
-image_size_pgh:
- .word 0
- .previous
- .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
- .ascii "ADDW"
- .long image_size_pgh
- .long 16
- .long 0
- .previous
-
/*****************************************************************************
* Find us a usable !PXE or PXENV+ entry point
*****************************************************************************
@@ -396,61 +367,6 @@
call print_character
/*****************************************************************************
- * Get cached DHCP_ACK packet
- *****************************************************************************
- */
-get_dhcpack:
- /* Issue PXENV_GET_CACHED_INFO */
- xorl %esi, %esi
- movw %ss, %si
- movw %si, ( pxe_parameter_structure + 0x08 )
- movw $PREFIX_TEMP_DHCPACK, ( pxe_parameter_structure + 0x06 )
- movw $PREFIX_TEMP_DHCPACK_SIZE, ( pxe_parameter_structure +0x04 )
- movw $PXENV_PACKET_TYPE_DHCP_ACK, ( pxe_parameter_structure + 0x02 )
- movw $PXENV_GET_CACHED_INFO, %bx
- call pxe_call
- jnc 1f
- call print_pxe_error
- jmp 99f
-1: /* Store physical address of packet */
- shll $4, %esi
- addl $PREFIX_TEMP_DHCPACK, %esi
- movl %esi, pxe_cached_dhcpack
-99:
- .section ".prefix.data", "aw", @progbits
-pxe_cached_dhcpack:
- .long 0
- .previous
-
-/*****************************************************************************
- * Check for a command line
- *****************************************************************************
- */
-get_cmdline:
- /* Issue PXENV_FILE_CMDLINE */
- xorl %esi, %esi
- movw %ss, %si
- movw %si, ( pxe_parameter_structure + 0x06 )
- movw $PREFIX_TEMP_CMDLINE, ( pxe_parameter_structure + 0x04 )
- movw $PREFIX_TEMP_CMDLINE_SIZE, ( pxe_parameter_structure + 0x02 )
- movw $PXENV_FILE_CMDLINE, %bx
- call pxe_call
- jc 99f /* Suppress errors; this is an iPXE extension API call */
- /* Check for non-NULL command line */
- movw ( pxe_parameter_structure + 0x02 ), %ax
- testw %ax, %ax
- jz 99f
- /* Record command line */
- shll $4, %esi
- addl $PREFIX_TEMP_CMDLINE, %esi
- movl %esi, pxe_cmdline
-99:
- .section ".prefix.data", "aw", @progbits
-pxe_cmdline:
- .long 0
- .previous
-
-/*****************************************************************************
* Leave NIC in a safe state
*****************************************************************************
*/
@@ -797,12 +713,6 @@
movw pxe_ss, %di
movl pxe_esp, %ebp
- /* Retrieve PXE command line, if any */
- movl pxe_cmdline, %esi
-
- /* Retrieve cached DHCPACK, if any */
- movl pxe_cached_dhcpack, %ecx
-
/* Jump to .text16 segment with %ds pointing to .data16 */
movw %bx, %ds
pushw %ax
@@ -813,12 +723,6 @@
/* Update the exit hook */
movw %cs, ( pxe_exit_hook + 2 )
- /* Store command-line pointer */
- movl %esi, cmdline_phys
-
- /* Store cached DHCPACK pointer */
- movl %ecx, cached_dhcpack_phys
-
/* Run main program */
pushl $main
pushw %cs
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/romprefix.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/romprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/romprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/romprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -23,7 +23,6 @@
( PMM_HANDLE_BASE | 0x00001000 )
#define PMM_HANDLE_BASE_DECOMPRESS_TO \
( PMM_HANDLE_BASE | 0x00002000 )
-#define PCI_FUNC_MASK 0x07
/* ROM banner timeout. Based on the configurable BANNER_TIMEOUT in
* config.h, but converted to a number of (18Hz) timer ticks, and
@@ -42,14 +41,6 @@
#define ZINFO_TYPE_ADxW "ADDW"
#endif
-/* Allow ROM to be marked as containing multiple images
- */
-#if ROMPREFIX_MORE_IMAGES
-#define INDICATOR 0x00
-#else
-#define INDICATOR 0x80
-#endif
-
.text
.code16
.arch i386
@@ -64,8 +55,6 @@
jmp init /* Initialisation vector */
checksum:
.byte 0
- .org 0x10
- .word ipxeheader
.org 0x16
.word undiheader
.org 0x18
@@ -81,6 +70,9 @@
.long 0
.previous
+build_id:
+ .long _build_id /* Randomly-generated build ID */
+
pciheader:
.ascii "PCIR" /* Signature */
.word pci_vendor_id /* Vendor identification */
@@ -93,7 +85,7 @@
.word 0 /* Image length */
.word 0x0001 /* Revision level */
.byte 0x00 /* Code type */
- .byte INDICATOR /* Last image indicator */
+ .byte 0x80 /* Last image indicator */
pciheader_runtime_length:
.word 0 /* Maximum run-time image length */
.word 0x0000 /* Configuration utility code header */
@@ -175,25 +167,6 @@
.equ undiheader_len, . - undiheader
.size undiheader, . - undiheader
-ipxeheader:
- .ascii "iPXE" /* Signature */
- .byte ipxeheader_len /* Length of structure */
- .byte 0 /* Checksum */
-shrunk_rom_size:
- .byte 0 /* Shrunk size (in 512-byte blocks) */
- .byte 0 /* Reserved */
-build_id:
- .long _build_id /* Randomly-generated build ID */
- .equ ipxeheader_len, . - ipxeheader
- .size ipxeheader, . - ipxeheader
-
- .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
- .ascii "ADHB"
- .long shrunk_rom_size
- .long 512
- .long 0
- .previous
-
/* Initialisation (called once during POST)
*
* Determine whether or not this is a PnP system via a signature
@@ -353,19 +326,14 @@
call print_message
/* We have PMM and so a 1kB stack: preserve whole registers */
pushal
- /* Allocate image source PMM block. Round up the size to the
- * nearest 4kB (8 512-byte sectors) to work around AMI BIOS bugs.
- */
- movzbl romheader_size, %ecx
- addw extra_size, %cx
- addw $0x0007, %cx /* Round up to multiple of 8 512-byte sectors */
- andw $0xfff8, %cx
+ /* Allocate image source PMM block */
+ movzwl image_source_size, %ecx
shll $5, %ecx
movl $PMM_HANDLE_BASE_IMAGE_SOURCE, %ebx
movw $get_pmm_image_source, %bp
call get_pmm
movl %esi, image_source
- jz 1f
+ jc 1f
/* Copy ROM to image source PMM block */
pushw %es
xorw %ax, %ax
@@ -373,8 +341,8 @@
movl %esi, %edi
xorl %esi, %esi
movzbl romheader_size, %ecx
- shll $7, %ecx
- addr32 rep movsl /* PMM presence implies flat real mode */
+ shll $9, %ecx
+ addr32 rep movsb /* PMM presence implies flat real mode */
popw %es
/* Shrink ROM */
movb shrunk_rom_size, %al
@@ -423,9 +391,6 @@
xorw %di, %di
cs rep movsb
- /* Skip prompt if this is not the first PCI function */
- testb $PCI_FUNC_MASK, init_pci_busdevfn
- jnz no_shell
/* Prompt for POST-time shell */
movw $init_message_prompt, %si
xorw %di, %di
@@ -444,19 +409,15 @@
movw $init_message_done, %si
call print_message
popf
- jnz no_shell
+ jnz 2f
/* Ctrl-B was pressed: invoke iPXE. The keypress will be
* picked up by the initial shell prompt, and we will drop
* into a shell.
*/
- xorl %ebp, %ebp /* Inhibit use of INT 15,e820 and INT 15,e801 */
+ movl $0xa0000, %ebp /* Inhibit relocation during POST */
pushw %cs
call exec
-no_shell:
- movb $( '\n' ), %al
- xorw %di, %di
- call print_character
-
+2:
/* Restore registers */
popw %gs
popw %fs
@@ -478,7 +439,7 @@
* %es:0000 : PMM structure
* Returns:
* %ebx : PMM handle
- * %esi : allocated block address, or zero (with ZF set) if allocation failed
+ * %esi : allocated block address, or zero (with CF set) if allocation failed
*/
get_pmm:
/* Preserve registers */
@@ -494,10 +455,7 @@
pushw %dx
pushw %ax
popl %esi
- /* Treat 0xffffffff (not supported) as 0x00000000 (not found) */
- incl %esi
- jz get_pmm_allocate
- decl %esi
+ testl %esi, %esi
jz get_pmm_allocate
/* Block found - check acceptability */
call *%bp
@@ -517,20 +475,19 @@
pushw %ax
popl %esi
movw $( '+' ), %di /* Indicate allocation attempt */
+ testl %esi, %esi
+ jnz get_pmm_done
+ stc
get_pmm_done:
/* Print block address */
+ pushfw
movw %di, %ax
xorw %di, %di
call print_character
movl %esi, %eax
call print_hex_dword
- /* Treat 0xffffffff (not supported) as 0x00000000 (allocation
- * failed), and set ZF to indicate a zero result.
- */
- incl %esi
- jz 1f
- decl %esi
-1: /* Restore registers and return */
+ popfw
+ /* Restore registers and return */
popw %di
popl %eax
ret
@@ -603,7 +560,7 @@
*
*/
init_pci_busdevfn:
- .word 0
+ .word 0xffff
.size init_pci_busdevfn, . - init_pci_busdevfn
/* Image source area
@@ -616,12 +573,31 @@
.long 0
.size image_source, . - image_source
-/* Additional image source size (in 512-byte sectors)
+/* Image source size (in 512-byte sectors)
*
*/
-extra_size:
+image_source_size:
.word 0
- .size extra_size, . - extra_size
+ .size image_source_size, . - image_source_size
+ .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
+ .ascii "ADDW"
+ .long image_source_size
+ .long 512
+ .long 0
+ .previous
+
+/* Shrunk ROM size (in 512-byte sectors)
+ *
+ */
+shrunk_rom_size:
+ .byte 0
+ .size shrunk_rom_size, . - shrunk_rom_size
+ .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
+ .ascii "ADHB"
+ .long shrunk_rom_size
+ .long 512
+ .long 0
+ .previous
/* Temporary decompression area
*
@@ -638,7 +614,7 @@
* Called by the PnP BIOS when it wants to boot us.
*/
bev_entry:
- orl $0xffffffff, %ebp /* Allow arbitrary relocation */
+ xorl %ebp, %ebp /* Allow relocation */
pushw %cs
call exec
lret
@@ -673,7 +649,7 @@
/* Leave keypress in buffer and start iPXE. The keypress will
* cause the usual initial Ctrl-B prompt to be skipped.
*/
- orl $0xffffffff, %ebp /* Allow arbitrary relocation */
+ xorl %ebp, %ebp /* Allow relocation */
pushw %cs
call exec
1: /* Try to call original INT 19 vector */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/undiloader.S ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/undiloader.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/prefix/undiloader.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/prefix/undiloader.S 2012-01-06 23:49:04.000000000 +0000
@@ -23,15 +23,15 @@
popw %ds
/* UNDI loader parameter structure address into %es:%di */
movw %sp, %bx
- movw %ss:22(%bx), %di
- movw %ss:24(%bx), %es
+ movw %ss:18(%bx), %di
+ movw %ss:20(%bx), %es
/* Install to specified real-mode addresses */
pushw %di
movw %es:12(%di), %bx
movw %es:14(%di), %ax
movl image_source, %esi
movl decompress_to, %edi
- orl $0xffffffff, %ebp /* Allow arbitrary relocation */
+ xorl %ebp, %ebp /* Allow relocation */
call install_prealloc
popw %di
/* Call UNDI loader C code */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/scripts/i386-kir.lds ipxe-1.0.1~lliurex1505/src/arch/i386/scripts/i386-kir.lds
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/scripts/i386-kir.lds 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/scripts/i386-kir.lds 2012-01-06 23:49:04.000000000 +0000
@@ -98,8 +98,6 @@
*(.data)
*(.data.*)
KEEP(*(SORT(.tbl.*))) /* Various tables. See include/tables.h */
- KEEP(*(.provided))
- KEEP(*(.provided.*))
_edata16_progbits = .;
}
.bss16 : AT ( _data16_load_offset + __bss16 ) {
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/scripts/i386.lds ipxe-1.0.1~lliurex1505/src/arch/i386/scripts/i386.lds
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/scripts/i386.lds 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/scripts/i386.lds 2012-01-06 23:49:04.000000000 +0000
@@ -1,4 +1,4 @@
-/* -*- ld-script -*- */
+/* -*- sh -*- */
/*
* Linker script for i386 images
@@ -109,8 +109,6 @@
*(.data)
*(.data.*)
KEEP(*(SORT(.tbl.*))) /* Various tables. See include/tables.h */
- KEEP(*(.provided))
- KEEP(*(.provided.*))
_mtextdata = .;
} .bss.textdata (NOLOAD) : AT ( _end_lma ) {
*(.bss)
@@ -124,23 +122,6 @@
_textdata_memsz = ABSOLUTE ( _etextdata ) - ABSOLUTE ( _textdata );
/*
- * Payload prefix
- *
- * If present, this will be placed between .text16.early and .text16.late.
- *
- */
- .pprefix 0x0 : AT ( _pprefix_lma ) {
- _pprefix = .;
- KEEP(*(.pprefix))
- KEEP(*(.pprefix.*))
- _mpprefix = .;
- } .bss.pprefix (NOLOAD) : AT ( _end_lma ) {
- _epprefix = .;
- }
- _pprefix_filesz = ABSOLUTE ( _mpprefix ) - ABSOLUTE ( _pprefix );
- _pprefix_memsz = ABSOLUTE ( _epprefix ) - ABSOLUTE ( _pprefix );
-
- /*
* Compressor information block
*
*/
@@ -207,13 +188,7 @@
. += _text16_early_filesz;
. = ALIGN ( _max_align );
- . = ALIGN ( _payload_align );
- _pprefix_lma = .;
- . += _pprefix_filesz;
-
- . = ALIGN ( _max_align );
_payload_lma = .;
- _pprefix_skip = ABSOLUTE ( _payload_lma ) - ABSOLUTE ( _pprefix_lma );
_text16_late_lma = .;
. += _text16_late_filesz;
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/scripts/linux.lds ipxe-1.0.1~lliurex1505/src/arch/i386/scripts/linux.lds
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/scripts/linux.lds 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/scripts/linux.lds 2012-01-06 23:49:04.000000000 +0000
@@ -53,8 +53,6 @@
*(.data)
*(.data.*)
KEEP(*(SORT(.tbl.*)))
- KEEP(*(.provided))
- KEEP(*(.provided.*))
_edata = .;
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/transitions/liba20.S ipxe-1.0.1~lliurex1505/src/arch/i386/transitions/liba20.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/i386/transitions/liba20.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/i386/transitions/liba20.S 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/cpuid.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/cpuid.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/cpuid.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/cpuid.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-
-/** @file
- *
- * x86 CPU feature detection
- *
- */
-
-/**
- * Check whether or not CPUID instruction is supported
- *
- * @ret is_supported CPUID instruction is supported
- */
-int cpuid_is_supported ( void ) {
- unsigned long original;
- unsigned long inverted;
-
- __asm__ ( "pushf\n\t"
- "pushf\n\t"
- "pop %0\n\t"
- "mov %0,%1\n\t"
- "xor %2,%1\n\t"
- "push %1\n\t"
- "popf\n\t"
- "pushf\n\t"
- "pop %1\n\t"
- "popf\n\t"
- : "=&r" ( original ), "=&r" ( inverted )
- : "ir" ( CPUID_FLAG ) );
- return ( ( original ^ inverted ) & CPUID_FLAG );
-}
-
-/**
- * Get Intel-defined x86 CPU features
- *
- * @v features x86 CPU features to fill in
- */
-static void x86_intel_features ( struct x86_features *features ) {
- uint32_t max_level;
- uint32_t discard_a;
- uint32_t discard_b;
- uint32_t discard_c;
- uint32_t discard_d;
-
- /* Check that features are available via CPUID */
- cpuid ( CPUID_VENDOR_ID, &max_level, &discard_b, &discard_c,
- &discard_d );
- if ( max_level < CPUID_FEATURES ) {
- DBGC ( features, "CPUID has no Intel-defined features (max "
- "level %08x)\n", max_level );
- return;
- }
-
- /* Get features */
- cpuid ( CPUID_FEATURES, &discard_a, &discard_b,
- &features->intel.ecx, &features->intel.edx );
- DBGC ( features, "CPUID Intel features: %%ecx=%08x, %%edx=%08x\n",
- features->intel.ecx, features->intel.edx );
-
-}
-
-/**
- * Get AMD-defined x86 CPU features
- *
- * @v features x86 CPU features to fill in
- */
-static void x86_amd_features ( struct x86_features *features ) {
- uint32_t max_level;
- uint32_t discard_a;
- uint32_t discard_b;
- uint32_t discard_c;
- uint32_t discard_d;
-
- /* Check that features are available via CPUID */
- cpuid ( CPUID_AMD_MAX_FN, &max_level, &discard_b, &discard_c,
- &discard_d );
- if ( ( max_level & CPUID_AMD_CHECK_MASK ) != CPUID_AMD_CHECK ) {
- DBGC ( features, "CPUID has no extended functions\n" );
- return;
- }
- if ( max_level < CPUID_AMD_FEATURES ) {
- DBGC ( features, "CPUID has no AMD-defined features (max "
- "level %08x)\n", max_level );
- return;
- }
-
- /* Get features */
- cpuid ( CPUID_AMD_FEATURES, &discard_a, &discard_b,
- &features->amd.ecx, &features->amd.edx );
- DBGC ( features, "CPUID AMD features: %%ecx=%08x, %%edx=%08x\n",
- features->amd.ecx, features->amd.edx );
-}
-
-/**
- * Get x86 CPU features
- *
- * @v features x86 CPU features to fill in
- */
-void x86_features ( struct x86_features *features ) {
-
- /* Clear all features */
- memset ( features, 0, sizeof ( *features ) );
-
- /* Check that CPUID instruction is available */
- if ( ! cpuid_is_supported() ) {
- DBGC ( features, "CPUID instruction is not supported\n" );
- return;
- }
-
- /* Get Intel-defined features */
- x86_intel_features ( features );
-
- /* Get AMD-defined features */
- x86_amd_features ( features );
-}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/cpuid_settings.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/cpuid_settings.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/cpuid_settings.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/cpuid_settings.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,272 +0,0 @@
-/*
- * Copyright (C) 2013 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** @file
- *
- * x86 CPUID settings
- *
- * CPUID settings are numerically encoded as:
- *
- * Bit 31 Extended function
- * Bits 30-28 Unused
- * Bits 27-24 Number of consecutive functions to call, minus one
- * Bit 23 Return result as little-endian (used for strings)
- * Bits 22-18 Unused
- * Bits 17-16 Number of registers in register array, minus one
- * Bits 15-8 Array of register indices. First entry in array is in
- * bits 9-8. Indices are 0-%eax, 1-%ebx, 2-%ecx, 3-%edx.
- * Bits 7-0 Starting function number (excluding "extended" bit)
- *
- * This encoding scheme is designed to allow the common case of
- * extracting a single register from a single function to be encoded
- * using "cpuid/.", e.g. "cpuid/2.0x80000001" to
- * retrieve the value of %ecx from calling CPUID with %eax=0x80000001.
- */
-
-/** CPUID setting tag register indices */
-enum cpuid_registers {
- CPUID_EAX = 0,
- CPUID_EBX = 1,
- CPUID_ECX = 2,
- CPUID_EDX = 3,
-};
-
-/**
- * Construct CPUID setting tag
- *
- * @v function Starting function number
- * @v num_functions Number of consecutive functions
- * @v little_endian Return result as little-endian
- * @v num_registers Number of registers in register array
- * @v register1 First register in register array (or zero, if empty)
- * @v register2 Second register in register array (or zero, if empty)
- * @v register3 Third register in register array (or zero, if empty)
- * @v register4 Fourth register in register array (or zero, if empty)
- * @ret tag Setting tag
- */
-#define CPUID_TAG( function, num_functions, little_endian, num_registers, \
- register1, register2, register3, register4 ) \
- ( (function) | ( ( (num_functions) - 1 ) << 24 ) | \
- ( (little_endian) << 23 ) | ( ( (num_registers) - 1) << 16 ) | \
- ( (register1) << 8 ) | ( (register2) << 10 ) | \
- ( (register3) << 12 ) | ( (register4) << 14 ) )
-
-/**
- * Extract endianness from CPUID setting tag
- *
- * @v tag Setting tag
- * @ret little_endian Result should be returned as little-endian
- */
-#define CPUID_LITTLE_ENDIAN( tag ) ( (tag) & 0x00800000UL )
-
-/**
- * Extract starting function number from CPUID setting tag
- *
- * @v tag Setting tag
- * @ret function Starting function number
- */
-#define CPUID_FUNCTION( tag ) ( (tag) & 0x800000ffUL )
-
-/**
- * Extract number of consecutive functions from CPUID setting tag
- *
- * @v tag Setting tag
- * @ret num_functions Number of consecutive functions
- */
-#define CPUID_NUM_FUNCTIONS( tag ) ( ( ( (tag) >> 24 ) & 0xf ) + 1 )
-
-/**
- * Extract register array from CPUID setting tag
- *
- * @v tag Setting tag
- * @ret registers Register array
- */
-#define CPUID_REGISTERS( tag ) ( ( (tag) >> 8 ) & 0xff )
-
-/**
- * Extract number of registers from CPUID setting tag
- *
- * @v tag Setting tag
- * @ret num_registers Number of registers within register array
- */
-#define CPUID_NUM_REGISTERS( tag ) ( ( ( (tag) >> 16 ) & 0x3 ) + 1 )
-
-/** CPUID settings scope */
-static struct settings_scope cpuid_settings_scope;
-
-/**
- * Check applicability of CPUID setting
- *
- * @v settings Settings block
- * @v setting Setting
- * @ret applies Setting applies within this settings block
- */
-static int cpuid_settings_applies ( struct settings *settings __unused,
- struct setting *setting ) {
-
- return ( setting->scope == &cpuid_settings_scope );
-}
-
-/**
- * Fetch value of CPUID setting
- *
- * @v settings Settings block
- * @v setting Setting to fetch
- * @v data Buffer to fill with setting data
- * @v len Length of buffer
- * @ret len Length of setting data, or negative error
- */
-static int cpuid_settings_fetch ( struct settings *settings,
- struct setting *setting,
- void *data, size_t len ) {
- uint32_t function;
- uint32_t max_function;
- uint32_t num_functions;
- uint32_t registers;
- uint32_t num_registers;
- uint32_t buf[4];
- uint32_t output;
- uint32_t discard_b;
- uint32_t discard_c;
- uint32_t discard_d;
- size_t frag_len;
- size_t result_len = 0;
-
- /* Fail unless CPUID is supported */
- if ( ! cpuid_is_supported() ) {
- DBGC ( settings, "CPUID not supported\n" );
- return -ENOTSUP;
- }
-
- /* Find highest supported function number within this set */
- function = CPUID_FUNCTION ( setting->tag );
- cpuid ( function & CPUID_EXTENDED, &max_function, &discard_b,
- &discard_c, &discard_d );
-
- /* Fail if maximum function number is meaningless (e.g. if we
- * are attempting to call an extended function on a CPU which
- * does not support them).
- */
- if ( ( max_function & CPUID_AMD_CHECK_MASK ) !=
- ( function & CPUID_AMD_CHECK_MASK ) ) {
- DBGC ( settings, "CPUID invalid maximum function\n" );
- return -ENOTSUP;
- }
-
- /* Call each function in turn */
- num_functions = CPUID_NUM_FUNCTIONS ( setting->tag );
- for ( ; num_functions-- ; function++ ) {
-
- /* Fail if this function is not supported */
- if ( function > max_function ) {
- DBGC ( settings, "CPUID function %#08x not supported\n",
- function );
- return -ENOTSUP;
- }
-
- /* Issue CPUID */
- cpuid ( function, &buf[CPUID_EAX], &buf[CPUID_EBX],
- &buf[CPUID_ECX], &buf[CPUID_EDX] );
- DBGC ( settings, "CPUID %#08x => %#08x:%#08x:%#08x:%#08x\n",
- function, buf[0], buf[1], buf[2], buf[3] );
-
- /* Copy results to buffer */
- registers = CPUID_REGISTERS ( setting->tag );
- num_registers = CPUID_NUM_REGISTERS ( setting->tag );
- for ( ; num_registers-- ; registers >>= 2 ) {
- output = buf[ registers & 0x3 ];
- if ( ! CPUID_LITTLE_ENDIAN ( setting->tag ) )
- output = cpu_to_be32 ( output );
- frag_len = sizeof ( output );
- if ( frag_len > len )
- frag_len = len;
- memcpy ( data, &output, frag_len );
- data += frag_len;
- len -= frag_len;
- result_len += sizeof ( output );
- }
- }
-
- /* Set type if not already specified */
- if ( ! setting->type )
- setting->type = &setting_type_hexraw;
-
- return result_len;
-}
-
-/** CPUID settings operations */
-static struct settings_operations cpuid_settings_operations = {
- .applies = cpuid_settings_applies,
- .fetch = cpuid_settings_fetch,
-};
-
-/** CPUID settings */
-static struct settings cpuid_settings = {
- .refcnt = NULL,
- .siblings = LIST_HEAD_INIT ( cpuid_settings.siblings ),
- .children = LIST_HEAD_INIT ( cpuid_settings.children ),
- .op = &cpuid_settings_operations,
- .default_scope = &cpuid_settings_scope,
-};
-
-/** Initialise CPUID settings */
-static void cpuid_settings_init ( void ) {
- int rc;
-
- if ( ( rc = register_settings ( &cpuid_settings, NULL,
- "cpuid" ) ) != 0 ) {
- DBG ( "CPUID could not register settings: %s\n",
- strerror ( rc ) );
- return;
- }
-}
-
-/** CPUID settings initialiser */
-struct init_fn cpuid_settings_init_fn __init_fn ( INIT_NORMAL ) = {
- .initialise = cpuid_settings_init,
-};
-
-/** CPUID predefined settings */
-struct setting cpuid_predefined_settings[] __setting ( SETTING_HOST_EXTRA ) = {
- {
- .name = "cpuvendor",
- .description = "CPU vendor",
- .tag = CPUID_TAG ( CPUID_VENDOR_ID, 1, 1, 3,
- CPUID_EBX, CPUID_EDX, CPUID_ECX, 0 ),
- .type = &setting_type_string,
- .scope = &cpuid_settings_scope,
- },
- {
- .name = "cpumodel",
- .description = "CPU model",
- .tag = CPUID_TAG ( CPUID_MODEL, 3, 1, 4,
- CPUID_EAX, CPUID_EBX, CPUID_ECX, CPUID_EDX ),
- .type = &setting_type_string,
- .scope = &cpuid_settings_scope,
- },
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/debugcon.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/debugcon.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/debugcon.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/debugcon.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * Debug port console
- *
- * The debug port is supported by bochs (via the "port_e9_hack"
- * configuration file directive) and by qemu (via the "-debugcon"
- * command-line option).
- */
-
-#include
-#include
-#include
-#include
-#include
-
-/** Debug port */
-#define DEBUG_PORT 0xe9
-
-/** Debug port installation check magic value */
-#define DEBUG_PORT_CHECK 0xe9
-
-/* Set default console usage if applicable */
-#if ! ( defined ( CONSOLE_DEBUGCON ) && CONSOLE_EXPLICIT ( CONSOLE_DEBUGCON ) )
-#undef CONSOLE_DEBUGCON
-#define CONSOLE_DEBUGCON ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )
-#endif
-
-/**
- * Print a character to debug port console
- *
- * @v character Character to be printed
- */
-static void debugcon_putchar ( int character ) {
-
- /* Write character to debug port */
- outb ( character, DEBUG_PORT );
-}
-
-/** Debug port console driver */
-struct console_driver debugcon_console __console_driver = {
- .putchar = debugcon_putchar,
- .usage = CONSOLE_DEBUGCON,
-};
-
-/**
- * Initialise debug port console
- *
- */
-static void debugcon_init ( void ) {
- uint8_t check;
-
- /* Check if console is present */
- check = inb ( DEBUG_PORT );
- if ( check != DEBUG_PORT_CHECK ) {
- DBG ( "Debug port not present; disabling console\n" );
- debugcon_console.disabled = 1;
- }
-}
-
-/**
- * Debug port console initialisation function
- */
-struct init_fn debugcon_init_fn __init_fn ( INIT_EARLY ) = {
- .initialise = debugcon_init,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/linux/linux_api.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/linux/linux_api.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/linux/linux_api.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/linux/linux_api.c 2012-01-06 23:49:04.000000000 +0000
@@ -37,10 +37,6 @@
return linux_syscall ( __NR_close, fd );
}
-off_t linux_lseek ( int fd, off_t offset, int whence ) {
- return linux_syscall ( __NR_lseek, fd, offset, whence );
-}
-
__kernel_ssize_t linux_read ( int fd, void *buf, __kernel_size_t count ) {
return linux_syscall ( __NR_read, fd, buf, count );
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/pcidirect.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/pcidirect.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/pcidirect.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/pcidirect.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_bigint.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_bigint.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_bigint.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_bigint.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-#include
-
-/** @file
- *
- * Big integer support
- */
-
-/**
- * Multiply big integers
- *
- * @v multiplicand0 Element 0 of big integer to be multiplied
- * @v multiplier0 Element 0 of big integer to be multiplied
- * @v result0 Element 0 of big integer to hold result
- * @v size Number of elements
- */
-void bigint_multiply_raw ( const uint32_t *multiplicand0,
- const uint32_t *multiplier0,
- uint32_t *result0, unsigned int size ) {
- const bigint_t ( size ) __attribute__ (( may_alias )) *multiplicand =
- ( ( const void * ) multiplicand0 );
- const bigint_t ( size ) __attribute__ (( may_alias )) *multiplier =
- ( ( const void * ) multiplier0 );
- bigint_t ( size * 2 ) __attribute__ (( may_alias )) *result =
- ( ( void * ) result0 );
- unsigned int i;
- unsigned int j;
- uint32_t multiplicand_element;
- uint32_t multiplier_element;
- uint32_t *result_elements;
- uint32_t discard_a;
- uint32_t discard_d;
- long index;
-
- /* Zero result */
- memset ( result, 0, sizeof ( *result ) );
-
- /* Multiply integers one element at a time */
- for ( i = 0 ; i < size ; i++ ) {
- multiplicand_element = multiplicand->element[i];
- for ( j = 0 ; j < size ; j++ ) {
- multiplier_element = multiplier->element[j];
- result_elements = &result->element[ i + j ];
- /* Perform a single multiply, and add the
- * resulting double-element into the result,
- * carrying as necessary. The carry can
- * never overflow beyond the end of the
- * result, since:
- *
- * a < 2^{n}, b < 2^{n} => ab < 2^{2n}
- */
- __asm__ __volatile__ ( "mull %4\n\t"
- "addl %%eax, (%5,%2,4)\n\t"
- "adcl %%edx, 4(%5,%2,4)\n\t"
- "\n1:\n\t"
- "adcl $0, 8(%5,%2,4)\n\t"
- "inc %2\n\t"
- /* Does not affect CF */
- "jc 1b\n\t"
- : "=&a" ( discard_a ),
- "=&d" ( discard_d ),
- "=&r" ( index )
- : "0" ( multiplicand_element ),
- "g" ( multiplier_element ),
- "r" ( result_elements ),
- "2" ( 0 ) );
- }
- }
-}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_io.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_io.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_io.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_io.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2008 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-
-/** @file
- *
- * iPXE I/O API for x86
- *
- */
-
-/**
- * Read 64-bit qword from memory-mapped device
- *
- * @v io_addr I/O address
- * @ret data Value read
- *
- * This routine uses MMX instructions.
- */
-static __unused uint64_t i386_readq ( volatile uint64_t *io_addr ) {
- uint64_t data;
- __asm__ __volatile__ ( "pushl %%edx\n\t"
- "pushl %%eax\n\t"
- "movq (%1), %%mm0\n\t"
- "movq %%mm0, (%%esp)\n\t"
- "popl %%eax\n\t"
- "popl %%edx\n\t"
- "emms\n\t"
- : "=A" ( data ) : "r" ( io_addr ) );
- return data;
-}
-
-/**
- * Write 64-bit qword to memory-mapped device
- *
- * @v data Value to write
- * @v io_addr I/O address
- *
- * This routine uses MMX instructions.
- */
-static __unused void i386_writeq ( uint64_t data, volatile uint64_t *io_addr ) {
- __asm__ __volatile__ ( "pushl %%edx\n\t"
- "pushl %%eax\n\t"
- "movq (%%esp), %%mm0\n\t"
- "movq %%mm0, (%1)\n\t"
- "popl %%eax\n\t"
- "popl %%edx\n\t"
- "emms\n\t"
- : : "A" ( data ), "r" ( io_addr ) );
-}
-
-PROVIDE_IOAPI_INLINE ( x86, phys_to_bus );
-PROVIDE_IOAPI_INLINE ( x86, bus_to_phys );
-PROVIDE_IOAPI_INLINE ( x86, ioremap );
-PROVIDE_IOAPI_INLINE ( x86, iounmap );
-PROVIDE_IOAPI_INLINE ( x86, io_to_bus );
-PROVIDE_IOAPI_INLINE ( x86, readb );
-PROVIDE_IOAPI_INLINE ( x86, readw );
-PROVIDE_IOAPI_INLINE ( x86, readl );
-PROVIDE_IOAPI_INLINE ( x86, writeb );
-PROVIDE_IOAPI_INLINE ( x86, writew );
-PROVIDE_IOAPI_INLINE ( x86, writel );
-PROVIDE_IOAPI_INLINE ( x86, inb );
-PROVIDE_IOAPI_INLINE ( x86, inw );
-PROVIDE_IOAPI_INLINE ( x86, inl );
-PROVIDE_IOAPI_INLINE ( x86, outb );
-PROVIDE_IOAPI_INLINE ( x86, outw );
-PROVIDE_IOAPI_INLINE ( x86, outl );
-PROVIDE_IOAPI_INLINE ( x86, insb );
-PROVIDE_IOAPI_INLINE ( x86, insw );
-PROVIDE_IOAPI_INLINE ( x86, insl );
-PROVIDE_IOAPI_INLINE ( x86, outsb );
-PROVIDE_IOAPI_INLINE ( x86, outsw );
-PROVIDE_IOAPI_INLINE ( x86, outsl );
-PROVIDE_IOAPI_INLINE ( x86, iodelay );
-PROVIDE_IOAPI_INLINE ( x86, mb );
-#ifdef __x86_64__
-PROVIDE_IOAPI_INLINE ( x86, readq );
-PROVIDE_IOAPI_INLINE ( x86, writeq );
-#else
-PROVIDE_IOAPI ( x86, readq, i386_readq );
-PROVIDE_IOAPI ( x86, writeq, i386_writeq );
-#endif
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_string.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_string.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_string.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_string.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file
@@ -35,8 +34,7 @@
* @v len Length
* @ret dest Destination address
*/
-void * __attribute__ (( noinline )) __memcpy ( void *dest, const void *src,
- size_t len ) {
+void * __memcpy ( void *dest, const void *src, size_t len ) {
void *edi = dest;
const void *esi = src;
int discard_ecx;
@@ -45,146 +43,21 @@
* moves. Using movsl rather than movsb speeds these up by
* around 32%.
*/
- __asm__ __volatile__ ( "rep movsl"
- : "=&D" ( edi ), "=&S" ( esi ),
- "=&c" ( discard_ecx )
- : "0" ( edi ), "1" ( esi ), "2" ( len >> 2 )
- : "memory" );
- __asm__ __volatile__ ( "rep movsb"
- : "=&D" ( edi ), "=&S" ( esi ),
- "=&c" ( discard_ecx )
- : "0" ( edi ), "1" ( esi ), "2" ( len & 3 )
- : "memory" );
- return dest;
-}
-
-/**
- * Copy memory area backwards
- *
- * @v dest Destination address
- * @v src Source address
- * @v len Length
- * @ret dest Destination address
- */
-void * __attribute__ (( noinline )) __memcpy_reverse ( void *dest,
- const void *src,
- size_t len ) {
- void *edi = ( dest + len - 1 );
- const void *esi = ( src + len - 1 );
- int discard_ecx;
-
- /* Assume memmove() is not performance-critical, and perform a
- * bytewise copy for simplicity.
- */
- __asm__ __volatile__ ( "std\n\t"
- "rep movsb\n\t"
- "cld\n\t"
- : "=&D" ( edi ), "=&S" ( esi ),
- "=&c" ( discard_ecx )
- : "0" ( edi ), "1" ( esi ),
- "2" ( len )
- : "memory" );
- return dest;
-}
-
-
-/**
- * Copy (possibly overlapping) memory area
- *
- * @v dest Destination address
- * @v src Source address
- * @v len Length
- * @ret dest Destination address
- */
-void * __memmove ( void *dest, const void *src, size_t len ) {
-
- if ( dest <= src ) {
- return __memcpy ( dest, src, len );
- } else {
- return __memcpy_reverse ( dest, src, len );
+ if ( len >> 2 ) {
+ __asm__ __volatile__ ( "rep movsl"
+ : "=&D" ( edi ), "=&S" ( esi ),
+ "=&c" ( discard_ecx )
+ : "0" ( edi ), "1" ( esi ),
+ "2" ( len >> 2 )
+ : "memory" );
+ }
+ if ( len & 0x02 ) {
+ __asm__ __volatile__ ( "movsw" : "=&D" ( edi ), "=&S" ( esi )
+ : "0" ( edi ), "1" ( esi ) : "memory" );
+ }
+ if ( len & 0x01 ) {
+ __asm__ __volatile__ ( "movsb" : "=&D" ( edi ), "=&S" ( esi )
+ : "0" ( edi ), "1" ( esi ) : "memory" );
}
-}
-
-/**
- * Swap memory areas
- *
- * @v dest Destination address
- * @v src Source address
- * @v len Length
- * @ret dest Destination address
- */
-void * memswap ( void *dest, void *src, size_t len ) {
- size_t discard_c;
- int discard;
-
- __asm__ __volatile__ ( "\n1:\n\t"
- "dec %2\n\t"
- "js 2f\n\t"
- "movb (%0,%2), %b3\n\t"
- "xchgb (%1,%2), %b3\n\t"
- "movb %b3, (%0,%2)\n\t"
- "jmp 1b\n\t"
- "2:\n\t"
- : "=r" ( src ), "=r" ( dest ),
- "=&c" ( discard_c ), "=&q" ( discard )
- : "0" ( src ), "1" ( dest ), "2" ( len )
- : "memory" );
-
return dest;
}
-
-/**
- * Calculate length of string
- *
- * @v string String
- * @ret len Length (excluding NUL)
- */
-size_t strlen ( const char *string ) {
- const char *discard_D;
- size_t len_plus_one;
-
- __asm__ __volatile__ ( "repne scasb\n\t"
- "not %1\n\t"
- : "=&D" ( discard_D ), "=&c" ( len_plus_one )
- : "0" ( string ), "1" ( -1UL ), "a" ( 0 ) );
-
- return ( len_plus_one - 1 );
-}
-
-/**
- * Compare strings (up to a specified length)
- *
- * @v str1 First string
- * @v str2 Second string
- * @v len Maximum length
- * @ret diff Difference
- */
-int strncmp ( const char *str1, const char *str2, size_t len ) {
- const void *discard_S;
- const void *discard_D;
- size_t discard_c;
- int diff;
-
- __asm__ __volatile__ ( "\n1:\n\t"
- "dec %2\n\t"
- "js 2f\n\t"
- "lodsb\n\t"
- "scasb\n\t"
- "jne 3f\n\t"
- "testb %b3, %b3\n\t"
- "jnz 1b\n\t"
- /* Equal */
- "\n2:\n\t"
- "xor %3, %3\n\t"
- "jmp 4f\n\t"
- /* Not equal; CF indicates difference */
- "\n3:\n\t"
- "sbb %3, %3\n\t"
- "orb $1, %b3\n\t"
- "\n4:\n\t"
- : "=&S" ( discard_S ), "=&D" ( discard_D ),
- "=&c" ( discard_c ), "=&a" ( diff )
- : "0" ( str1 ), "1" ( str2 ), "2" ( len ) );
-
- return diff;
-}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_tcpip.c ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_tcpip.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/core/x86_tcpip.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/core/x86_tcpip.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * TCP/IP checksum
- *
- */
-
-#include
-#include
-
-extern char x86_tcpip_loop_end[];
-
-/**
- * Calculate continued TCP/IP checkum
- *
- * @v partial Checksum of already-summed data, in network byte order
- * @v data Data buffer
- * @v len Length of data buffer
- * @ret cksum Updated checksum, in network byte order
- */
-uint16_t x86_tcpip_continue_chksum ( uint16_t partial,
- const void *data, size_t len ) {
- unsigned long sum = ( ( ~partial ) & 0xffff );
- unsigned long initial_word_count;
- unsigned long loop_count;
- unsigned long loop_partial_count;
- unsigned long final_word_count;
- unsigned long final_byte;
- unsigned long discard_S;
- unsigned long discard_c;
- unsigned long discard_a;
- unsigned long discard_r1;
- unsigned long discard_r2;
-
- /* Calculate number of initial 16-bit words required to bring
- * the main loop into alignment. (We don't care about the
- * speed for data aligned to less than 16 bits, since this
- * situation won't occur in practice.)
- */
- if ( len >= sizeof ( sum ) ) {
- initial_word_count = ( ( -( ( intptr_t ) data ) &
- ( sizeof ( sum ) - 1 ) ) >> 1 );
- } else {
- initial_word_count = 0;
- }
- len -= ( initial_word_count * 2 );
-
- /* Calculate number of iterations of the main loop. This loop
- * processes native machine words (32-bit or 64-bit), and is
- * unrolled 16 times. We calculate an overall iteration
- * count, and a starting point for the first iteration.
- */
- loop_count = ( len / ( sizeof ( sum ) * 16 ) );
- loop_partial_count =
- ( ( len % ( sizeof ( sum ) * 16 ) ) / sizeof ( sum ) );
-
- /* Calculate number of 16-bit words remaining after the main
- * loop completes.
- */
- final_word_count = ( ( len % sizeof ( sum ) ) / 2 );
-
- /* Calculate whether or not a final byte remains at the end */
- final_byte = ( len & 1 );
-
- /* Calculate the checksum */
- __asm__ ( /* Calculate position at which to jump into the
- * unrolled loop.
- */
- "imul $( -x86_tcpip_loop_step_size ), %4\n\t"
- "add %5, %4\n\t"
-
- /* Clear carry flag before starting checksumming */
- "clc\n\t"
-
- /* Checksum initial words */
- "jmp 2f\n\t"
- "\n1:\n\t"
- "lodsw\n\t"
- "adcw %w2, %w0\n\t"
- "\n2:\n\t"
- "loop 1b\n\t"
-
- /* Main "lods;adc" loop, unrolled x16 */
- "mov %12, %3\n\t"
- "jmp *%4\n\t"
- "\nx86_tcpip_loop_start:\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "lods%z2\n\tadc %2, %0\n\t"
- "\nx86_tcpip_loop_end:\n\t"
- "loop x86_tcpip_loop_start\n\t"
- ".equ x86_tcpip_loop_step_size, "
- " ( ( x86_tcpip_loop_end - x86_tcpip_loop_start ) >> 4 )\n\t"
-
- /* Checksum remaining whole words */
- "mov %13, %3\n\t"
- "jmp 2f\n\t"
- "\n1:\n\t"
- "lodsw\n\t"
- "adcw %w2, %w0\n\t"
- "\n2:\n\t"
- "loop 1b\n\t"
-
- /* Checksum final byte if applicable */
- "mov %14, %3\n\t"
- "loop 1f\n\t"
- "adcb (%1), %b0\n\t"
- "adcb $0, %h0\n\t"
- "\n1:\n\t"
-
- /* Fold down to a uint16_t */
- "push %0\n\t"
- "popw %w0\n\t"
- "popw %w2\n\t"
- "adcw %w2, %w0\n\t"
-#if ULONG_MAX > 0xffffffffUL /* 64-bit only */
- "popw %w2\n\t"
- "adcw %w2, %w0\n\t"
- "popw %w2\n\t"
- "adcw %w2, %w0\n\t"
-#endif /* 64-bit only */
-
- /* Consume CF */
- "adcw $0, %w0\n\t"
- "adcw $0, %w0\n\t"
-
- : "=&Q" ( sum ), "=&S" ( discard_S ), "=&a" ( discard_a ),
- "=&c" ( discard_c ), "=&r" ( discard_r1 ),
- "=&r" ( discard_r2 )
- : "0" ( sum ), "1" ( data ), "2" ( 0 ),
- "3" ( initial_word_count + 1 ), "4" ( loop_partial_count ),
- "5" ( x86_tcpip_loop_end ), "g" ( loop_count + 1 ),
- "g" ( final_word_count + 1 ), "g" ( final_byte ) );
-
- return ( ~sum & 0xffff );
-}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/hci/commands/cpuid_cmd.c ipxe-1.0.1~lliurex1505/src/arch/x86/hci/commands/cpuid_cmd.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/hci/commands/cpuid_cmd.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/hci/commands/cpuid_cmd.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** @file
- *
- * x86 CPU feature detection command
- *
- */
-
-/** "cpuid" options */
-struct cpuid_options {
- /** Check AMD-defined features (%eax=0x80000001) */
- int amd;
- /** Check features defined via %ecx */
- int ecx;
-};
-
-/** "cpuid" option list */
-static struct option_descriptor cpuid_opts[] = {
- OPTION_DESC ( "ext", 'e', no_argument,
- struct cpuid_options, amd, parse_flag ),
- /* "--amd" retained for backwards compatibility */
- OPTION_DESC ( "amd", 'a', no_argument,
- struct cpuid_options, amd, parse_flag ),
- OPTION_DESC ( "ecx", 'c', no_argument,
- struct cpuid_options, ecx, parse_flag ),
-};
-
-/** "cpuid" command descriptor */
-static struct command_descriptor cpuid_cmd =
- COMMAND_DESC ( struct cpuid_options, cpuid_opts, 1, 1, "" );
-
-/**
- * The "cpuid" command
- *
- * @v argc Argument count
- * @v argv Argument list
- * @ret rc Return status code
- */
-static int cpuid_exec ( int argc, char **argv ) {
- struct cpuid_options opts;
- struct x86_features features;
- struct x86_feature_registers *feature_regs;
- uint32_t feature_reg;
- unsigned int bit;
- int rc;
-
- /* Parse options */
- if ( ( rc = parse_options ( argc, argv, &cpuid_cmd, &opts ) ) != 0 )
- return rc;
-
- /* Parse bit number */
- if ( ( rc = parse_integer ( argv[optind], &bit ) ) != 0 )
- return rc;
-
- /* Get CPU features */
- x86_features ( &features );
-
- /* Extract relevant feature register */
- feature_regs = ( opts.amd ? &features.amd : &features.intel );
- feature_reg = ( opts.ecx ? feature_regs->ecx : feature_regs->edx );
-
- /* Check presence of specified feature */
- return ( ( feature_reg & ( 1 << bit ) ) ? 0 : -ENOENT );
-}
-
-/** x86 CPU feature detection command */
-struct command cpuid_command __command = {
- .name = "cpuid",
- .exec = cpuid_exec,
-};
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/bigint.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/bigint.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/bigint.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/bigint.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,318 +0,0 @@
-#ifndef _BITS_BIGINT_H
-#define _BITS_BIGINT_H
-
-/** @file
- *
- * Big integer support
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-#include
-
-/** Element of a big integer */
-typedef uint32_t bigint_element_t;
-
-/**
- * Initialise big integer
- *
- * @v value0 Element 0 of big integer to initialise
- * @v size Number of elements
- * @v data Raw data
- * @v len Length of raw data
- */
-static inline __attribute__ (( always_inline )) void
-bigint_init_raw ( uint32_t *value0, unsigned int size,
- const void *data, size_t len ) {
- long pad_len = ( sizeof ( bigint_t ( size ) ) - len );
- void *discard_D;
- long discard_c;
-
- /* Copy raw data in reverse order, padding with zeros */
- __asm__ __volatile__ ( "\n1:\n\t"
- "movb -1(%2,%1), %%al\n\t"
- "stosb\n\t"
- "loop 1b\n\t"
- "xorl %%eax, %%eax\n\t"
- "mov %3, %1\n\t"
- "rep stosb\n\t"
- : "=&D" ( discard_D ), "=&c" ( discard_c )
- : "r" ( data ), "g" ( pad_len ), "0" ( value0 ),
- "1" ( len )
- : "eax" );
-}
-
-/**
- * Add big integers
- *
- * @v addend0 Element 0 of big integer to add
- * @v value0 Element 0 of big integer to be added to
- * @v size Number of elements
- */
-static inline __attribute__ (( always_inline )) void
-bigint_add_raw ( const uint32_t *addend0, uint32_t *value0,
- unsigned int size ) {
- long index;
- void *discard_S;
- long discard_c;
-
- __asm__ __volatile__ ( "xor %0, %0\n\t" /* Zero %0 and clear CF */
- "\n1:\n\t"
- "lodsl\n\t"
- "adcl %%eax, (%3,%0,4)\n\t"
- "inc %0\n\t" /* Does not affect CF */
- "loop 1b\n\t"
- : "=&r" ( index ), "=&S" ( discard_S ),
- "=&c" ( discard_c )
- : "r" ( value0 ), "1" ( addend0 ), "2" ( size )
- : "eax" );
-}
-
-/**
- * Subtract big integers
- *
- * @v subtrahend0 Element 0 of big integer to subtract
- * @v value0 Element 0 of big integer to be subtracted from
- * @v size Number of elements
- */
-static inline __attribute__ (( always_inline )) void
-bigint_subtract_raw ( const uint32_t *subtrahend0, uint32_t *value0,
- unsigned int size ) {
- long index;
- void *discard_S;
- long discard_c;
-
- __asm__ __volatile__ ( "xor %0, %0\n\t" /* Zero %0 and clear CF */
- "\n1:\n\t"
- "lodsl\n\t"
- "sbbl %%eax, (%3,%0,4)\n\t"
- "inc %0\n\t" /* Does not affect CF */
- "loop 1b\n\t"
- : "=&r" ( index ), "=&S" ( discard_S ),
- "=&c" ( discard_c )
- : "r" ( value0 ), "1" ( subtrahend0 ),
- "2" ( size )
- : "eax" );
-}
-
-/**
- * Rotate big integer left
- *
- * @v value0 Element 0 of big integer
- * @v size Number of elements
- */
-static inline __attribute__ (( always_inline )) void
-bigint_rol_raw ( uint32_t *value0, unsigned int size ) {
- long index;
- long discard_c;
-
- __asm__ __volatile__ ( "xor %0, %0\n\t" /* Zero %0 and clear CF */
- "\n1:\n\t"
- "rcll $1, (%2,%0,4)\n\t"
- "inc %0\n\t" /* Does not affect CF */
- "loop 1b\n\t"
- : "=&r" ( index ), "=&c" ( discard_c )
- : "r" ( value0 ), "1" ( size ) );
-}
-
-/**
- * Rotate big integer right
- *
- * @v value0 Element 0 of big integer
- * @v size Number of elements
- */
-static inline __attribute__ (( always_inline )) void
-bigint_ror_raw ( uint32_t *value0, unsigned int size ) {
- long discard_c;
-
- __asm__ __volatile__ ( "clc\n\t"
- "\n1:\n\t"
- "rcrl $1, -4(%1,%0,4)\n\t"
- "loop 1b\n\t"
- : "=&c" ( discard_c )
- : "r" ( value0 ), "0" ( size ) );
-}
-
-/**
- * Test if big integer is equal to zero
- *
- * @v value0 Element 0 of big integer
- * @v size Number of elements
- * @ret is_zero Big integer is equal to zero
- */
-static inline __attribute__ (( always_inline, pure )) int
-bigint_is_zero_raw ( const uint32_t *value0, unsigned int size ) {
- void *discard_D;
- long discard_c;
- int result;
-
- __asm__ __volatile__ ( "xor %0, %0\n\t" /* Set ZF */
- "repe scasl\n\t"
- "sete %b0\n\t"
- : "=&a" ( result ), "=&D" ( discard_D ),
- "=&c" ( discard_c )
- : "1" ( value0 ), "2" ( size ) );
- return result;
-}
-
-/**
- * Compare big integers
- *
- * @v value0 Element 0 of big integer
- * @v reference0 Element 0 of reference big integer
- * @v size Number of elements
- * @ret geq Big integer is greater than or equal to the reference
- */
-static inline __attribute__ (( always_inline, pure )) int
-bigint_is_geq_raw ( const uint32_t *value0, const uint32_t *reference0,
- unsigned int size ) {
- const bigint_t ( size ) __attribute__ (( may_alias )) *value =
- ( ( const void * ) value0 );
- const bigint_t ( size ) __attribute__ (( may_alias )) *reference =
- ( ( const void * ) reference0 );
- void *discard_S;
- void *discard_D;
- long discard_c;
- int result;
-
- __asm__ __volatile__ ( "std\n\t"
- "\n1:\n\t"
- "lodsl\n\t"
- "scasl\n\t"
- "loope 1b\n\t"
- "setae %b0\n\t"
- "cld\n\t"
- : "=q" ( result ), "=&S" ( discard_S ),
- "=&D" ( discard_D ), "=&c" ( discard_c )
- : "0" ( 0 ), "1" ( &value->element[ size - 1 ] ),
- "2" ( &reference->element[ size - 1 ] ),
- "3" ( size )
- : "eax" );
- return result;
-}
-
-/**
- * Test if bit is set in big integer
- *
- * @v value0 Element 0 of big integer
- * @v size Number of elements
- * @v bit Bit to test
- * @ret is_set Bit is set
- */
-static inline __attribute__ (( always_inline )) int
-bigint_bit_is_set_raw ( const uint32_t *value0, unsigned int size,
- unsigned int bit ) {
- const bigint_t ( size ) __attribute__ (( may_alias )) *value =
- ( ( const void * ) value0 );
- unsigned int index = ( bit / ( 8 * sizeof ( value->element[0] ) ) );
- unsigned int subindex = ( bit % ( 8 * sizeof ( value->element[0] ) ) );
-
- return ( value->element[index] & ( 1 << subindex ) );
-}
-
-/**
- * Find highest bit set in big integer
- *
- * @v value0 Element 0 of big integer
- * @v size Number of elements
- * @ret max_bit Highest bit set + 1 (or 0 if no bits set)
- */
-static inline __attribute__ (( always_inline )) int
-bigint_max_set_bit_raw ( const uint32_t *value0, unsigned int size ) {
- long discard_c;
- int result;
-
- __asm__ __volatile__ ( "\n1:\n\t"
- "bsrl -4(%2,%1,4), %0\n\t"
- "loopz 1b\n\t"
- "rol %1\n\t" /* Does not affect ZF */
- "rol %1\n\t"
- "leal 1(%k0,%k1,8), %k0\n\t"
- "jnz 2f\n\t"
- "xor %0, %0\n\t"
- "\n2:\n\t"
- : "=&r" ( result ), "=&c" ( discard_c )
- : "r" ( value0 ), "1" ( size ) );
- return result;
-}
-
-/**
- * Grow big integer
- *
- * @v source0 Element 0 of source big integer
- * @v source_size Number of elements in source big integer
- * @v dest0 Element 0 of destination big integer
- * @v dest_size Number of elements in destination big integer
- */
-static inline __attribute__ (( always_inline )) void
-bigint_grow_raw ( const uint32_t *source0, unsigned int source_size,
- uint32_t *dest0, unsigned int dest_size ) {
- long pad_size = ( dest_size - source_size );
- void *discard_D;
- void *discard_S;
- long discard_c;
-
- __asm__ __volatile__ ( "rep movsl\n\t"
- "xorl %%eax, %%eax\n\t"
- "mov %3, %2\n\t"
- "rep stosl\n\t"
- : "=&D" ( discard_D ), "=&S" ( discard_S ),
- "=&c" ( discard_c )
- : "g" ( pad_size ), "0" ( dest0 ),
- "1" ( source0 ), "2" ( source_size )
- : "eax" );
-}
-
-/**
- * Shrink big integer
- *
- * @v source0 Element 0 of source big integer
- * @v source_size Number of elements in source big integer
- * @v dest0 Element 0 of destination big integer
- * @v dest_size Number of elements in destination big integer
- */
-static inline __attribute__ (( always_inline )) void
-bigint_shrink_raw ( const uint32_t *source0, unsigned int source_size __unused,
- uint32_t *dest0, unsigned int dest_size ) {
- void *discard_D;
- void *discard_S;
- long discard_c;
-
- __asm__ __volatile__ ( "rep movsl\n\t"
- : "=&D" ( discard_D ), "=&S" ( discard_S ),
- "=&c" ( discard_c )
- : "0" ( dest0 ), "1" ( source0 ),
- "2" ( dest_size )
- : "eax" );
-}
-
-/**
- * Finalise big integer
- *
- * @v value0 Element 0 of big integer to finalise
- * @v size Number of elements
- * @v out Output buffer
- * @v len Length of output buffer
- */
-static inline __attribute__ (( always_inline )) void
-bigint_done_raw ( const uint32_t *value0, unsigned int size __unused,
- void *out, size_t len ) {
- void *discard_D;
- long discard_c;
-
- /* Copy raw data in reverse order */
- __asm__ __volatile__ ( "\n1:\n\t"
- "movb -1(%2,%1), %%al\n\t"
- "stosb\n\t"
- "loop 1b\n\t"
- : "=&D" ( discard_D ), "=&c" ( discard_c )
- : "r" ( value0 ), "0" ( out ), "1" ( len )
- : "eax" );
-}
-
-extern void bigint_multiply_raw ( const uint32_t *multiplicand0,
- const uint32_t *multiplier0,
- uint32_t *value0, unsigned int size );
-
-#endif /* _BITS_BIGINT_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/errfile.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/errfile.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/errfile.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/errfile.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,53 +0,0 @@
-#ifndef _BITS_ERRFILE_H
-#define _BITS_ERRFILE_H
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/**
- * @addtogroup errfile Error file identifiers
- * @{
- */
-
-#define ERRFILE_memtop_umalloc ( ERRFILE_ARCH | ERRFILE_CORE | 0x00000000 )
-#define ERRFILE_memmap ( ERRFILE_ARCH | ERRFILE_CORE | 0x00010000 )
-#define ERRFILE_pnpbios ( ERRFILE_ARCH | ERRFILE_CORE | 0x00020000 )
-#define ERRFILE_bios_smbios ( ERRFILE_ARCH | ERRFILE_CORE | 0x00030000 )
-#define ERRFILE_biosint ( ERRFILE_ARCH | ERRFILE_CORE | 0x00040000 )
-#define ERRFILE_int13 ( ERRFILE_ARCH | ERRFILE_CORE | 0x00050000 )
-#define ERRFILE_pxeparent ( ERRFILE_ARCH | ERRFILE_CORE | 0x00060000 )
-#define ERRFILE_runtime ( ERRFILE_ARCH | ERRFILE_CORE | 0x00070000 )
-#define ERRFILE_vmware ( ERRFILE_ARCH | ERRFILE_CORE | 0x00080000 )
-#define ERRFILE_guestrpc ( ERRFILE_ARCH | ERRFILE_CORE | 0x00090000 )
-#define ERRFILE_guestinfo ( ERRFILE_ARCH | ERRFILE_CORE | 0x000a0000 )
-#define ERRFILE_apm ( ERRFILE_ARCH | ERRFILE_CORE | 0x000b0000 )
-
-#define ERRFILE_bootsector ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00000000 )
-#define ERRFILE_bzimage ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00010000 )
-#define ERRFILE_eltorito ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00020000 )
-#define ERRFILE_multiboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00030000 )
-#define ERRFILE_nbi ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00040000 )
-#define ERRFILE_pxe_image ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00050000 )
-#define ERRFILE_elfboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00060000 )
-#define ERRFILE_comboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00070000 )
-#define ERRFILE_com32 ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00080000 )
-#define ERRFILE_comboot_resolv ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00090000 )
-#define ERRFILE_comboot_call ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x000a0000 )
-#define ERRFILE_sdi ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x000b0000 )
-#define ERRFILE_initrd ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x000c0000 )
-#define ERRFILE_pxe_call ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x000d0000 )
-
-#define ERRFILE_undi ( ERRFILE_ARCH | ERRFILE_NET | 0x00000000 )
-#define ERRFILE_undiload ( ERRFILE_ARCH | ERRFILE_NET | 0x00010000 )
-#define ERRFILE_undinet ( ERRFILE_ARCH | ERRFILE_NET | 0x00020000 )
-#define ERRFILE_undionly ( ERRFILE_ARCH | ERRFILE_NET | 0x00030000 )
-#define ERRFILE_undirom ( ERRFILE_ARCH | ERRFILE_NET | 0x00040000 )
-
-#define ERRFILE_timer_rdtsc ( ERRFILE_ARCH | ERRFILE_DRIVER | 0x00000000 )
-#define ERRFILE_timer_bios ( ERRFILE_ARCH | ERRFILE_DRIVER | 0x00010000 )
-
-#define ERRFILE_cpuid_cmd ( ERRFILE_ARCH | ERRFILE_OTHER | 0x00000000 )
-#define ERRFILE_cpuid_settings ( ERRFILE_ARCH | ERRFILE_OTHER | 0x00010000 )
-
-/** @} */
-
-#endif /* _BITS_ERRFILE_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/io.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/io.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/io.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/io.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-#ifndef _BITS_IO_H
-#define _BITS_IO_H
-
-/** @file
- *
- * x86-specific I/O API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-#endif /* _BITS_IO_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/string.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/string.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/bits/string.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/bits/string.h 2012-01-06 23:49:04.000000000 +0000
@@ -1,46 +1,44 @@
-#ifndef X86_BITS_STRING_H
-#define X86_BITS_STRING_H
-
+#ifndef ETHERBOOT_BITS_STRING_H
+#define ETHERBOOT_BITS_STRING_H
/*
- * Copyright (C) 2007 Michael Brown .
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * Taken from Linux /usr/include/asm/string.h
+ * All except memcpy, memmove, memset and memcmp removed.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Non-standard memswap() function added because it saves quite a bit
+ * of code (mbrown@fensystems.co.uk).
*/
-FILE_LICENCE ( GPL2_OR_LATER );
-
-/** @file
- *
- * Optimised string operations
+/*
+ * This string-include defines all string functions as inline
+ * functions. Use gcc. It also assumes ds=es=data space, this should be
+ * normal. Most of the string-functions are rather heavily hand-optimized,
+ * see especially strtok,strstr,str[c]spn. They should work, but are not
+ * very easy to understand. Everything is done entirely within the register
+ * set, making the functions fast and clean. String instructions have been
+ * used through-out, making for "slightly" unclear code :-)
*
+ * NO Copyright (C) 1991, 1992 Linus Torvalds,
+ * consider these trivial functions to be PD.
*/
+FILE_LICENCE ( PUBLIC_DOMAIN );
+
#define __HAVE_ARCH_MEMCPY
extern void * __memcpy ( void *dest, const void *src, size_t len );
-extern void * __memcpy_reverse ( void *dest, const void *src, size_t len );
-/**
- * Copy memory area (where length is a compile-time constant)
- *
- * @v dest Destination address
- * @v src Source address
- * @v len Length
- * @ret dest Destination address
- */
+#if 0
+static inline __attribute__ (( always_inline )) void *
+__memcpy ( void *dest, const void *src, size_t len ) {
+ int d0, d1, d2;
+ __asm__ __volatile__ ( "rep ; movsb"
+ : "=&c" ( d0 ), "=&S" ( d1 ), "=&D" ( d2 )
+ : "0" ( len ), "1" ( src ), "2" ( dest )
+ : "memory" );
+ return dest;
+}
+#endif
+
static inline __attribute__ (( always_inline )) void *
__constant_memcpy ( void *dest, const void *src, size_t len ) {
union {
@@ -152,81 +150,103 @@
return dest;
}
-/**
- * Copy memory area
- *
- * @v dest Destination address
- * @v src Source address
- * @v len Length
- * @ret dest Destination address
- */
-static inline __attribute__ (( always_inline )) void *
-memcpy ( void *dest, const void *src, size_t len ) {
- if ( __builtin_constant_p ( len ) ) {
- return __constant_memcpy ( dest, src, len );
- } else {
- return __memcpy ( dest, src, len );
- }
-}
+#define memcpy( dest, src, len ) \
+ ( __builtin_constant_p ( (len) ) ? \
+ __constant_memcpy ( (dest), (src), (len) ) : \
+ __memcpy ( (dest), (src), (len) ) )
#define __HAVE_ARCH_MEMMOVE
-
-extern void * __memmove ( void *dest, const void *src, size_t len );
-
-/**
- * Copy (possibly overlapping) memory area
- *
- * @v dest Destination address
- * @v src Source address
- * @v len Length
- * @ret dest Destination address
- */
-static inline __attribute__ (( always_inline )) void *
-memmove ( void *dest, const void *src, size_t len ) {
- ssize_t offset = ( dest - src );
-
- if ( __builtin_constant_p ( offset ) ) {
- if ( offset <= 0 ) {
- return memcpy ( dest, src, len );
- } else {
- return __memcpy_reverse ( dest, src, len );
- }
- } else {
- return __memmove ( dest, src, len );
- }
+static inline void * memmove(void * dest,const void * src, size_t n)
+{
+int d0, d1, d2;
+if (dest
-
-/** An x86 CPU feature register set */
-struct x86_feature_registers {
- /** Features returned via %ecx */
- uint32_t ecx;
- /** Features returned via %edx */
- uint32_t edx;
-};
-
-/** x86 CPU features */
-struct x86_features {
- /** Intel-defined features (%eax=0x00000001) */
- struct x86_feature_registers intel;
- /** AMD-defined features (%eax=0x80000001) */
- struct x86_feature_registers amd;
-};
-
-/** CPUID support flag */
-#define CPUID_FLAG 0x00200000UL
-
-/** CPUID extended function */
-#define CPUID_EXTENDED 0x80000000UL
-
-/** Get vendor ID and largest standard function */
-#define CPUID_VENDOR_ID 0x00000000UL
-
-/** Get standard features */
-#define CPUID_FEATURES 0x00000001UL
-
-/** Get largest extended function */
-#define CPUID_AMD_MAX_FN 0x80000000UL
-
-/** Extended function existence check */
-#define CPUID_AMD_CHECK 0x80000000UL
-
-/** Extended function existence check mask */
-#define CPUID_AMD_CHECK_MASK 0xffff0000UL
-
-/** Get extended features */
-#define CPUID_AMD_FEATURES 0x80000001UL
-
-/** Get CPU model */
-#define CPUID_MODEL 0x80000002UL
-
-/**
- * Issue CPUID instruction
- *
- * @v operation CPUID operation
- * @v eax Output via %eax
- * @v ebx Output via %ebx
- * @v ecx Output via %ecx
- * @v edx Output via %edx
- */
-static inline __attribute__ (( always_inline )) void
-cpuid ( uint32_t operation, uint32_t *eax, uint32_t *ebx, uint32_t *ecx,
- uint32_t *edx ) {
-
- __asm__ ( "cpuid"
- : "=a" ( *eax ), "=b" ( *ebx ), "=c" ( *ecx ), "=d" ( *edx )
- : "0" ( operation ) );
-}
-
-extern int cpuid_is_supported ( void );
-extern void x86_features ( struct x86_features *features );
-
-#endif /* _IPXE_CPUID_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/ipxe/x86_io.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/ipxe/x86_io.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/ipxe/x86_io.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/ipxe/x86_io.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,159 +0,0 @@
-#ifndef _IPXE_X86_IO_H
-#define _IPXE_X86_IO_H
-
-/** @file
- *
- * iPXE I/O API for x86
- *
- * x86 uses direct pointer dereferences for accesses to memory-mapped
- * I/O space, and the inX/outX instructions for accesses to
- * port-mapped I/O space.
- *
- * 64-bit atomic accesses (readq() and writeq()) use MMX instructions
- * under i386, and will crash original Pentium and earlier CPUs.
- * Fortunately, no hardware that requires atomic 64-bit accesses will
- * physically fit into a machine with such an old CPU anyway.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#ifdef IOAPI_X86
-#define IOAPI_PREFIX_x86
-#else
-#define IOAPI_PREFIX_x86 __x86_
-#endif
-
-/*
- * Memory space mappings
- *
- */
-
-/*
- * Physical<->Bus and Bus<->I/O address mappings
- *
- */
-
-static inline __always_inline unsigned long
-IOAPI_INLINE ( x86, phys_to_bus ) ( unsigned long phys_addr ) {
- return phys_addr;
-}
-
-static inline __always_inline unsigned long
-IOAPI_INLINE ( x86, bus_to_phys ) ( unsigned long bus_addr ) {
- return bus_addr;
-}
-
-static inline __always_inline void *
-IOAPI_INLINE ( x86, ioremap ) ( unsigned long bus_addr, size_t len __unused ) {
- return phys_to_virt ( bus_addr );
-}
-
-static inline __always_inline void
-IOAPI_INLINE ( x86, iounmap ) ( volatile const void *io_addr __unused ) {
- /* Nothing to do */
-}
-
-static inline __always_inline unsigned long
-IOAPI_INLINE ( x86, io_to_bus ) ( volatile const void *io_addr ) {
- return virt_to_phys ( io_addr );
-}
-
-/*
- * MMIO reads and writes up to native word size
- *
- */
-
-#define X86_READX( _api_func, _type ) \
-static inline __always_inline _type \
-IOAPI_INLINE ( x86, _api_func ) ( volatile _type *io_addr ) { \
- return *io_addr; \
-}
-X86_READX ( readb, uint8_t );
-X86_READX ( readw, uint16_t );
-X86_READX ( readl, uint32_t );
-#ifdef __x86_64__
-X86_READX ( readq, uint64_t );
-#endif
-
-#define X86_WRITEX( _api_func, _type ) \
-static inline __always_inline void \
-IOAPI_INLINE ( x86, _api_func ) ( _type data, \
- volatile _type *io_addr ) { \
- *io_addr = data; \
-}
-X86_WRITEX ( writeb, uint8_t );
-X86_WRITEX ( writew, uint16_t );
-X86_WRITEX ( writel, uint32_t );
-#ifdef __x86_64__
-X86_WRITEX ( writeq, uint64_t );
-#endif
-
-/*
- * PIO reads and writes up to 32 bits
- *
- */
-
-#define X86_INX( _insn_suffix, _type, _reg_prefix ) \
-static inline __always_inline _type \
-IOAPI_INLINE ( x86, in ## _insn_suffix ) ( volatile _type *io_addr ) { \
- _type data; \
- __asm__ __volatile__ ( "in" #_insn_suffix " %w1, %" _reg_prefix "0" \
- : "=a" ( data ) : "Nd" ( io_addr ) ); \
- return data; \
-} \
-static inline __always_inline void \
-IOAPI_INLINE ( x86, ins ## _insn_suffix ) ( volatile _type *io_addr, \
- _type *data, \
- unsigned int count ) { \
- unsigned int discard_D; \
- __asm__ __volatile__ ( "rep ins" #_insn_suffix \
- : "=D" ( discard_D ) \
- : "d" ( io_addr ), "c" ( count ), \
- "0" ( data ) ); \
-}
-X86_INX ( b, uint8_t, "b" );
-X86_INX ( w, uint16_t, "w" );
-X86_INX ( l, uint32_t, "k" );
-
-#define X86_OUTX( _insn_suffix, _type, _reg_prefix ) \
-static inline __always_inline void \
-IOAPI_INLINE ( x86, out ## _insn_suffix ) ( _type data, \
- volatile _type *io_addr ) { \
- __asm__ __volatile__ ( "out" #_insn_suffix " %" _reg_prefix "0, %w1" \
- : : "a" ( data ), "Nd" ( io_addr ) ); \
-} \
-static inline __always_inline void \
-IOAPI_INLINE ( x86, outs ## _insn_suffix ) ( volatile _type *io_addr, \
- const _type *data, \
- unsigned int count ) { \
- unsigned int discard_S; \
- __asm__ __volatile__ ( "rep outs" #_insn_suffix \
- : "=S" ( discard_S ) \
- : "d" ( io_addr ), "c" ( count ), \
- "0" ( data ) ); \
-}
-X86_OUTX ( b, uint8_t, "b" );
-X86_OUTX ( w, uint16_t, "w" );
-X86_OUTX ( l, uint32_t, "k" );
-
-/*
- * Slow down I/O
- *
- */
-
-static inline __always_inline void
-IOAPI_INLINE ( x86, iodelay ) ( void ) {
- __asm__ __volatile__ ( "outb %al, $0x80" );
-}
-
-/*
- * Memory barrier
- *
- */
-
-static inline __always_inline void
-IOAPI_INLINE ( x86, mb ) ( void ) {
- __asm__ __volatile__ ( "lock; addl $0, 0(%%esp)" : : : "memory" );
-}
-
-#endif /* _IPXE_X86_IO_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/valgrind/memcheck.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/valgrind/memcheck.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/valgrind/memcheck.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/valgrind/memcheck.h 2012-01-06 23:49:04.000000000 +0000
@@ -60,8 +60,6 @@
#ifndef __MEMCHECK_H
#define __MEMCHECK_H
-FILE_LICENCE ( BSD3 );
-
/* This file is for inclusion into client (your!) code.
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/valgrind/valgrind.h ipxe-1.0.1~lliurex1505/src/arch/x86/include/valgrind/valgrind.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/include/valgrind/valgrind.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/include/valgrind/valgrind.h 2012-01-06 23:49:04.000000000 +0000
@@ -73,8 +73,6 @@
#ifndef __VALGRIND_H
#define __VALGRIND_H
-FILE_LICENCE ( BSD3 );
-
/* ------------------------------------------------------------------ */
/* VERSION NUMBER OF VALGRIND */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/interface/efi/efix86_nap.c ipxe-1.0.1~lliurex1505/src/arch/x86/interface/efi/efix86_nap.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/interface/efi/efix86_nap.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/interface/efi/efix86_nap.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/Makefile ipxe-1.0.1~lliurex1505/src/arch/x86/Makefile
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/Makefile 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/Makefile 2012-01-06 23:49:04.000000000 +0000
@@ -7,7 +7,6 @@
SRCDIRS += arch/x86/core
SRCDIRS += arch/x86/interface/efi
SRCDIRS += arch/x86/prefix
-SRCDIRS += arch/x86/hci/commands
# breaks building some of the linux-related objects
CFLAGS += -Ulinux
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/Makefile.efi ipxe-1.0.1~lliurex1505/src/arch/x86/Makefile.efi
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/Makefile.efi 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/Makefile.efi 2012-01-06 23:49:04.000000000 +0000
@@ -12,8 +12,6 @@
#
NON_AUTO_MEDIA += efi
NON_AUTO_MEDIA += efidrv
-NON_AUTO_MEDIA += drv.efi
-NON_AUTO_MEDIA += efirom
# Rules for building EFI files
#
@@ -25,14 +23,6 @@
$(QM)$(ECHO) " [FINISH] $@"
$(Q)$(ELF2EFI) --subsystem=11 $< $@
-$(BIN)/%.drv.efi : $(BIN)/%.efidrv
- $(QM)$(ECHO) " [FINISH] $@"
- $(Q)$(CP) $< $@
-
$(BIN)/%.efirom : $(BIN)/%.efidrv $(EFIROM)
$(QM)$(ECHO) " [FINISH] $@"
$(Q)$(EFIROM) -v $(TGT_PCI_VENDOR) -d $(TGT_PCI_DEVICE) $< $@
-
-$(BIN)/efidrv.cab : $(BIN)/alldrv.efis # $(ALL_drv.efi) is not yet defined
- $(QM)$(ECHO) " [CAB] $@"
- $(Q)$(LCAB) -n -q $(ALL_drv.efi) $@
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/prefix/efidrvprefix.c ipxe-1.0.1~lliurex1505/src/arch/x86/prefix/efidrvprefix.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/prefix/efidrvprefix.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/prefix/efidrvprefix.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,8 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/prefix/efiprefix.c ipxe-1.0.1~lliurex1505/src/arch/x86/prefix/efiprefix.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/prefix/efiprefix.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/prefix/efiprefix.c 2012-01-06 23:49:04.000000000 +0000
@@ -13,14 +13,12 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include
-#include
#include
/**
@@ -39,5 +37,5 @@
return efirc;
/* Call to main() */
- return EFIRC ( main () );
+ return RC_TO_EFIRC ( main () );
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/scripts/efi.lds ipxe-1.0.1~lliurex1505/src/arch/x86/scripts/efi.lds
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86/scripts/efi.lds 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86/scripts/efi.lds 2012-01-06 23:49:04.000000000 +0000
@@ -55,8 +55,6 @@
*(.data)
*(.data.*)
KEEP(*(SORT(.tbl.*))) /* Various tables. See include/tables.h */
- KEEP(*(.provided))
- KEEP(*(.provided.*))
_edata = .;
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/core/linux/linuxprefix.S ipxe-1.0.1~lliurex1505/src/arch/x86_64/core/linux/linuxprefix.S
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/core/linux/linuxprefix.S 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/core/linux/linuxprefix.S 2012-01-06 23:49:04.000000000 +0000
@@ -22,4 +22,4 @@
movq $__NR_exit, %rax
syscall
- .size _linux_start, . - _linux_start
+ .size _start, . - _start
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/byteswap.h ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/byteswap.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/byteswap.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/byteswap.h 2012-01-06 23:49:04.000000000 +0000
@@ -1,47 +1,22 @@
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H
-/** @file
- *
- * Byte-order swapping functions
- *
- */
-
-#include
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
static inline __attribute__ (( always_inline, const )) uint16_t
__bswap_variable_16 ( uint16_t x ) {
__asm__ ( "xchgb %b0,%h0" : "=Q" ( x ) : "0" ( x ) );
return x;
}
-static inline __attribute__ (( always_inline )) void
-__bswap_16s ( uint16_t *x ) {
- __asm__ ( "rorw $8, %0" : "+m" ( *x ) );
-}
-
static inline __attribute__ (( always_inline, const )) uint32_t
__bswap_variable_32 ( uint32_t x ) {
__asm__ ( "bswapl %k0" : "=r" ( x ) : "0" ( x ) );
return x;
}
-static inline __attribute__ (( always_inline )) void
-__bswap_32s ( uint32_t *x ) {
- __asm__ ( "bswapl %k0" : "=r" ( *x ) : "0" ( *x ) );
-}
-
static inline __attribute__ (( always_inline, const )) uint64_t
__bswap_variable_64 ( uint64_t x ) {
__asm__ ( "bswapq %q0" : "=r" ( x ) : "0" ( x ) );
return x;
}
-static inline __attribute__ (( always_inline )) void
-__bswap_64s ( uint64_t *x ) {
- __asm__ ( "bswapq %q0" : "=r" ( *x ) : "0" ( *x ) );
-}
-
#endif /* _BITS_BYTESWAP_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/entropy.h ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/entropy.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/entropy.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/entropy.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-#ifndef _BITS_ENTROPY_H
-#define _BITS_ENTROPY_H
-
-/** @file
- *
- * x86_64-specific entropy API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#endif /* _BITS_ENTROPY_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/errfile.h ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/errfile.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/errfile.h 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/errfile.h 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,11 @@
+#ifndef _BITS_ERRFILE_H
+#define _BITS_ERRFILE_H
+
+/**
+ * @addtogroup errfile Error file identifiers
+ * @{
+ */
+
+/** @} */
+
+#endif /* _BITS_ERRFILE_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/io.h ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/io.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/io.h 1970-01-01 00:00:00.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/io.h 2012-01-06 23:49:04.000000000 +0000
@@ -0,0 +1,10 @@
+#ifndef _BITS_IO_H
+#define _BITS_IO_H
+
+/** @file
+ *
+ * x86_64-specific I/O API implementations
+ *
+ */
+
+#endif /* _BITS_IO_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/reboot.h ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/reboot.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/reboot.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/reboot.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-#ifndef _BITS_REBOOT_H
-#define _BITS_REBOOT_H
-
-/** @file
- *
- * x86_64-specific reboot API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#endif /* _BITS_REBOOT_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/time.h ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/time.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/include/bits/time.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/include/bits/time.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-#ifndef _BITS_TIME_H
-#define _BITS_TIME_H
-
-/** @file
- *
- * x86_64-specific time API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#endif /* _BITS_TIME_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/Makefile ipxe-1.0.1~lliurex1505/src/arch/x86_64/Makefile
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/Makefile 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/Makefile 2012-01-06 23:49:04.000000000 +0000
@@ -26,18 +26,6 @@
#
CFLAGS += -Ui386
-# Add -maccumulate-outgoing-args if required by this version of gcc
-#
-ifeq ($(CCTYPE),gcc)
-MS_ABI_TEST_CODE := extern void __attribute__ (( ms_abi )) ms_abi(); \
- void sysv_abi ( void ) { ms_abi(); }
-MS_ABI_TEST = $(ECHO) '$(MS_ABI_TEST_CODE)' | \
- $(CC) -m64 -mno-accumulate-outgoing-args -x c -c - -o /dev/null \
- >/dev/null 2>&1
-MS_ABI_FLAGS := $(shell $(MS_ABI_TEST) || $(ECHO) '-maccumulate-outgoing-args')
-WORKAROUND_CFLAGS += $(MS_ABI_FLAGS)
-endif
-
# x86_64-specific directories containing source files
#
SRCDIRS += arch/x86_64/prefix
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/scripts/linux.lds ipxe-1.0.1~lliurex1505/src/arch/x86_64/scripts/linux.lds
--- ipxe-1.0.0+git-20131111.c3d1e78/src/arch/x86_64/scripts/linux.lds 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/arch/x86_64/scripts/linux.lds 2012-01-06 23:49:04.000000000 +0000
@@ -53,8 +53,6 @@
*(.data)
*(.data.*)
KEEP(*(SORT(.tbl.*)))
- KEEP(*(.provided))
- KEEP(*(.provided.*))
_edata = .;
}
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/colour.h ipxe-1.0.1~lliurex1505/src/config/colour.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/colour.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/colour.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,32 +0,0 @@
-#ifndef CONFIG_COLOUR_H
-#define CONFIG_COLOUR_H
-
-/** @file
- *
- * Display colour configuration
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#define COLOR_NORMAL_FG COLOR_WHITE
-#define COLOR_NORMAL_BG COLOR_BLUE
-
-#define COLOR_SELECT_FG COLOR_WHITE
-#define COLOR_SELECT_BG COLOR_RED
-
-#define COLOR_SEPARATOR_FG COLOR_CYAN
-#define COLOR_SEPARATOR_BG COLOR_BLUE
-
-#define COLOR_EDIT_FG COLOR_BLACK
-#define COLOR_EDIT_BG COLOR_CYAN
-
-#define COLOR_ALERT_FG COLOR_WHITE
-#define COLOR_ALERT_BG COLOR_RED
-
-#define COLOR_URL_FG COLOR_CYAN
-#define COLOR_URL_BG COLOR_BLUE
-
-#include
-
-#endif /* CONFIG_COLOUR_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/config.c ipxe-1.0.1~lliurex1505/src/config/config.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/config.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/config.c 2012-01-06 23:49:04.000000000 +0000
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
/** @file
*
@@ -72,27 +71,21 @@
#ifdef CONSOLE_DIRECT_VGA
REQUIRE_OBJECT ( video_subr );
#endif
+#ifdef CONSOLE_BTEXT
+REQUIRE_OBJECT ( btext );
+#endif
#ifdef CONSOLE_PC_KBD
REQUIRE_OBJECT ( pc_kbd );
#endif
#ifdef CONSOLE_SYSLOG
REQUIRE_OBJECT ( syslog );
#endif
-#ifdef CONSOLE_SYSLOGS
-REQUIRE_OBJECT ( syslogs );
-#endif
#ifdef CONSOLE_EFI
REQUIRE_OBJECT ( efi_console );
#endif
#ifdef CONSOLE_LINUX
REQUIRE_OBJECT ( linux_console );
#endif
-#ifdef CONSOLE_VMWARE
-REQUIRE_OBJECT ( vmconsole );
-#endif
-#ifdef CONSOLE_DEBUGCON
-REQUIRE_OBJECT ( debugcon );
-#endif
/*
* Drag in all requested network protocols
@@ -101,9 +94,6 @@
#ifdef NET_PROTO_IPV4
REQUIRE_OBJECT ( ipv4 );
#endif
-#ifdef NET_PROTO_IPV6
-REQUIRE_OBJECT ( ipv6 );
-#endif
/*
* Drag in all requested PXE support
@@ -132,8 +122,8 @@
#ifdef DOWNLOAD_PROTO_FTP
REQUIRE_OBJECT ( ftp );
#endif
-#ifdef DOWNLOAD_PROTO_NFS
-REQUIRE_OBJECT ( nfs_open );
+#ifdef DOWNLOAD_PROTO_TFTM
+REQUIRE_OBJECT ( tftm );
#endif
#ifdef DOWNLOAD_PROTO_SLAM
REQUIRE_OBJECT ( slam );
@@ -165,9 +155,18 @@
#ifdef IMAGE_ELF
REQUIRE_OBJECT ( elfboot );
#endif
+#ifdef IMAGE_FREEBSD
+REQUIRE_OBJECT ( freebsd );
+#endif
#ifdef IMAGE_MULTIBOOT
REQUIRE_OBJECT ( multiboot );
#endif
+#ifdef IMAGE_AOUT
+REQUIRE_OBJECT ( aout );
+#endif
+#ifdef IMAGE_WINCE
+REQUIRE_OBJECT ( wince );
+#endif
#ifdef IMAGE_PXE
REQUIRE_OBJECT ( pxe_image );
#endif
@@ -191,9 +190,6 @@
#ifdef IMAGE_EFI
REQUIRE_OBJECT ( efi_image );
#endif
-#ifdef IMAGE_SDI
-REQUIRE_OBJECT ( sdi );
-#endif
/*
* Drag in all requested commands
@@ -218,18 +214,12 @@
#ifdef IMAGE_CMD
REQUIRE_OBJECT ( image_cmd );
#endif
-#ifdef IMAGE_TRUST_CMD
-REQUIRE_OBJECT ( image_trust_cmd );
-#endif
#ifdef DHCP_CMD
REQUIRE_OBJECT ( dhcp_cmd );
#endif
#ifdef SANBOOT_CMD
REQUIRE_OBJECT ( sanboot_cmd );
#endif
-#ifdef MENU_CMD
-REQUIRE_OBJECT ( menu_cmd );
-#endif
#ifdef LOGIN_CMD
REQUIRE_OBJECT ( login_cmd );
#endif
@@ -248,33 +238,9 @@
#ifdef VLAN_CMD
REQUIRE_OBJECT ( vlan_cmd );
#endif
-#ifdef POWEROFF_CMD
-REQUIRE_OBJECT ( poweroff_cmd );
-#endif
#ifdef REBOOT_CMD
REQUIRE_OBJECT ( reboot_cmd );
#endif
-#ifdef CPUID_CMD
-REQUIRE_OBJECT ( cpuid_cmd );
-#endif
-#ifdef SYNC_CMD
-REQUIRE_OBJECT ( sync_cmd );
-#endif
-#ifdef NSLOOKUP_CMD
-REQUIRE_OBJECT ( nslookup_cmd );
-#endif
-#ifdef PCI_CMD
-REQUIRE_OBJECT ( pci_cmd );
-#endif
-#ifdef PARAM_CMD
-REQUIRE_OBJECT ( param_cmd );
-#endif
-#ifdef NEIGHBOUR_CMD
-REQUIRE_OBJECT ( neighbour_cmd );
-#endif
-#ifdef PING_CMD
-REQUIRE_OBJECT ( ping_cmd );
-#endif
/*
* Drag in miscellaneous objects
@@ -308,7 +274,7 @@
#endif
/*
- * Drag in relevant sideband entry points
+ * Drag in relevant BOFM entry points
*/
#ifdef CONFIG_BOFM
#ifdef BOFM_EFI
@@ -317,22 +283,6 @@
#endif /* CONFIG_BOFM */
/*
- * Drag in relevant settings sources
- */
-#ifdef PCI_SETTINGS
-REQUIRE_OBJECT ( pci_settings );
-#endif
-#ifdef VMWARE_SETTINGS
-REQUIRE_OBJECT ( guestinfo );
-#endif
-#ifdef CPUID_SETTINGS
-REQUIRE_OBJECT ( cpuid_settings );
-#endif
-#ifdef MEMMAP_SETTINGS
-REQUIRE_OBJECT ( memmap_settings );
-#endif
-
-/*
* Drag in selected keyboard map
*/
#define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/config_route.c ipxe-1.0.1~lliurex1505/src/config/config_route.c
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/config_route.c 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/config_route.c 1970-01-01 00:00:00.000000000 +0000
@@ -1,27 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2, or (at
- * your option) any later version.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-/** @file
- *
- * Routing management configuration options
- *
- */
-
-/*
- * Drag in routing management for relevant protocols
- *
- */
-#ifdef NET_PROTO_IPV4
-REQUIRE_OBJECT ( route_ipv4 );
-#endif
-#ifdef NET_PROTO_IPV6
-REQUIRE_OBJECT ( route_ipv6 );
-#endif
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/console.h ipxe-1.0.1~lliurex1505/src/config/console.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/console.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/console.h 2012-01-06 23:49:04.000000000 +0000
@@ -17,16 +17,12 @@
//#define CONSOLE_PCBIOS /* Default BIOS console */
//#define CONSOLE_SERIAL /* Serial port */
//#define CONSOLE_DIRECT_VGA /* Direct access to VGA card */
+//#define CONSOLE_BTEXT /* Who knows what this does? */
//#define CONSOLE_PC_KBD /* Direct access to PC keyboard */
//#define CONSOLE_SYSLOG /* Syslog console */
-//#define CONSOLE_SYSLOGS /* Encrypted syslog console */
-//#define CONSOLE_VMWARE /* VMware logfile console */
-//#define CONSOLE_DEBUGCON /* Debug port console */
#define KEYBOARD_MAP us
-#define LOG_LEVEL LOG_NONE
-
#include
#endif /* CONFIG_CONSOLE_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/defaults/efi.h ipxe-1.0.1~lliurex1505/src/config/defaults/efi.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/defaults/efi.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/defaults/efi.h 2012-01-06 23:49:04.000000000 +0000
@@ -7,10 +7,8 @@
*
*/
-FILE_LICENCE ( GPL2_OR_LATER );
-
#define UACCESS_EFI
-#define IOAPI_X86
+#define IOAPI_EFI
#define PCIAPI_EFI
#define CONSOLE_EFI
#define TIMER_EFI
@@ -19,14 +17,8 @@
#define SMBIOS_EFI
#define SANBOOT_NULL
#define BOFM_EFI
-#define ENTROPY_NULL
-#define TIME_NULL
-#define REBOOT_EFI
#define IMAGE_EFI /* EFI image support */
#define IMAGE_SCRIPT /* iPXE script image support */
-#define REBOOT_CMD /* Reboot command */
-#define CPUID_CMD /* x86 CPU feature detection command */
-
#endif /* CONFIG_DEFAULTS_EFI_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/defaults/linux.h ipxe-1.0.1~lliurex1505/src/config/defaults/linux.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/defaults/linux.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/defaults/linux.h 2012-01-06 23:49:04.000000000 +0000
@@ -7,8 +7,6 @@
*
*/
-FILE_LICENCE ( GPL2_OR_LATER );
-
#define CONSOLE_LINUX
#define TIMER_LINUX
#define UACCESS_LINUX
@@ -16,10 +14,6 @@
#define NAP_LINUX
#define SMBIOS_LINUX
#define SANBOOT_NULL
-#define ENTROPY_LINUX
-#define TIME_LINUX
-#define REBOOT_NULL
-#define PCIAPI_LINUX
#define DRIVERS_LINUX
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/defaults/pcbios.h ipxe-1.0.1~lliurex1505/src/config/defaults/pcbios.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/defaults/pcbios.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/defaults/pcbios.h 2012-01-06 23:49:04.000000000 +0000
@@ -18,15 +18,13 @@
#define UMALLOC_MEMTOP
#define SMBIOS_PCBIOS
#define SANBOOT_PCBIOS
-#define ENTROPY_RTC
-#define TIME_RTC
-#define REBOOT_PCBIOS
#define IMAGE_ELF /* ELF image support */
#define IMAGE_MULTIBOOT /* MultiBoot image support */
#define IMAGE_PXE /* PXE image support */
#define IMAGE_SCRIPT /* iPXE script image support */
#define IMAGE_BZIMAGE /* Linux bzImage image support */
+#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
#define PXE_STACK /* PXE stack in iPXE - required for PXELINUX */
#define PXE_MENU /* PXE menu booting */
@@ -37,6 +35,5 @@
#define SANBOOT_PROTO_FCP /* Fibre Channel protocol */
#define REBOOT_CMD /* Reboot command */
-#define CPUID_CMD /* x86 CPU feature detection command */
#endif /* CONFIG_DEFAULTS_PCBIOS_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/entropy.h ipxe-1.0.1~lliurex1505/src/config/entropy.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/entropy.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/entropy.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-#ifndef CONFIG_ENTROPY_H
-#define CONFIG_ENTROPY_H
-
-/** @file
- *
- * Entropy API configuration
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include
-
-#include
-
-#endif /* CONFIG_ENTROPY_H */
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/general.h ipxe-1.0.1~lliurex1505/src/config/general.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/general.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/general.h 2012-01-06 23:49:04.000000000 +0000
@@ -40,7 +40,6 @@
*/
#define NET_PROTO_IPV4 /* IPv4 protocol */
-#undef NET_PROTO_IPV6 /* IPv6 protocol */
#undef NET_PROTO_FCOE /* Fibre Channel over Ethernet protocol */
/*
@@ -59,8 +58,8 @@
#define DOWNLOAD_PROTO_HTTP /* Hypertext Transfer Protocol */
#undef DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */
#undef DOWNLOAD_PROTO_FTP /* File Transfer Protocol */
+#undef DOWNLOAD_PROTO_TFTM /* Multicast Trivial File Transfer Protocol */
#undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */
-#undef DOWNLOAD_PROTO_NFS /* Network File System Protocol */
/*
* SAN boot protocols
@@ -96,13 +95,15 @@
*/
//#define IMAGE_NBI /* NBI image support */
//#define IMAGE_ELF /* ELF image support */
+//#define IMAGE_FREEBSD /* FreeBSD kernel image support */
//#define IMAGE_MULTIBOOT /* MultiBoot image support */
+//#define IMAGE_AOUT /* a.out image support */
+//#define IMAGE_WINCE /* WinCE image support */
//#define IMAGE_PXE /* PXE image support */
//#define IMAGE_SCRIPT /* iPXE script image support */
//#define IMAGE_BZIMAGE /* Linux bzImage image support */
//#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
//#define IMAGE_EFI /* EFI image support */
-//#define IMAGE_SDI /* SDI image support */
/*
* Command-line commands to include
@@ -118,22 +119,13 @@
#define IMAGE_CMD /* Image management commands */
#define DHCP_CMD /* DHCP management commands */
#define SANBOOT_CMD /* SAN boot commands */
-#define MENU_CMD /* Menu commands */
#define LOGIN_CMD /* Login command */
-#define SYNC_CMD /* Sync command */
-//#define NSLOOKUP_CMD /* DNS resolving command */
//#define TIME_CMD /* Time commands */
//#define DIGEST_CMD /* Image crypto digest commands */
//#define LOTEST_CMD /* Loopback testing commands */
//#define VLAN_CMD /* VLAN commands */
//#define PXE_CMD /* PXE commands */
//#define REBOOT_CMD /* Reboot command */
-//#define POWEROFF_CMD /* Power off command */
-//#define IMAGE_TRUST_CMD /* Image trust management commands */
-//#define PCI_CMD /* PCI commands */
-//#define PARAM_CMD /* Form parameter commands */
-//#define NEIGHBOUR_CMD /* Neighbour management commands */
-//#define PING_CMD /* Ping command */
/*
* ROM-specific options
diff -Nru ipxe-1.0.0+git-20131111.c3d1e78/src/config/reboot.h ipxe-1.0.1~lliurex1505/src/config/reboot.h
--- ipxe-1.0.0+git-20131111.c3d1e78/src/config/reboot.h 2013-11-11 17:33:35.000000000 +0000
+++ ipxe-1.0.1~lliurex1505/src/config/reboot.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-#ifndef CONFIG_REBOOT_H
-#define CONFIG_REBOOT_H
-
-/** @file
- *
- * Reboot API configuration
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include