H. Peter Anvin [Wed, 23 Jun 2010 23:31:45 +0000 (16:31 -0700)]
Move modify_adv() into common code
modify_adv() should be used by any installer which uses the common
CLI, so it should go into syslxopt.c.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Wed, 23 Jun 2010 19:11:49 +0000 (12:11 -0700)]
fs: enforce filetypes in open_file
Enforce that the file type in open_file is a plain file.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Wed, 23 Jun 2010 19:11:21 +0000 (12:11 -0700)]
opendir: enforce the file type
Don't allow opendir() on a non-directory.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Wed, 23 Jun 2010 19:08:30 +0000 (12:08 -0700)]
pxe: set the file type in the inode structure
All "files" on PXE are regular files (there is no official directory
mechanism) and so, at least for now, it's all DT_REG.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Wed, 23 Jun 2010 06:21:15 +0000 (23:21 -0700)]
memdiskfind: remove debugging printf
Remove accidentally checked in debugging printf.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Wed, 23 Jun 2010 06:19:40 +0000 (23:19 -0700)]
memdiskfind: make sure we don't map unavailable RAM
Sometimes FBM is below the reserved memory limit, which means memory
that is available to protected-mode operating systems only and which
will be claimed by the kernel and therefore be unmappable. Read
/proc/iomem to make sure the memory range is safe to map.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Wed, 23 Jun 2010 00:09:52 +0000 (17:09 -0700)]
mtools: create an empty ADV
Create an install an empty ADV.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Wed, 23 Jun 2010 00:07:03 +0000 (17:07 -0700)]
dos: vacuous ADV support
Vacuous ADV support: install an empty ADV.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Wed, 23 Jun 2010 00:06:23 +0000 (17:06 -0700)]
setadv: remove unused, nonportable header file
This file does not need <sys/types.h>.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 23:52:32 +0000 (16:52 -0700)]
win32: vacuous ADV support
Install an empty ADV in the Windows installer to keep it from being
broken. In order to do that, separate the Unix-specific ADV I/O
functions from the generic data structure manipulation.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 22:59:04 +0000 (15:59 -0700)]
win32: use .obj not .o, and build an intermediate library
Use .obj as the extension, rather than .o, to match Windows
conventions. Furthermore, build an intermediate library for the stuff
that we pick up from elsewhere; this makes it easier to build
additional Windows binaries with helper functions in libinstaller or
another source library.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 22:16:47 +0000 (15:16 -0700)]
pxe: fix the timeout logic for RRQ
Fix the timeout logic for RRQ, to avoid a spew of identical RRQ
packets which at best will annoy the server.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 22:03:29 +0000 (15:03 -0700)]
pxe: fix bugs in DHCP parsing and config file selection
Fix several buffer-handling bugs in DHCP parsing and in the config
file selection.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 21:39:50 +0000 (14:39 -0700)]
pxe: correct the generation of the UUID string
The UUID string was generated incorrectly, starting over for each
component.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 21:34:59 +0000 (14:34 -0700)]
Merge remote branch 'erwan/master_new'
Erwan Velu [Tue, 22 Jun 2010 21:32:09 +0000 (23:32 +0200)]
hdt: new release 0.3.6.1
Increase subrelease for syslinux4.
hdt just only received code cleaning, no new feature.
Erwan Velu [Tue, 22 Jun 2010 21:30:25 +0000 (23:30 +0200)]
hdt: Using syslinux_reboot() call
Rebooting can be achieved via syslinux_reboot() instead of the useless reboot.c32 module.
Erwan Velu [Tue, 22 Jun 2010 21:27:41 +0000 (23:27 +0200)]
hdt: updating memtest to 4.10
H. Peter Anvin [Tue, 22 Jun 2010 20:39:44 +0000 (13:39 -0700)]
sysdump, be_srec: increment the address
Need to increment the address for each srec...
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 20:35:29 +0000 (13:35 -0700)]
sysdump: output S-records to the console
Sometimes we have a console path that can be captured (virtual
machine, serial console, ...) but no realistic path for two-way or
binary communication. Add an option to output S-records to the
console as an inefficient but hopefully reliable way to get data out.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Erwan Velu [Tue, 22 Jun 2010 19:43:27 +0000 (21:43 +0200)]
Replacing strncpy by strlcpy
As reported by hpa, strlcpy is safer and could prevent some bugs.
So I replaced all strncpy by strlcpy calls.
Erwan Velu [Tue, 22 Jun 2010 19:32:27 +0000 (21:32 +0200)]
Merge branch 'master' of git://git./boot/syslinux/syslinux into master_new
H. Peter Anvin [Tue, 22 Jun 2010 17:55:03 +0000 (10:55 -0700)]
memdisk: add a sector_shift field to the MDI; fix memdiskfind
Add a sector_shift field to the MDI rather than assuming 512-byte
sectors. Fix memdiskfind to report size in bytes, not in sectors.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 17:30:28 +0000 (10:30 -0700)]
diskstart: if no partition table, we need Hidden == 0
If we don't have a partition table, we need to make sure Hidden gets
set to zero.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 17:20:54 +0000 (10:20 -0700)]
isohybrid: fix another type mismatch
Fix another printf type mismatch in the C version of isohybrid.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Tue, 22 Jun 2010 05:59:19 +0000 (22:59 -0700)]
sysdump: smarter ACPI dump
Follow the XSDT as well as the RSDT, at least as long as we can do
that with 32-bit addresses. Actually keep track of what we have
already dumped.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Tue, 22 Jun 2010 05:57:35 +0000 (22:57 -0700)]
sysdump: make TFTP server optional
Make entering the TFTP server optional (defaults to boot server).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Tue, 22 Jun 2010 05:49:58 +0000 (22:49 -0700)]
<syslinux/config.h> fix the order of struct syslinux_ipinfo
Correct the order of the fields in struct syslinux_ipinfo to match
reality.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Tue, 22 Jun 2010 00:33:57 +0000 (17:33 -0700)]
memdiskfind: sanity check the FBM value
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 00:29:51 +0000 (17:29 -0700)]
memdiskfind: utility to find an mBFT and output phram parameters
A trivial Linux utility to search for mBFT and output its parameters
in a form which can be used as input to the phram Linux kernel module.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 00:29:11 +0000 (17:29 -0700)]
memdisk: make mstructs.h includable from Linux
Make mstructs.h includable from a Linux utility.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 00:18:02 +0000 (17:18 -0700)]
utils/Makefile: fix build rules
Fix isohybrid build rules.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 22 Jun 2010 00:17:33 +0000 (17:17 -0700)]
isohybrid: fix beginner mistakes
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Mon, 21 Jun 2010 22:59:40 +0000 (15:59 -0700)]
core: Make cfarcall IF-preserving
cfarcall does not take a register image on input, so we need to
explicitly preserve IF in the code flow.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Mon, 21 Jun 2010 22:58:57 +0000 (15:58 -0700)]
com32: make __farcall() IF-preserving
Make __farcall preserve the current value of IF. If we need to we can
create a __raw_farcall() operation which does not.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
George David [Mon, 21 Jun 2010 22:16:58 +0000 (16:16 -0600)]
linux installer: better error message for missing /tmp
Our linux distribution at my job didn't include a /tmp directory. When ever
I tried to use syslinux, I would get the following error:
./syslinux: No such file or directory
I modified the code to report this:
./syslinux: Cannot access the /tmp/ directory.
This would have helped me a lot rather than having to download the source
and run it through the debugger to figure out that my /tmp/ directory was
missing. I suspect if this ever happens again I'll know exactly what was
wrong, but hopefully it will help someone else.
H. Peter Anvin [Mon, 21 Jun 2010 22:12:48 +0000 (15:12 -0700)]
comboot: allow the read disk API call to specify a 64-bit LBA
We already had two MBZ fields reserved, so use one of them to expand
into a 64-bit LBA.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Mon, 21 Jun 2010 22:14:45 +0000 (15:14 -0700)]
core, adv: for CHS mode, the top 40 LBA bits must be zero
The top 40 bits of the LBA must be zero on CHS mode. Enforce this,
and also fix leak of the drive number into a divide instruction with
resulting overflow.
Reported-by: Gert Hulselmans <gerth@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Mon, 21 Jun 2010 22:14:19 +0000 (15:14 -0700)]
pxelinux: use alignb not alignz in a bss sections
In .bss sections use alignb, not alignz.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Erwan Velu [Mon, 21 Jun 2010 20:24:21 +0000 (22:24 +0200)]
Fixing compilation warning
Reported by Genne Cumm, some more_printf calls generates gcc warning.
H. Peter Anvin [Mon, 21 Jun 2010 17:39:38 +0000 (10:39 -0700)]
diskstart: fix CHS mode, reinstate cyl 1023 check
Fix loading in CHS mode; we were missing a popad. Also reinstate the
check for exceeding cylinder 1023.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 17:23:20 +0000 (10:23 -0700)]
diskstart: clean up GPT handling
We only need 56 bytes, not 92, and we should check for 0xED as the
partition type.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 17:11:59 +0000 (10:11 -0700)]
dns: don't get stuck on no packet received
Make sure the timeout actually gets processed. The right thing to do
for the receive loop is to check for timeout, then try to receive, and
loop until an acceptable packet has been received; we might as well do
that explicitly.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 17:03:03 +0000 (10:03 -0700)]
core: Preserve IF through call16()
An intcall should always be invoked with interrupts off, but that is
not necessarily the case for a near or far call; in fact it is quite
the exception. As such, do not filter IF in our register image, and
for our own internal call16() interface, propagate the protected-mode
IF value into real mode, just as we do for the pm_call interface.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 07:19:37 +0000 (00:19 -0700)]
pxe: fix handling of lost packets in DNS resolution
When we have lost packets in DNS resolution, or otherwise no
response, both rotate through the known servers and advance through
the timeout table.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 07:18:08 +0000 (00:18 -0700)]
pxe: properly null-terminate packet after tftp://
Properly null-terminate the output from a parsed tftp:// URL.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 05:59:51 +0000 (22:59 -0700)]
pxe: correct the parsing of tftp:// URLs
Correct the parsing of tftp:// URLs. DNS handling still needs to be
unbroken.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 01:42:43 +0000 (18:42 -0700)]
pxe: don't misidentify non-tftp URLs as tftp
Fix reversed test for tftp URLs
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 00:03:38 +0000 (17:03 -0700)]
core: align the EPA
Align the Extended Patch Area.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 21 Jun 2010 00:01:15 +0000 (17:01 -0700)]
Merge syslinux/extlinux patch code and core code
Merge the SYSLINUX and EXTLINUX patching code and core code, removing
EXTLINUX as a separate derivative. All the disk-based systems now use
the same code.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 20 Jun 2010 22:21:05 +0000 (15:21 -0700)]
Reduce sector 1 space pressure; further merge installer code
Reduce sector 1 space pressure by moving objects that aren't needed by
Sector 1 proper into an "extended patch area". While we're mucking
with the installer code, make the syslxint and extlinux installer code
even more similar. It should now be pretty straightforward to
outright merge the code.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 20 Jun 2010 21:00:57 +0000 (14:00 -0700)]
fat: fix off-by-one error in the FAT installer
Fix off-by-one error in the FAT installer, which caused the install to
incorrectly abort without the patched version of the data.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 20 Jun 2010 03:58:25 +0000 (20:58 -0700)]
linux/syslinux: handle the null pathname case
Fix mishandling of the null pathname case in the syslinux installer,
and generally clean up the handling of the subpath name.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 20 Jun 2010 02:08:39 +0000 (19:08 -0700)]
Merge remote branch 'sha0/for_hpa' into pathbased
H. Peter Anvin [Sun, 20 Jun 2010 02:05:45 +0000 (19:05 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Sat, 19 Jun 2010 02:05:10 +0000 (19:05 -0700)]
pxe: mark ipinfo as IPv4
IP information is IPv4 for now.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 19 Jun 2010 01:45:02 +0000 (18:45 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Sat, 19 Jun 2010 01:30:44 +0000 (18:30 -0700)]
core, pxe: remove stray debugging printf
Remove debugging printf added for testing.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 19 Jun 2010 01:28:43 +0000 (18:28 -0700)]
sysdump: dump ACPI information
Dump ACPI tables.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 19 Jun 2010 01:27:55 +0000 (18:27 -0700)]
sysdump: use lmalloc/lfree
Use lmalloc/lfree instead of using the fixed (obsolete) bounce buffer.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 19 Jun 2010 01:24:14 +0000 (18:24 -0700)]
sysdump: tftp: use lmalloc(), and set the gateway
Use lmalloc() rather than the fixed (obsolete) bounce buffer, and set
the gateway for PXE stacks that need it.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 19 Jun 2010 01:16:48 +0000 (18:16 -0700)]
pxe: centralize all the IP information and export it to modules
It appears that there still are PXE stacks in the field which needs
the crutch of being pointed to the default gateway. As such, put all
the IP information into a single memory structure and allow modules to
see it.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Fri, 18 Jun 2010 01:09:46 +0000 (18:09 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Thu, 17 Jun 2010 18:45:14 +0000 (11:45 -0700)]
Merge remote branch 'sha0/boot_args' into pathbased
Shao Miller [Fri, 11 Jun 2010 04:15:19 +0000 (04:15 +0000)]
eltorito: Scan upwards instead of downwards
A developer for GRUB4DOS called tinybit has reported that some
BIOSes crash when the DOS ElTorito.Sys driver scans drive number
0xFF. According to the El Torito specification, drive 0x7F
means "terminate all," so a plausible explanation suggested
by H. Peter Anvin is that the drive 0xFF is a shadow of drive
0x7F, thus contributing to a failure on these BIOSes.
Now we scan from 0x80 through 0xFF, instead.
[ hpa: dropped checkin of eltorito.sys ]
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Thu, 17 Jun 2010 18:41:15 +0000 (11:41 -0700)]
Merge remote branch 'sha0/mdiskchk_enh2' into pathbased
H. Peter Anvin [Wed, 16 Jun 2010 18:45:32 +0000 (11:45 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Wed, 16 Jun 2010 18:44:27 +0000 (11:44 -0700)]
Move Linux ioctl header magic into a single file
Put all the Linux ioctl header magic into a single shared file, and
try to make it as generally useful as possible.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Wed, 16 Jun 2010 00:24:32 +0000 (17:24 -0700)]
installer: fix use of FIEMAP
Correct the implementation of block mapping using FIEMAP (as opposed
to FIBMAP).
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Wed, 16 Jun 2010 00:15:02 +0000 (17:15 -0700)]
extlinux: don't compile with -O0
-O0 is good for debugging, but sucks for production.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 15 Jun 2010 23:49:41 +0000 (16:49 -0700)]
dos: fix get_64_sl() and set_64_sl()
We must make sure we actually use the modified pointer returned from
set_fs(), otherwise bad things happen...
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 15 Jun 2010 23:26:43 +0000 (16:26 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Tue, 15 Jun 2010 23:26:14 +0000 (16:26 -0700)]
Fix prototype for generate_extents
Add missing const
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 15 Jun 2010 23:24:57 +0000 (16:24 -0700)]
syslinux: synchronize generate_extents() with extlinux
Synchronize the code for generate_extents() from extlinux to syslinux.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 15 Jun 2010 23:23:41 +0000 (16:23 -0700)]
extlinux: remove debugging printf's
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 15 Jun 2010 23:21:17 +0000 (16:21 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Tue, 15 Jun 2010 23:18:24 +0000 (16:18 -0700)]
Switch to 64-bit sector pointers everywhere
Switch to consistent use of 64-bit sector pointers; this should enable
booting even for individual *partitions* larger than 2 TB. In order
to not slow down the boot too much, switch the initial load from an
enumeration to an extent map. This means the table gets larger (since
we have to assume the worst case), but it simplifies the Sector 1 code
(since we can push all the hard stuff into the installer), and will
speed up booting in the general case.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Shao Miller [Tue, 15 Jun 2010 04:34:20 +0000 (00:34 -0400)]
mdiskchk: Add --no-sequential mode
It might be useful to suppress MDISKCHK.COM's classic behaviour
of probing all BIOS drive numbers in search of MEMDISKs. Some BIOSes
might not enjoy being probed.
Reported-by: bylokk
Reported-by: Gert Hulselmans <gerth@zytor.com>
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 15 Jun 2010 03:36:34 +0000 (23:36 -0400)]
memdisk: Correct El Torito termination response
Two changes to the INT 0x13, AH=0x7B El Torito function:
1. Support the DL=0x7F "terminate all" parameter
2. Only respond to DL=0x7F or DL=our particular emulated drive number
This prevents tools like Bart Lagerweij's El Torito tools from
receiving false positives when probing all drive numbers.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Mon, 14 Jun 2010 22:50:56 +0000 (18:50 -0400)]
eltorito: Include drive 0xFF in scan
Although drive 0xFF could yield a false positive as the El Torito
booted-from drive number, some users of GRUB4DOS actually use
this drive number, so we should include it in our scan.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
H. Peter Anvin [Tue, 15 Jun 2010 00:34:24 +0000 (17:34 -0700)]
Merge branch 'pathbased' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into pathbased
H. Peter Anvin [Mon, 14 Jun 2010 22:43:40 +0000 (15:43 -0700)]
core: add hlt to infinite loop
We should never hit it, but if we do, don't burn the CPU to a crisp.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Mon, 14 Jun 2010 22:38:35 +0000 (15:38 -0700)]
Implement !GPT protocol in Syslinux core; handle offset > 2 TB
Implement the !GPT handover protocol in the Syslinux core, and handle
partition offsets above 2 TB. We do not yet handle filesystem sizes
above 2 TB, but that should be a reasonably straightforward extension
at this time (need to switch to 8-byte block pointers).
This finally meant moving getlinsec out of the boot sector, since it
no longer fits. Instead have a very simple getonesec implementation
in the boot sector. getlinsec still fits in Sector 1, although it
doesn't leave space for very many block pointers. That's still better
than adding yet another boot loader stage, however.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Mon, 14 Jun 2010 16:58:01 +0000 (09:58 -0700)]
gptmbr: change synthetic partition type to 0xED
The committee didn't like re-using 0xEE for this purpose and wants
0xED instead.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 13 Jun 2010 22:55:27 +0000 (15:55 -0700)]
Merge remote branch 'sherbszt/gfxboot32' into pathbased
H. Peter Anvin [Sun, 13 Jun 2010 21:18:23 +0000 (14:18 -0700)]
fat: handle .. pointing back to the root directory
.. pointing back to the root directory will have a cluster number of
0, even for FAT32 where there is an actual cluster number for the root
directory. Handle this as a special case.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Sebastian Herbszt [Sun, 13 Jun 2010 21:00:39 +0000 (23:00 +0200)]
gfxboot: set media type
Set media type according to the drive number and cd mode.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Shao Miller [Sat, 12 Jun 2010 15:03:28 +0000 (08:03 -0700)]
ifcpuXX: Support multiple parameters with labels
The ifcpu.c32 and ifcpu64.c32 modules take arguments including
the form <true_label> -- <false_label>. It is convenient to
allow these labels to be not just a single word, but to include
parameters. This is useful for <TAB>-editing and modifying the
command-line to include parameters you'd like to pass.
Not-yet-tested: Shao Miller <shao.miller@yrdsb.edu.on.ca>
H. Peter Anvin [Sat, 12 Jun 2010 00:21:35 +0000 (17:21 -0700)]
gptmbr: save four bytes
Save four bytes by observing that none of our code relies on
saturate_stosl not actually corrupting %eax.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 12 Jun 2010 00:19:52 +0000 (17:19 -0700)]
gptmbr: fix offset for MSW of partition end
Fix the offset for the MSW of the partition endpoint.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sat, 12 Jun 2010 00:03:24 +0000 (17:03 -0700)]
gptmbr: implement the new T13-approved GPT protocol
My GPT-based protocol was modified by the UEFI and T13 committees (the
former responsible for the GPT format, the latter for EDD and
therefore for the disk-related part of the BIOS specification.) This
is thus now on its way to become an official protocol, so change the
implementation to match.
This still needs testing, and the Syslinux core needs to be adjusted
to leverage the extended information.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Shao Miller [Tue, 9 Mar 2010 23:33:35 +0000 (18:33 -0500)]
mdiskchk: Support three new features
MDISKCHK.COM now supports three new modes:
mdiskchk.com --mbfts
This mode will scan between free base memory and
0xA00000 looking for MEMDISK mBFTs. For each one
found, its detail will be reported.
mdiskchk.com --safe-hooks
This mode will attempt to walk the chain of INT 13h
"safe hooks". For each MEMDISK "safe hook" found,
its detail will be reported.
mdiskchk.com --batch-output
This mode suppresses the normal detail report and
instead outputs a list of DOS SET commands. This
is useful if one wishes to populate a batch file
and call that batch file to set DOS environment
variables, so that programs have access to those
MEMDISK kernel arguments passed at boot-time.
These command-line options may be combined.
For example, your AUTOEXEC.BAT might go:
@echo off
echo @echo off>setenv.bat
mdiskchk.com -m -s -b>>setenv.bat
call setenv.bat>nul
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 23:24:41 +0000 (18:24 -0500)]
memdisk: Force 32-bit mBFT "safe hook" pointer field
When mstructs.h is used by MDISKCHK.COM, pointers have
a 16-bit size and thus the mBFT structure sizeof() is
smaller under OpenWatcom. We now union this pointer
member with a uint32_t to force the field to at least
32 bits.
There is another pointer in this header file which is
already unioned with a uint32_t, due to that field's
dual-purpose. That field is fine under OpenWatcom.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 22:57:08 +0000 (17:57 -0500)]
memdisk: Move dpt_t into common structures header
This needs to be in here in order for the header file
to be useful to any C file other than setup.c.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 22:13:26 +0000 (17:13 -0500)]
memdisk: mBFT includes the MDI
Instead of padding the mBFT so its size is correct, we
actually put the MDI struct in there, since the last
commit provided it.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 21:54:17 +0000 (16:54 -0500)]
memdisk: Change patch area to include the entire MDI
Previously, the patch area began after the beginning of
the MDI, but continued past its end. This is difficult
to express with C structures, so we've simply changed
the patch area to include the entire MDI. So it now
includes the MDI size and MEMDISK version info, which
we simply make constant to avoid modifying.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 21:02:39 +0000 (16:02 -0500)]
memdisk: Use MEMDISK header to access "safe hook"
This commit moves the MEMDISK header structure into
the common structures header file.
It also adds the "safe hook" structure to the MEMDISK
header structure, since that matches what's in the hook
binaries. Thus, we access the "safe hook" via the
header pointer, instead of separately.
Tested against a DOS floppy image including an
experimental MDISKCHK.COM and also gainst WinVBlock.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 19:45:12 +0000 (14:45 -0500)]
memdisk: Use real_addr_t for SEG:OFF fields
We used uint32_t in a few places where it's also handy
to refer to those fields' segment and offset components.
Now we can do so via the real_addr_t union type.
Additionally, there are a couple of places where we now
have pointer fields instead of uint32_t fields, because
we know what kind of struct the field is pointing to.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Shao Miller [Tue, 9 Mar 2010 07:08:36 +0000 (02:08 -0500)]
memdisk: Move common structures into headers
Since MDISKCHK.COM (and possibly COM32 modules) could make use of
structures found in MEMDISK's setup.c, we move these into a new
header file mstructs.h.
Also, since the OpenWatcom compiler uses a structure packing prefix
and GCC uses a structure packing postfix, we accomodate this with
preprocessor definitions around those structures needing to be
packed.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
H. Peter Anvin [Thu, 10 Jun 2010 01:38:38 +0000 (18:38 -0700)]
syslinux: Correctly handle the case of installing into the root
When installing into the root directory, we should logically search
the root directory first. Thus, we need to make sure the current path
is "/" not "".
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>