[syslinux] COM32

Mortaza Doulaty mortaza.doulaty at gmail.com
Wed Jun 16 02:24:49 PDT 2010


Hi,

I've started my sample COM32 module, as the first step, I tried to write to
a file in bootloader's file system itself.
When I call this module, the first printf (which prints an initial message
on the console) works, but it hangs there. No file is created and the
program seems to hang.

As hpa said, I'm using standard C calls to access to the file system of the
bootloader itself.

What is wrong with the code?

#include <stdio.h>
#include <string.h>
#include <console.h>

int main(int argc, char *argv[])
{
    int i;

    openconsole(&dev_stdcon_r, &dev_stdcon_w);

    printf("Hello, World!\n");

    FILE *f;

    f = fopen("./mrt.txt", "wt");

    fprintf(f, "Hello world!");

    fclose(f);

    printf("Writing done!\n");

    return 0;


On Wed, Jun 16, 2010 at 12:11 PM, H. Peter Anvin <hpa at zytor.com> wrote:

> On 06/16/2010 12:31 AM, Mortaza Doulaty wrote:
> > Hi,
> >
> > I'm using SYSLINUX as a boot loader to my OS's. Before booting my OS's, I
> > want to check for existence of some files on my hard drives (NTFS and
> ext3
> > as well).
> > I think using COM32 modules to access to file system. I want some
> resources
> > to learn more about COM32 modules and especially accessing file system
> using
> > COM32 modules.
> >
> > Any help would highly appreciated.
> >
>
> In current versions of Syslinux, COM32 modules (as well as Syslinux
> proper) can only access the bootloader filesystem itself.  Filesystems
> on that filesystem can be accessed using normal C calls.  Accessing
> filesystems on other devices is not supported in the current version of
> Syslinux (it's targetted for Syslinux 5) but your COM32 module can of
> course carry its own filesystem access library and access the filesystem
> that way.  There are open source libraries for a lot of filesystems
> available, including FAT, NTFS, and ext2/3/4, but it probably will
> entail some porting effort to make them work in the COM32 environment.
>
>        -hpa
>
> --
> H. Peter Anvin, Intel Open Source Technology Center
> I work for Intel.  I don't speak on their behalf.
>
>



More information about the Syslinux mailing list