help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to reuse the the part of codes about file system in grub ?


From: Andrei Borzenkov
Subject: Re: How to reuse the the part of codes about file system in grub ?
Date: Fri, 7 Aug 2015 11:48:38 +0300

On Thu, Aug 6, 2015 at 4:27 PM, Arch Stack <address@hidden> wrote:
> I found that grub support for reading many type of file system. Now I want
> to write a file system driver to read them on Windows like ext2fsd ,but
> support many type of file system,with the help of the source code in grub.

Do not forget that grub is read-only and there are no plans to add
write support.

> Because most of the file systems are written in a single C source file with
> an uniform interface (grub_fs) , and grub is independent from special OS
> (Windows , Linux ...),I think that it's possible to split them from grub to
> an independent library.
> But the codes depend on mm.h, misc.h,disk.h, dl.h, types.h, fshelp.h and
> many other header files , and many of them may should be written to achieve
> my goal.
> I think there must have easier way to do it , especially when I found that
> grub provide a user-mode program 'grub-mount' , which can be ran on Linux
> with the help of FUSE.
> I haven't read the source code of grub-mount, but I think that it's very
> helpful for me and I can wirte a file like this to achieve my goal.
>
> Now my question is:
> 1.How can grub-mount be compiled singly, which argument should I pass to
> 'make' ?

grub-mount requires all filesystem drivers which in turn require all
supporting code so you cannot compile it alone.

> 2.Must I rewrite many of the header files, such as disk.h to make it
> runnable in a driver on Windows? Or I should change the structure of grub?

Current development version of GRUB can be built on/for Windows (it
was tested with Cygwin, MinGW, MinGW-64 cross compiler). grub-mount
itself depends on FUSE so cannot be used as is on Windows (unless
there is FUSE port for Windows); rewriting it as Windows installable
file system is certainly possible and would be the best route in this
case. That would make it also available on Windows ... as long as you
are content with lack of write support.

> 3.Why not split the file system part in grub to an independent library,which
> may be used by other people who want to read special file system?  And I
> found that grub implemented many crypto, and I think they can be changed to
> an independent library either.
>
> By the way, the driver I want to write will be open source on github, and if
> you can show me the way to do it, I may announce what I have done when I
> achieved something. And if the part can be changed to an independent
> library, I may try to write a python or other languages' library with it if
> I have free time.
>
> Thank you, and sorry for my poor English!
>
> _______________________________________________
> Help-grub mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-grub
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]