| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Replace enum inode_mode with the equivalent enum dirent_type.
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
- 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 API calls for open file and close file.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
(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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Remove the now-obsolete unmangle_name method.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
It looks like some versions of gcc might have issues with "const
volatile".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Add a direct 32-bit API to some functions; initially read file only.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
- 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>
|
| |
|
|
|
|
| |
Put all handling of symbolic links into the central pathname walker.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |\
| |
| |
| |
| |
| |
| | |
Resolved Conflicts:
core/fs/ext2/ext2.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| | |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| | |
Another () -> (void)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |/
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| |
| |
| |
| | |
Resolved Conflicts:
core/fs.c
core/fs/ext2/ext2.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| | |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| | |
Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| | |
| |
| |
| |
| |
| | |
And also simplified the ext2_sb_info structure.
Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
Port the PXE idle function to C; make the idle hook a protected-mode
call.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
And also converts some asm-variables to c-variables.
Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
|