summaryrefslogtreecommitdiff
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* core, diskio: skip EDD/CHS detect for CD-ROMsH. Peter Anvin2010-07-011-53/+59
| | | | | | | | Skip EDD and CHS detection if we know it is a CD-ROM, because some CD-ROMs possibly report bad information, and/or screw up the stack, possibly permanently. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, diskio: move dprintfs to the intended locationH. Peter Anvin2010-07-011-4/+6
| | | | | | Move the dprintfs to the location that they were intended to use. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, diskio: put the error code in dprintf and printable messagesH. Peter Anvin2010-07-011-2/+8
| | | | | | | When we print an error message to the screen, include the error number. Furthermore, dprintf it on retries. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* diskstart: don't let the function number clobber the LBAH. Peter Anvin2010-06-291-3/+7
| | | | | | | | | The LBA for getonesec and getlinsec is in EDX:EAX, but both DL and AX are function inputs to INT 13h (drive number and function number). We need to preserve the LBA across *both* those, otherwise retries will not function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* isolinux: don't clobber DX (DL!) on startupH. Peter Anvin2010-06-291-6/+6
| | | | | | DL contains the initial drive number, don't clobber it! Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* isolinux: make sure Hidden is zero in native El Torito modeH. Peter Anvin2010-06-291-10/+12
| | | | | | | | | | In native El Torito mode, there is no such thing as a partition offset. Make sure that we set Hidden to zero -- we don't use Hidden (yet, although the ebios and cdrom code should be merged!) but we pass it to the PM code, which will produce *really* wrong results... Reported-by: Helmut Hullen <Hullen@t-online.de> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, diskio: add a few dprintf()'sH. Peter Anvin2010-06-291-7/+22
| | | | | | | Add a handful of dprintf's to make it easier to debug disk I/O failures. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: hard-code CD-ROM sectors to 2048 bytesH. Peter Anvin2010-06-281-1/+12
| | | | | | | | | | At least the ThinkPad T22 and T23 will incorrectly report a sector size of 512 bytes for El Torito CD-ROMs. Ignore the reported sector size for El Torito boots. Reported-by: Helmut Hullen <hullen@t-online.de> Tested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, chdir: collapse slashes, avoid copy-to-selfsyslinux-4.00-pre64H. Peter Anvin2010-06-271-11/+48
| | | | | | | | | | | Collapse multiple slashes into one (this still doesn't resolve . and .. in the path, since that requires awareness of symlinks.) This code also avoids a copy-over-self bug by introducing a temporary buffer. Reported-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Export the 64-bit partition offset and use it in chain.cH. Peter Anvin2010-06-272-8/+10
| | | | | | | | | | | | | When used with the "fs" option to chain.c32, we need to know our own filesystem offset. That means knowing if we used the MBR vs GPT partition information, as well as if we ended up using the passed-in information or not. Resolve this by providing an explicit pointer to the current partition offset. Eventually this should be replaced by some kind of statfs() call. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* diskstart: if no partition info is available, use bsHiddensyslinux-4.00-pre63H. Peter Anvin2010-06-261-2/+7
| | | | | | | | | | | | If we have no partition information available, use the bsHidden field (which is set by the extlinux installer in the case of non-FAT). This gives at least a hope of working correctly (for < 2 TiB disks, at least) with the stock Vista/Win7 MBR. Also, add a check for partition type != 0. This helps catch the case when DS:SI points into all-zero memory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* PM getcwd(); Fix COM32 getcwdGene Cumm2010-06-263-0/+17
| | | | | | | | | Implement getcwd() in the core; Fix COM32 getcwd() to use the new function. This resolves the previous comment about COM32 getcwd() not working by not using INT 22h AX=001Fh. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: move PartInfo back to the top of stackH. Peter Anvin2010-06-261-9/+8
| | | | | | | | Move PartInfo back to near the top of the stack. This makes it less likely that it ends up getting overwritten during the act of copying itself. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* syslinux.ld: remove redundant definition of STACK32_LENH. Peter Anvin2010-06-261-2/+0
| | | | | | STACK32_LEN is already defined in layout.inc. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, fs: eliminate recursion in put_inode()H. Peter Anvin2010-06-261-5/+4
| | | | | | | We don't actually need recursion in put_inode(), so replace recursion with a loop. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix COM32 chdir()Gene Cumm2010-06-261-0/+2
| | | | | | | | Fix COM32 chdir() since it's implemented in the core. Forgot the core changes needed for this before. Signed-off-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pmapi: make the pmapi vector include its own sizeH. Peter Anvin2010-06-261-0/+2
| | | | | | Future-proof the pmapi vector by making it include its own size. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, fs: handle .. resolution in the filesystem coreH. Peter Anvin2010-06-252-14/+33
| | | | | | | | | | | Some filesystems, including btrfs, don't have .. directory entries. We already handle . in the filesystem core, handle .. as well. This means keeping chains of parent inodes for all open inodes, at least for the duration of a path search; we might as well hang onto them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* btrfs: initialize the block cache earlyH. Peter Anvin2010-06-251-44/+5
| | | | | | | | Initialize the block cache at the very start. The block size for btrfs is fixed, and so we can start by initializing the cache. That eliminates a whole bunch of unnecessary I/O as well as extra code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* btrfs: do not read past the end of the diskH. Peter Anvin2010-06-251-0/+8
| | | | | | | | When looking for the current superblock, don't read past the end of the disk. This more or less assumes that the superblocks are reasonably consistent with regards to the total filesystem size. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, diskio: make error messages a little more usefulH. Peter Anvin2010-06-251-1/+7
| | | | | | Be a bit more explicit about the particular errors we see. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: don't corrupt the length of an RRQ packet on retryH. Peter Anvin2010-06-251-1/+4
| | | | | | | | | | Due to double use of the variable "buf", we would end up corrupting the length, but not the contents, of an RRQ packet if we ended up having to re-send. Some TFTP servers ignored the extra garbage (including tftp-hpa), others would refuse to accept the RRQ, causing failures. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe: fix the unload sequenceH. Peter Anvin2010-06-242-16/+24
| | | | | | | | For somewhat unclear reasons, the PXE unload sequence took the old PXE path (pre-2.00 API). Take the new sequence if available. Also improve the error message. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: fix ip_ok()H. Peter Anvin2010-06-242-8/+10
| | | | | | | Make it easier to read, but fix the address for the loopback network (127, not 255). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: enforce filetypes in open_fileH. Peter Anvin2010-06-231-5/+13
| | | | | | Enforce that the file type in open_file is a plain file. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* opendir: enforce the file typeH. Peter Anvin2010-06-231-2/+9
| | | | | | Don't allow opendir() on a non-directory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: set the file type in the inode structureH. Peter Anvin2010-06-231-0/+1
| | | | | | | 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>
* pxe: fix the timeout logic for RRQsyslinux-4.00-pre57H. Peter Anvin2010-06-221-28/+22
| | | | | | | 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>
* pxe: fix bugs in DHCP parsing and config file selectionH. Peter Anvin2010-06-222-60/+57
| | | | | | | Fix several buffer-handling bugs in DHCP parsing and in the config file selection. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe: correct the generation of the UUID stringH. Peter Anvin2010-06-221-5/+5
| | | | | | | The UUID string was generated incorrectly, starting over for each component. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskstart: if no partition table, we need Hidden == 0syslinux-4.00-pre56H. Peter Anvin2010-06-221-5/+11
| | | | | | | 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>
* core: Make cfarcall IF-preservingH. Peter Anvin2010-06-211-2/+9
| | | | | | | 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>
* comboot: allow the read disk API call to specify a 64-bit LBAH. Peter Anvin2010-06-211-2/+2
| | | | | | | 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>
* core, adv: for CHS mode, the top 40 LBA bits must be zeroH. Peter Anvin2010-06-211-0/+4
| | | | | | | | | 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>
* pxelinux: use alignb not alignz in a bss sectionsH. Peter Anvin2010-06-211-1/+1
| | | | | | In .bss sections use alignb, not alignz. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskstart: fix CHS mode, reinstate cyl 1023 checksyslinux-4.00-pre55H. Peter Anvin2010-06-211-12/+11
| | | | | | | 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>
* diskstart: clean up GPT handlingH. Peter Anvin2010-06-211-9/+11
| | | | | | | 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>
* dns: don't get stuck on no packet receivedsyslinux-4.00-pre54H. Peter Anvin2010-06-211-10/+5
| | | | | | | | | 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>
* core: Preserve IF through call16()H. Peter Anvin2010-06-212-3/+17
| | | | | | | | | | 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>
* pxe: fix handling of lost packets in DNS resolutionH. Peter Anvin2010-06-212-78/+75
| | | | | | | | 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>
* pxe: properly null-terminate packet after tftp://H. Peter Anvin2010-06-211-1/+2
| | | | | | Properly null-terminate the output from a parsed tftp:// URL. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: correct the parsing of tftp:// URLsH. Peter Anvin2010-06-201-2/+2
| | | | | | | Correct the parsing of tftp:// URLs. DNS handling still needs to be unbroken. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: don't misidentify non-tftp URLs as tftpH. Peter Anvin2010-06-201-1/+1
| | | | | | Fix reversed test for tftp URLs Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: align the EPAsyslinux-4.00-pre53pathbasedH. Peter Anvin2010-06-201-0/+1
| | | | | | Align the Extended Patch Area. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge syslinux/extlinux patch code and core codeH. Peter Anvin2010-06-203-45/+4
| | | | | | | | 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>
* Reduce sector 1 space pressure; further merge installer codesyslinux-4.00-pre52H. Peter Anvin2010-06-201-12/+24
| | | | | | | | | | 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>
* pxe: mark ipinfo as IPv4H. Peter Anvin2010-06-181-0/+2
| | | | | | IP information is IPv4 for now. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, pxe: remove stray debugging printfH. Peter Anvin2010-06-181-1/+0
| | | | | | Remove debugging printf added for testing. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe: centralize all the IP information and export it to modulesH. Peter Anvin2010-06-187-43/+65
| | | | | | | | | 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>
* Switch to 64-bit sector pointers everywhereH. Peter Anvin2010-06-152-56/+44
| | | | | | | | | | | | 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>