summaryrefslogtreecommitdiff
path: root/core/include
Commit message (Collapse)AuthorAgeFilesLines
* PM getcwd(); Fix COM32 getcwdGene Cumm2010-06-261-0/+3
| | | | | | | | | 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, fs: handle .. resolution in the filesystem coreH. Peter Anvin2010-06-251-5/+3
| | | | | | | | | | | 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>
* diskio: make maxtransfer per-device, cap to 127, imported from headsyslinux-4.00-pre43H. Peter Anvin2010-05-121-2/+4
| | | | | | | | | | Make the maxtransfer per device, as it should be; properly imported from the head loader (in case it is patched with -s). Also enforce capping to 127 for EBIOS and 63 for CBIOS. This is structured so that once EDD4 is approved we can remove the capping for that particular subcase. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: move idle handling into protected modeH. Peter Anvin2010-03-301-3/+5
| | | | | | | | Do the actual idling in protected mode. This both allows PM code a more efficient interface, but also handles bugs in HVM implementations which don't handle HLT in real mode. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* fs: get rid of enum inode_modeH. Peter Anvin2010-03-091-13/+0
| | | | Replace enum inode_mode with the equivalent enum dirent_type.
* core: don't bother zeroing the disk cache and heapH. Peter Anvin2010-03-061-2/+7
| | | | | | | No point in zeroing out the disk cache and the heap. Put those in a .hugebss section which we align, but don't zero. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: use an inode structure for pxesyslinux-4.00-pre36H. Peter Anvin2010-03-061-16/+2
| | | | | | | | Use an inode structure for PXE as well. Even though this is really rather superfluous in the case of PXE, it eliminates an ugly special case in the generic code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core/fs: clean up, fix and improve the internal readdir() interfacesH. Peter Anvin2010-03-061-2/+13
| | | | | | | | | - Avoid a completely unnecessary malloc/free pair by passing a pointer to the filesystem driver; - Make sure d_reclen is always set correctly; - Make sure the d_type field is set correctly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add 32-bit versions of open file/close fileH. Peter Anvin2010-03-061-0/+4
| | | | | | Add 32-bit API calls for open file and close file. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* readdir: replace opendir/readdir/closedir API with a 32-bit APIH. Peter Anvin2010-03-041-0/+6
| | | | | | | | The 16-bit API to opendir/readdir/closedir was confused, had a memory leak, and was incompatible with Syslinux 3.x anyway. Replace it with a pure 32-bit API. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add simplified toupper, tolower, str[n]casecmp to coreH. Peter Anvin2010-03-011-0/+25
| | | | | | | | | | (Missing from previous checkin) Add simplified toupper(), tolower() and str[n]casecmp() implementations to the core, good enough for ASCII e.g. for use in URL parsing, or in config file decoding. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: add no_next_extent() dummy functionH. Peter Anvin2010-02-281-0/+3
| | | | | | | | Add a no_next_extent() dummy function for filesystems (like iso9660) which should never end up calling next_extent (because there is only one extent...) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: fs: get rid of the prev_extent memberH. Peter Anvin2010-02-281-2/+2
| | | | | | | | The prev_extent member was only ever used transiently; instead pass the new lstart in as an argument and leave the previous value of next_extent unmolested and thus can be used in-place. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: get rid of unmangle_name completelysyslinux-4.00-pre31H. Peter Anvin2010-02-282-3/+0
| | | | | | | | | | | | The notion of "mangle name" is now restricted to producing a canonical representation, e.g. changing \ -> / for FAT filesystems. However, the resulting mangled name is now always human-readable, so there never is any reason to unmangle a name. Get rid of not just the mangling, but of the resulting unmangled-name buffers and so on. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: remove unmangle_nameH. Peter Anvin2010-02-281-2/+0
| | | | | | Remove the now-obsolete unmangle_name method. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: don't use "const volatile" in __jiffies definitionH. Peter Anvin2010-02-281-1/+1
| | | | | | | It looks like some versions of gcc might have issues with "const volatile". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fat: use generic_getfssec(), fix generic_getfssec(), add dprintfH. Peter Anvin2010-02-261-1/+1
| | | | | | | | | | | | | Use generic_getfssec() for the FAT filesystem. Do a bunch of calculations based on clusters rather than on sectors, so we don't have to do the same thing N times for N sectors per cluster. Fix boundary conditions in generic_getfssec(). Adjust iso9660 to match the resulting interface change. Add dprintf's to generic_getfssec() and a few other routines. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: add generic getfssecH. Peter Anvin2010-02-261-2/+25
| | | | | | | | Add a generic getfssec method which operate on cached extents. This should avoid the need to each filesystem to implement its own getfssec loop. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: fix double free of pathbuf, constify iget filename, fix iso9660H. Peter Anvin2010-02-241-1/+1
| | | | | | | | | | Fix double free of pathbuf in searchdir(). Constify the pathname passed to ->iget(). Major cleanups of the iso9660 filesystem; it would use insufficiently dimensioned stack variables and do compares in a rather inefficient manner. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: use better malloc; add low memory malloc; fix com32 exitH. Peter Anvin2010-02-231-1/+3
| | | | | | | | | | | | | Use a better malloc for the core. In particular, use the same core that we should eventually be able to use for the entire system in Syslinux 5 -- with module awareness, etc. This code can also accommodate multiple heaps. Set up a separate heap for lowmem; the intent is to use explicit lowmem allocations instead of the static bounce buffer. The lowmem allocation is also exported via the pmapi mechanism, so modules can safely allocate lowmem. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: add a direct 32-bit APIH. Peter Anvin2010-02-233-0/+10
| | | | | | Add a direct 32-bit API to some functions; initially read file only. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* cache: fix _get_cache_block() return, add lock_cache_block()H. Peter Anvin2010-02-161-0/+1
| | | | | | | Correct the return value from _get_cache_block(), and add a method for locking a block permanently in the cache. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* cache: update the metadata cache designH. Peter Anvin2010-02-162-12/+11
| | | | | | | | | | - instead of get_cache_block() returning a descriptor, have get_cache() returning const void *. - have a subfunction to allow getting a block without reading it from disk, and returning the cache descriptor. This will be used in ext2 to pre-seed block 0 with all zero. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: centralize symlink handlingH. Peter Anvin2010-02-151-1/+1
| | | | | | Put all handling of symbolic links into the central pathname walker. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: reference-count inodes, fix generic loadconfigH. Peter Anvin2010-02-151-1/+16
| | | | | | | | | Reference-count inodes, so we don't leak them all over the place. This also lets us hold onto the root inode from the very beginning. Make the generic loadconfig work again. Significant cleanups to the ext2 filesystem core. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* config: allow a chdir at the time a new configuration file is loadedH. Peter Anvin2010-02-142-1/+7
| | | | | | | | If a directory name/path prefix is appended to a loaded configuration file, do a chdir at that point. We finally have all the mechanism to do this right. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: move to a chdir()-based mechanism for managing cwdsyslinux-4.00-pre19H. Peter Anvin2010-02-131-14/+39
| | | | | | | | | | | | Introduce a chdir() system and a way to obtain absolute pathnames. This should allow us to set the current base directory (filename prefix for PXE) without breaking access to the configuration file. As a side benefit, for the "normal" filesystems we no longer need magic hacks to figure out where we should set our current working directory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: fix cwd setting for FAT/iso9660/extfssyslinux-4.00-pre18H. Peter Anvin2010-02-101-9/+2
| | | | | | | | | | | | Fix the cwd setting for FAT, iso9660 and ext*fs. In particular: When FS_THISIND is set in the filesystem flags, only memoize the parent directory iff we are currently doing a config file walk. Use this feature for ext*fs as well, this makes the pathbased branch fully featured. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'fsc' into pathbasedH. Peter Anvin2010-02-104-17/+45
|\ | | | | | | | | | | | | Resolved Conflicts: core/fs/ext2/ext2.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * codepage: add a lower-case tableH. Peter Anvin2010-02-041-1/+2
| | | | | | | | | | | | | | Add a lower-case table; necessary for readdir on FAT in the presence of WinNT case flags. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * FAT: cache file position, re-enable codepagesH. Peter Anvin2010-02-041-0/+26
| | | | | | | | | | | | | | | | | | | | | | Cache the position of the file rather than seeking through the FAT from the beginning every time. Re-enable the handling of codepages. This is not yet fully complete: when using WinNT case flags, we need an upper->lower case table as well. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * core/fs: abstract filesystem, use cache for ext2 group descriptorsH. Peter Anvin2010-01-252-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abstract out the filesystem, remove all references to "this_fs" in the main filesystem drivers. There is still some in the core (dir.c, fs.c) which eventually need to be replaced by a properly defined device marker and root. The inode structure now contains a reference to its parent filesystem. The inode structure can now contain additional data at the end of the structure, this is used for filesystem private data. TODO: move the filesystem private data into proper structures. Finally, use the block cache for ext2 block group descriptors. Trying to allocate them all at filesystem mount time doesn't work for large filesystems. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * core/fs: make it more explicit sector size is per filesystemH. Peter Anvin2010-01-252-7/+6
| | | | | | | | | | | | | | | | Sector size is per device, and can vary between filesystems. In particular, it is time to be getting rid of assumptions of 512-byte sectors whereever possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * fs.h: fix prototypeH. Peter Anvin2010-01-251-1/+1
| | | | | | | | | | | | Another () -> (void) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | pathbased:btrfs: initial subvol supportAlek Du2010-01-131-0/+1
|/ | | | | | Added "Subvol" name in the extlinux.sys, and then btrfs fs code will handle the subvol correctly. Also fixed the bug where CurrentDirName and SubvolName should not exist in the first sector.
* Merge commit 'liu/master' into fscH. Peter Anvin2009-12-283-11/+84
|\ | | | | | | | | | | | | | | Resolved Conflicts: core/fs.c core/fs/ext2/ext2.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * vfs: add the readdir stuff supportLiu Aleaxander2009-12-151-1/+0
| | | | | | | | | | | | | | For now, the EXT, VFAT and ISO fs support readdir lib. So, the dir.c32 module can do the right work. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * core: some cleanupsLiu Aleaxander2009-12-142-4/+1
| | | | | | | | | | | | | | The blksize filed in inode structure removed, since we can simply get it by BLOCK_SIZE(fs) macro. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * ISOLINUX: applying the generic path-lookup to iso9660 fsLiu Aleaxander2009-12-141-0/+4
| | | | | | | | Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * LDLINUX:vfat: Improve the fat fs relative path searchingLiu Aleaxander2009-12-101-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Added a new flag, FS_THISIND, used in the fat and iso fs relative path searching. It means tries to get the last directory of the config file path in the 'this_inode' variable to do a relative searching while loading the kernel images in after. And also fixed a bug in fs.c which wouldn't close the file structure when doing path searching failed! And as a result, we could just run a few com32 programs. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * FS: add a new fs flag and do a better searchdir-checkLiu Aleaxander2009-11-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | If we want use the malloc/free functions, set the FS_USEMEM flag in the (fs)_ops.flags, and in the fs_init phase, it will init the memory management system. And it would be little better to do a check base on if we have searchdir method or not instead of the fs name in the searchdir function. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * EXTLINUX: simplify the ext2_fs_init functionLiu Aleaxander2009-11-201-2/+2
| | | | | | | | | | | | And also simplified the ext2_sb_info structure. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * core:fs: Use a much better union structure in file structureLiu Aleaxander2009-11-201-7/+12
| | | | | | | | | | | | | | | | | | Remove the u1 and u2 union, and merge the related fileds as a group, and then make a big union. Then we don't need to use u1 or u2 to reference these fileds any more but use it directly just like there are no union structures here:) Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
| * Added a generic path_lookup method in vfsYuanhan Liu2009-10-252-8/+67
|/ | | | | | | | | | | | | Well, for now, just applied to EXTLINUX. Here is the main change: 1) Add to union structure in file to make the older path_lookup method work. 2) Add a generic inode structure, to represent one file. 3) Add three more methods in fs_ops; they are: iget_root, get the root inode of a fs iget_current, get the 'pwd' iget, do_open a file 4) Add a *TEMP* memory managemant system. Signed-off-by: Yuanhan Liu <Aleaxander@gmail.com>
* core: hook INT 1Ch for a simple monotonic timerH. Peter Anvin2009-09-021-0/+8
| | | | | | | | | | The BIOS_timer variable at 4C6h is somewhat unreliable... it is documented to wrap at "midnight", norminally after 1627419 ticks (0x18d51b), which is a rather awkward number to deal with modulo. Instead, hook the INT 1Ch secondary timer interrupt and just count a simple incrementing variable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: pxe: port the PXE idle function to CH. Peter Anvin2009-09-011-1/+3
| | | | | | | Port the PXE idle function to C; make the idle hook a protected-mode call. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Core: get rid of passing com32sys_t structure as parameter in PModeLiu Aleaxander2009-08-312-2/+2
| | | | | | | Well, this molstly be about xxx_load_config function, with function type changed. The new load_config function will return 1 if failed, or 0 if successed. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
* Core:pxelinux: code cleanLiu Aleaxander2009-08-301-46/+0
| | | | | | | | Two main things: 1. Redeclare the varibales that are't needed by any asm files in C file. 2. Move the extern statements of PXELINUX into pxe.h, instead of in core.h Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
* Core:pxelinux: unload_pxe converted.Liu Aleaxander2009-08-301-0/+2
| | | | | | I found it's also better to convert the unload_pxe, but I am not sure I'm right. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
* Core:pxelinux: code clean--removes the unused variables in ASM fileLiu Aleaxander2009-08-301-3/+1
| | | | | | And also converts some asm-variables to c-variables. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>