Re: GRUB2 netboot development

2006-05-09 Thread vincent guffens
Rudy Attias wrote:
> 
> Netboot is taking a different direction? I'm curious about that, can you
> give some details?  


yes, grub legacy also used the drivers from Etherboot and it was
reported not be easily manageable. When Etherboot developpers decide to
change something, the glue code written in grub might have to change too
and so grub developper must constantly track these changes. Also, this
messy glue code is not particularly elegant and is not very funny to
program. It does not seem to me that it would happen too often but it
will happen and I don't have the experience that developpers from grub
legacy have.

So now the idea is to have a unique UNDI driver or maybe to find a way
to call into etherboot and come back into grub if the PXE/UNDI is not
supported. For the moment it is not clear for anyone I think how calling
into etherboot would be done.



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


RE: GRUB2 netboot development

2006-05-09 Thread Rudy Attias


Netboot is taking a different direction? I'm curious about that, can you
give some details?  

Rudy Attias


>Well I followed you advice but I came across some issues, probably on
>customization of the driver, I'm trying to add the tg3 to it. I made
>some adjustments on the code add some here and remove some there to
>resolve dependencies but one dependency I can't resolve. This function
>is not in the tg3.c or tg3.h code ... :( 

>I probably don't know enough C++ do understand that. If you have any
>ideas I would appreciate it very much.

 

>genmoddep: error: pcibios_read_config_dword in tg3 is not defined

>make: *** [moddep.lst] Error 1


yes, this is right, this function is not implemented anywhere. I have
published grub2_netboot_8.tgz on my website so that you can have a look.
The module tg3.mod compiles successfully but I did not test it. By the
way, this is not c++ but c (although with a nice object oriented
design)!

I hope it will work, but if it does not, I think we should not worry too
much about that for the moment as the netboot development is taking
quite a different direction now.

Cheers!


___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


RE: GRUB2 netboot development

2006-05-07 Thread Guffens, Vincent


>Well I followed you advice but I came across some issues, probably on
>customization of the driver, I'm trying to add the tg3 to it. I made
>some adjustments on the code add some here and remove some there to
>resolve dependencies but one dependency I can't resolve. This function
>is not in the tg3.c or tg3.h code ... :( 

>I probably don't know enough C++ do understand that. If you have any
>ideas I would appreciate it very much.

 

>genmoddep: error: pcibios_read_config_dword in tg3 is not defined

>make: *** [moddep.lst] Error 1


yes, this is right, this function is not implemented anywhere. I have published 
grub2_netboot_8.tgz on my website so that you can have a look. The module 
tg3.mod compiles successfully but I did not test it. By the way, this is not 
c++ but c (although with a nice object oriented design)!

I hope it will work, but if it does not, I think we should not worry too much 
about that for the moment as the netboot development is taking quite a 
different direction now.

Cheers!
<>___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: GRUB2 netboot development

2006-05-07 Thread Rudy Attias
Title:  








Hey 

 

Well I followed you advice but I came across some
issues, probably on customization of the driver, I'm trying to add the tg3 to
it. I made some adjustments on the code add some here and remove some there to
resolve dependencies but one dependency I can't resolve. This function is not
in the tg3.c or tg3.h code … :( 

I probably don't know enough C++ do understand that. If
you have any ideas I would appreciate it very much.

 

genmoddep: error: pcibios_read_config_dword in tg3 is
not defined

make: *** [moddep.lst] Error 1

 



Rudy Attias



 

> Hey,

> 

>  

> 

> I'm interested to know, how to
add drivers to the new pluggable 

> architecture
(grub2_netboot_7.tgz) from etherboot sources?

> 

>  

> 

> Also wanted to say that you
guys do great job with this boot loader! 

> Now it needs to learn to boot
from RAID and make coffee and  its perfect!

> 

>  

> 

> Rudy Attias

> 

 

Hi!

 

Adding a driver from etherboot (I
used 5.4.1) to this version of grub2 should be easy. Note that I have only
tried the ns8390 driver so far so it is likely that the process of addind news
drivers requires more manual interventions for the moment. The idea is that it
could be made completely automatic but it is not yet done. Also note that
according to a previous post, this mechanism which allows importing etherboot
drivers will not make it to the official grub2. The netboot support wil be
based on pxe and undi instead.

 

 

Anyway, here are the steps:

 

 

1) Copy the drivers files from the
driver you want from Etherboot to grub (Look where ns8390.c and ns8390.h are).

 

2) Edit the c file and add the
following code at the begining of the file:

 

/* Added for GRUB support */

#include 

/* Added for GRUB support */

 

 

3) locate in the c code the
structure (probably at the bottom) marked with  __pci_driver. It must be
called something like NAME_driver.

 

 

4) At the end of the c file, add the
following code where NAME should be replaced appropriately:

 

/* Added for GRUB support */

 

grub_ether_declare_probe(NAME);

grub_ether_declare_driver_struct(NAME);

 

GRUB_MOD_INIT(NAME)

{

 
(void)mod;  /* To stop warning. */

 

  grub_ether_fill_driver(NAME);

 
grub_register_pci_driver(&NAME_grub_driver);

}

 

GRUB_MOD_FINI(NAME)

{

 
grub_unregister_pci_driver(&NAME_grub_driver);

}

 

/* Added for GRUB support */

 

 

 

5) You now have to instruct the
building process to compile a module for your new driver. This is done by
modifying the file  conf/i386-pc.rmk.

Do a search for ns8390.mod and
notice that it is assigned to a variable called pkgdata_MODULES. Add your
module, i.e add NAME.mod to the list of modules assigned to this variable.

 

6) Do a search for ns8390.mod again
and add these lines, changing what needs to be changed

 

# For ns8390.mod

ns8390_mod_SOURCES =
drivers/net/ns8390.c ns8390_mod_CFLAGS = $(DRIVERS_NET_CFLAGS) $(COMMON_CFLAGS)
$(DRIVERS_CFLAGS) ns8390_mod_LDFLAGS = $(COMMON_LDFLAGS)

 

7) This is it, autoconf &&
./configure && make and see how it goes

 

In order to test your news driver,
you have to use the modules pci, pci_etherboot, as well as your new module. You
can use the command lspci to check if pci support list your card and
lspci_driver to see if your driver was added properly.  To probe fo your
card, use scan_pci_device.

 

If everything goes well, you can
then use tx_test to check for the successfull transmission of a test frame.

 

Good luck, let me know how it goes!

 

 






___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: GRUB2 netboot development

2006-05-04 Thread vincent guffens
Rudy Attias wrote:
> Hey, 
> 
>  
> 
> I'm interested to know, how to add drivers to the new pluggable
> architecture (grub2_netboot_7.tgz) from etherboot sources? 
> 
>  
> 
> Also wanted to say that you guys do great job with this boot loader! Now
> it needs to learn to boot from RAID and make coffee and  its perfect!
> 
>  
> 
> Rudy Attias
> 

Hi!

Adding a driver from etherboot (I used 5.4.1) to this version of grub2
should be easy. Note that I have only tried the ns8390 driver so far so
it is likely that the process of addind news drivers requires more
manual interventions for the moment. The idea is that it could be made
completely automatic but it is not yet done. Also note that according to
a previous post, this mechanism which allows importing etherboot drivers
will not make it to the official grub2. The netboot support wil be based
on pxe and undi instead.


Anyway, here are the steps:


1) Copy the drivers files from the driver you want from Etherboot to
grub (Look where ns8390.c and ns8390.h are).

2) Edit the c file and add the following code at the begining of the file:

/* Added for GRUB support */
#include 
/* Added for GRUB support */


3) locate in the c code the structure (probably at the bottom) marked
with  __pci_driver. It must be called something like NAME_driver.


4) At the end of the c file, add the following code where NAME should be
replaced appropriately:

/* Added for GRUB support */

grub_ether_declare_probe(NAME);
grub_ether_declare_driver_struct(NAME);

GRUB_MOD_INIT(NAME)
{
  (void)mod;  /* To stop warning. */

  grub_ether_fill_driver(NAME);
  grub_register_pci_driver(&NAME_grub_driver);
}

GRUB_MOD_FINI(NAME)
{
  grub_unregister_pci_driver(&NAME_grub_driver);
}

/* Added for GRUB support */



5) You now have to instruct the building process to compile a module for
your new driver. This is done by modifying the file  conf/i386-pc.rmk.
Do a search for ns8390.mod and notice that it is assigned to a variable
called pkgdata_MODULES. Add your module, i.e add NAME.mod to the list of
modules assigned to this variable.

6) Do a search for ns8390.mod again and add these lines, changing what
needs to be changed

# For ns8390.mod
ns8390_mod_SOURCES = drivers/net/ns8390.c
ns8390_mod_CFLAGS = $(DRIVERS_NET_CFLAGS) $(COMMON_CFLAGS) $(DRIVERS_CFLAGS)
ns8390_mod_LDFLAGS = $(COMMON_LDFLAGS)

7) This is it, autoconf && ./configure && make and see how it goes

In order to test your news driver, you have to use the modules pci,
pci_etherboot, as well as your new module. You can use the command lspci
to check if pci support list your card and lspci_driver to see if your
driver was added properly.  To probe fo your card, use scan_pci_device.

If everything goes well, you can then use tx_test to check for the
successfull transmission of a test frame.

Good luck, let me know how it goes!












___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel