summaryrefslogtreecommitdiff
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* isolinux: Update LBA in getlinsec loopMatt Fleming2013-01-141-0/+3
| | | | | | | | | | | | | | | | | We need to increment the Logical Block Address in eax by the number of sectors we passed to getlinsec after every invocation, otherwise we'll start with the same sector everytime. This bug was discovered when booting an isohybrid image, which failed to boot after printing the following error, "Image checksum error, sorry..." because the isolinux.bin was bigger than 32K, and thus invoked the getlinsec loop that reads the file in chunks. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* fs: Fix searchdir resource leakShao Miller2012-11-291-108/+155
| | | | | | | | | | This is a significant rewrite of the generic lookup logic inside core/fs/fs.c's searchdir function. Previously, there was a memory leak if a path involved multiple directories. After a sufficiently large number of invocations, this could be observed. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Shao Miller <sha0.miller@gmail.com>
* comboot: remove comapi_chainbootsyslinux-4.06-pre14Sebastian Herbszt2012-10-151-14/+1
| | | | | | | comapi_chainboot was obsoleted in 3.80. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ext2: add additional check to ext2 loaderFrediano Ziglio2012-10-101-0/+3
| | | | | | | | Check if a pointer is NULL due to specifying an invalid inode group number. Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Correct initialization of the cache doubly-linked listsyslinux-4.06-pre11H. Peter Anvin2012-07-191-2/+2
| | | | | | | | | | | | | | | The initialization of the cache doubly-linked list had head->next->prev instead of head->prev->next; this entry is supposed to initialize the ->next entry of the last entry in the list (which points back to the head node.) For clarity, consistently use "head" to refer to the head node; the mixing of "head" and "dev->cache_head" needlessly obfuscated the code. The wild pointer reference caused crashes on some systems. Reported-by: Jan Safrata <jsafrata@centrum.cz> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fat: Make mangle behavior similar to the standard oneH. Peter Anvin2012-06-291-16/+19
| | | | | | | Handle mangle in FAT the same as in the generic version, except for \ -> / conversion. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Actually keep track of the pathnames for all elementssyslinux-4.06-pre9H. Peter Anvin2012-06-284-81/+80
| | | | | | | | Actually keep track of the pathnames for all elements for on-disk filesystems. This makes sure we can always reconstruct the correct path. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* chdir: collapse /./ and /../ in path for conventional filesystemssyslinux-4.06-pre8H. Peter Anvin2012-06-281-6/+50
| | | | | | | For conventional filesystems (i.e. not PXE), collapse /./ and /../ in the path when doing chdir. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* btrfs: Fix booting off a btrfs subvolume.Alexander E. Patrakov2012-06-041-1/+4
| | | | | | | | | | | | | | | | The subvolume name in path.data is not NUL-terminated, so don't use strcmp on it. Before this patch, it would accumulate the following (given subvolumes with names "ext2_saved", "home", "gentoo" and "boot"): ext2_saved home_saved gentooaved bootooaved Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core: add support for .init/fini_tableH. Peter Anvin2012-05-281-4/+5
| | | | | | | We don't actually have any constructors/destructors in the core at this time, but handle .init/fini_table in case that happens... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* ntfs: check for index entry which has INDEX_ENTRY_END flag setPaulo Alcantara2012-02-112-2/+10
| | | | | | | | In ntfs_readdir(), if one entry has INDEX_ENTRY_END flag set, it won't contain indexed_file member, that'd be used afterwards when looking for the MFT record that is associated with that index entry. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: remove wrong checksPaulo Alcantara2012-02-111-48/+24
| | | | | | | As an attribute may be stored in a NTFS record rather than the current record being used, these checks wouldn't work anymore for this case. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: keep looking for attributes with the latest found MFT recordPaulo Alcantara2012-02-111-19/+47
| | | | | | | | | | Once ntfs_attr_lookup() is called, it may change the MFT record passed as parameter so that the next calls that need the latest found MFT record don't have it anymore. So the __ntfs_attr_lookup() variant will provide support to the ntfs_attr_lookup() function handling both old and new MFT records. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: MFT record may be changed when invoking ntfs_attr_lookup()Paulo Alcantara2012-02-111-16/+20
| | | | | | | | | After invoking ntfs_attr_lookup(), the attribute type that we're looking for may be allocated in a other MFT record, so the parameter which gets the current MFT record can be changed once to point to the other MFT record that actually contains the wanted attribute type. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: add missing field in ntfs_attr_list_entry structurePaulo Alcantara2012-02-112-6/+15
| | | | | | | | | This missing field just messed up when reading the ntfs_attr_list_entry's fields to be used in any case. Also add a check to avoid reading the same MFT record which contains the attribute list and also the wanted attribute type. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: print function names on debug modePaulo Alcantara2012-02-111-0/+30
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: handle offsets when walking through attribute list's entriesPaulo Alcantara2012-02-112-17/+21
| | | | | | | | Instead of either hanging out or printing a fatal message on the screen when not finding attributes from attribute list's entries, handle offsets that will determine if we reached end of a attribute list. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: handle MFT records that contain $ATTRIBUTE_LIST attributePaulo Alcantara2012-02-112-33/+185
| | | | | | | | | | | | | | | | | | MFT records that contain $ATTRIBUTE_LIST attributes, for example, are those that there are many hards links, or the file itself is very fragmented, and so on. So when attributes of a MFT record that don't fit in a MFT record, those will be stored in one or more MFT records and can be found through the attribute list's entries of the MFT record being acessed, which are in the $ATTRIBUTE_LIST attribute. ntfs_attr_list_lookup() function will be called once we didn't find the attribute within the MFT record itself so that the attribute will presumably be stored in another MFT record, according to the information that has been retrieved from the attribute list's entry. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ldlinux: workaround for avoiding EDD error on btrfs probePaulo Alcantara2012-02-111-2/+2
| | | | | | | | | | | When installing Syslinux in an NTFS volume and then booting it up, Syslinux will print on the screen an EDD error ocurred on btrfs probing because that volume is not actually a btrfs one. Thus, to work around that issue add ntfs_fs_ops structure just before the btrfs_fs_ops so that fs_init() function will execute the ntfs_fs_ops->fs_init() function first, and on success, btrfs_fs_ops->fs_init() won't be executed either. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix POSIX vs Win32 filename comparesPaulo Alcantara2012-02-111-10/+0
| | | | | | | | | | | | | | When using the COMBOOT32 module "ls" for listining directory entries on an NTFS volume, for e.g. directories as "/Foobar" (a Win32 filename) could be only listed as "ls.c32 /foobar" and neither "ls.c32 "/Foobar" nor "ls.c32 /FOOBAR". POSIX filenames must be handled in a case-sensitivity way, while Win32 filenames are handled in a non-case-sensitivity way. Note also that the POSIX/Win32 filename compare is done in the ntfs_filename_cmp() function. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix license headersPaulo Alcantara2012-02-113-3/+3
| | | | | | Add missing year information in the license headers. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* bootsect.inc: try to catch obvious .0 problemsH. Peter Anvin2012-02-061-1/+15
| | | | | | | | A typical Linux kernel will be way, way too big for the low memory bootstrap area, so throw an error message if we end up in the bootstrap path with something that cannot possibly fit below 640K. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* ntfs: keep a state structure for ntfs_readdir() callersPaulo Alcantara2011-09-202-21/+45
| | | | | | | | | Latetly, we kept a state information within the inode structure, that was actually a mistake. Now, a ntfs_readdir_state structure is allocated to keep a state that'll help on listing directory entries from sucessive ntfs_readdir() calls. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: cleanupsPaulo Alcantara2011-09-153-240/+116
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: Check for disk read error during FS probingShao Miller2011-09-111-1/+4
| | | | | | | | | If reading the NTFS BIOS parameter block fails for any reason, we will not attempt to continue to work towards finding an NTFS filesystem on the disk/partition. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: Deal with NTFS versions for MFT record lookupsShao Miller2011-09-112-13/+139
| | | | | | | | | | | | | The MFT record lookup strategies are different for NTFS versions 3.0 and 3.1, so we use a function pointer for the appropriate function. We start off using 3.0 by default, then use that to read the $Volume meta-file and find out the actual version. Then we adjust the function pointer, as needed. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: use a runlist for handling multiple data runsPaulo Alcantara2011-09-113-23/+128
| | | | | | | | NTFS files can contain multiple data runs, so use a runlist for handling multiple data runs of a single file, and also modify ntfs_next_extent() in order to support this new feature. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: don't start lookup from the same block in ntfs_mft_record_lookup()Paulo Alcantara2011-09-111-5/+9
| | | | | | | | | ntfs_mft_record_lookup() always started its lookup from the same block, which was though a mistake. So the lookup became very slow. Now determine its starting block number from the calculated MFT record's LCN number. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix ntfs_read()Paulo Alcantara2011-09-111-3/+4
| | | | | | lbytes variable wasn't set correctly. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: and more fixes...Paulo Alcantara2011-09-112-45/+39
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix VCN calculation and the ntfs_readdir() functionPaulo Alcantara2011-09-112-21/+59
| | | | | | Now I'd recommend to test it :-) Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: more bugfixesPaulo Alcantara2011-09-112-137/+231
| | | | | | Need more tests, hence I don't recommend to rely on it right now. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix ntfs_fs_init()Paulo Alcantara2011-09-111-13/+19
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: I think ntfs_readdir() is now fixedPaulo Alcantara2011-09-112-51/+77
| | | | | | gerth and sha0, you need to test it! :-) Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix ntfs_readdir()Paulo Alcantara2011-09-112-80/+166
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: mapping_chunk's length field must not be an uint8_t typePaulo Alcantara2011-09-111-2/+2
| | | | | | Also change the other length field accordingly. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: better way to check whether a MFT record is file or directoryPaulo Alcantara2011-09-112-40/+7
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: and more speed improvementsPaulo Alcantara2011-09-112-81/+63
| | | | | | gerth, you HAVE to test it! :-) Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix ntfs_match_longname() and make index_lookup() fasterPaulo Alcantara2011-09-111-82/+49
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: make index_inode_setup() fasterPaulo Alcantara2011-09-111-16/+16
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: make ntfs_match_longname() fasterPaulo Alcantara2011-09-111-30/+5
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: more cleanupsPaulo Alcantara2011-09-111-21/+21
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: cleanupsPaulo Alcantara2011-09-112-56/+5
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: fix bug in parse_data_run()Paulo Alcantara2011-09-112-107/+79
| | | | | | | | | | parse_data_run() used to get the wrong value of VCNs starting at LCN, so it was only getting the value 1 and the NTFS driver didn't look at the other VCNs. Now, everything seems to work, except the readdir() function :-P Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: it's working, partially... :-/Paulo Alcantara2011-09-111-120/+132
| | | | | | | My tests were: menu.c32 (worked), cat.32 (worked, ls.c32 (not worked). Looks like we have a bug in ntfs_readdir(). It will check it out later. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: continue on its implementationPaulo Alcantara2011-09-112-111/+190
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: heh :-)Paulo Alcantara2011-09-072-94/+98
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: set block shift and size to their correct valuesPaulo Alcantara2011-09-071-15/+13
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: implement fixups_realloc()Paulo Alcantara2011-09-071-25/+32
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
* ntfs: implement ntfs_next_extent() and ntfs_getfssec()Paulo Alcantara2011-09-071-5/+116
| | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>