Mailing List Archive

[Patch]: Drive/Partition and extensible filesystem support for syslinux
Here is the patch for making syslinux enable opening partitions with
fat filesystems (well, the architecture is in place to make it open
other filesystems too).

Usage is like this:

#include <syslinux/io.h>
#include <syslinux/partitions.h>
#include <fs/fat/libfat.h>

syslinux_devdesc dfd;
struct libfat_filesystem* fs;
diskinfo disk_info;
char mbr[512];
static part_entry *partition;
int fd;

syslinux_get_disk_params(drive, &disk_info); // specify your drive number
syslinux_read_disk(&disk_info, mbr, 0, 1); // Read mbr
partition = PARTITION_ENTRY(mbr, 2); // 2 for partition 2

// this is the disk device/partition descriptor
dfd.disk_info = &disk_info;
dfd.partition = partition;

// try opening libfat partition on the given partition descriptor
fs = libfat_open(syslinux_fs_partition_read_handle, (intptr_t) &dfd);
fd = fs->ops.open(fs, "MYFILE CFG", O_RDONLY);
// This will give you a open descriptor

// Now on, you can read files just like any other *nix file...! :)
read(fd, mybuf, 128); // read 128 bytes from file..

OR

you can use zlib funtionality of syslinux with:

gzFile gzf = gzdopen(fd, "r");
gzread(gzf, mybuffer, 128);
etc...

//After you are done, you can close the descriptor with
close(fd);

// FS can be closed with
libfat_close(fs);



One thing which is missing is the way you specify file names for open.
It is the short name format of DOS. Would appreciate if someone can
add long file name search for libfat.

thanks.

--
Ram
Re: [Patch]: Drive/Partition and extensible filesystem support for syslinux [ In reply to ]
Forgot two things:

1) the patch file's extension is missing
2) The diffs are made against the following tarball:
http://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/syslinux-3.50-pre5.tar.bz2

I'm attaching the same patch file with a .patch extension.

--
Ram

On 4/18/07, Ram Yalamanchili <ramyinc@gmail.com> wrote:
> Here is the patch for making syslinux enable opening partitions with
> fat filesystems (well, the architecture is in place to make it open
> other filesystems too).
>
> Usage is like this:
>
> #include <syslinux/io.h>
> #include <syslinux/partitions.h>
> #include <fs/fat/libfat.h>
>
> syslinux_devdesc dfd;
> struct libfat_filesystem* fs;
> diskinfo disk_info;
> char mbr[512];
> static part_entry *partition;
> int fd;
>
> syslinux_get_disk_params(drive, &disk_info); // specify your drive number
> syslinux_read_disk(&disk_info, mbr, 0, 1); // Read mbr
> partition = PARTITION_ENTRY(mbr, 2); // 2 for partition 2
>
> // this is the disk device/partition descriptor
> dfd.disk_info = &disk_info;
> dfd.partition = partition;
>
> // try opening libfat partition on the given partition descriptor
> fs = libfat_open(syslinux_fs_partition_read_handle, (intptr_t) &dfd);
> fd = fs->ops.open(fs, "MYFILE CFG", O_RDONLY);
> // This will give you a open descriptor
>
> // Now on, you can read files just like any other *nix file...! :)
> read(fd, mybuf, 128); // read 128 bytes from file..
>
> OR
>
> you can use zlib funtionality of syslinux with:
>
> gzFile gzf = gzdopen(fd, "r");
> gzread(gzf, mybuffer, 128);
> etc...
>
> //After you are done, you can close the descriptor with
> close(fd);
>
> // FS can be closed with
> libfat_close(fs);
>
>
>
> One thing which is missing is the way you specify file names for open.
> It is the short name format of DOS. Would appreciate if someone can
> add long file name search for libfat.
>
> thanks.
>
> --
> Ram
>
>
Re: [Patch]: Drive/Partition and extensible filesystem support for syslinux [ In reply to ]
Ram Yalamanchili wrote:
> Here is the patch for making syslinux enable opening partitions with
> fat filesystems (well, the architecture is in place to make it open
> other filesystems too).

Thanks, this is great. I have just been put onto another task for a
while but I got as far as opening a file on the hdd from a syslinux
booted on a floppy partition which should be most of the battle. I hope
to be able to let you know if it works for me when I get back to it later.

Andrew

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: [Patch]: Drive/Partition and extensible filesystem support for syslinux [ In reply to ]
I found a few bugs and also had a chance to optimize the data path.
Booting from USB, i'm able to load my multiboot kernels and modules
almost 4x-6x faster than what syslinux does now. I'll resend the patch
later today.

--
Ram

On 4/19/07, Andrew Goodbody <agoodbody@itronix.co.uk> wrote:
> Ram Yalamanchili wrote:
> > Here is the patch for making syslinux enable opening partitions with
> > fat filesystems (well, the architecture is in place to make it open
> > other filesystems too).
>
> Thanks, this is great. I have just been put onto another task for a
> while but I got as far as opening a file on the hdd from a syslinux
> booted on a floppy partition which should be most of the battle. I hope
> to be able to let you know if it works for me when I get back to it later.
>
> Andrew
>
> _______________________________________________
> SYSLINUX mailing list
> Submissions to SYSLINUX@zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.