grub-devel
[Top][All Lists]
Advanced

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

Re: GRUB2 netboot development


From: vincent guffens
Subject: Re: GRUB2 netboot development
Date: Thu, 04 May 2006 14:49:47 +0100
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

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 <ether_glue.h>
/* 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!














reply via email to

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