grub-devel
[Top][All Lists]
Advanced

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

[PATCH] PXE support for grub2


From: Bean
Subject: [PATCH] PXE support for grub2
Date: Thu, 31 Jul 2008 00:50:22 +0800

Hi,

This patch add the (pxe) device that can be used to load files using
the pxe service. It also add a user land command pxe that can be used
to show pxe information as well as set some parameter.

To create a pxe boot image:

./grub-mkimage -d . -o core.img pxe
cat pxeboot.img core.img > g2pxe

g2pxe is the pxe boot file, copy it to tftp server, you also need to
copy *.mod, fs.lst, command.lst, moddep.lst and grub.cfg to /boot/grub
directory in the tftp server.

To test it in qemu, copy the files to directory such as /tftp, then:

qemu -boot n -tftp /tftp -bootp /g2pxe

usage for pxe command:

pxe info
Show information about pxe, like block size, client ip, etc.

pxe blksize size
Set block size. tftp transfer in trunks of bytes, the size can be
configured. The minimum size is 512, which is also the default. The
maximum size is 1432. Normally, you can increase download speed by
setting larger block size, but some old tftp server may not support
it. Also, qemu doesn't support size other than 512.

pxe unload
Unload the pxe runtime environment.

Please note that this patch depends on my other patch bufio, you need
to apply that first.

2008-07-30  Bean  <address@hidden>

        * boot/i386/pc/pxeboot.S: Use drive number 0x7F for pxe.

        * conf/i386-pc.rmk (kernel_img_HEADERS): Add machine/pxe.h.
        (pkglib_MODULES): Add pxe.mod and pxecmd.mod.
        (pxe_mod_SOURCES): New macro.
        (pxe_mod_CFLAGS): Likewise.
        (pxe_mod_LDFLAGS): Likewise.
        (pxecmd_mod_SOURCES): Likewise.
        (pxecmd_mod_CFLAGS): Likewise.
        (pxecmd_mod_LDFLAGS): Likewise.

        * kern/i386/pc/startup.S (grub_pxe_scan): New function.
        (grub_pxe_call): Likewise.

        * kern/i386/pc/init.c (make_install_device): Set root to (pxe) for pxe 
boot.

        * include/grub/disk.h (grub_disk_dev_id): Add GRUB_DISK_DEVICE_PXE_ID.  

        * commands/i386/pc/pxecmd.c: New file.

        * disk/i386/pc/pxe.c: Likewise.

        * include/grub/i386/pc/pxe.h: Likewise.

-- 
Bean

Attachment: pxe.diff
Description: Text Data


reply via email to

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