Network infrastructure.
The ARP protocol was made by Paulo Pinatti <ppinatti@br.ibm.com> * include/grub/net/arp.h: New file. * include/grub/net/device.h: Likewise. * include/grub/net/ethernet.h: Likewise. * include/grub/net/ip.h: Likewise. * include/grub/net/netbuff.h: Likewise. * include/grub/net/tftp.h: Likewise. * include/grub/net/udp.h: Likewise. * include/grub/ieee1275/ofnet.h: Likewise. * include/grub/emu/export.h: Likewise. * include/grub/net.h: Likewise. * grub-core/net/arp.c: Likewise. * grub-core/net/ethernet.c: Likewise. * grub-core/net/ip.c: Likewise. * grub-core/net/udp.c: Likewise. * grub-core/net/tftp.c: Likewise. * grub-core/net/netbuff.c: Likewise. * grub-core/net/net.c: Likewise. * grub-core/net/drivers/emu/emunet.c: Likewise. * grub-core/net/drivers/ieee1275/ofnet.c: Likewise. * grub-core/Makefile.am (KERNEL_HEADER_FILES): Add net.h, ofnet.h and export.h. * grub-core/Makefile.core.def (net): New module. (tftp): Likewise. (ofnet): Likewise. (emunet): Likewise. * grub-core/commands/ls.c (grub_ls_list_devices) [!GRUB_UTIL]: List network protocols. * grub-core/kern/device.c (grub_net_open) : New variable. (grub_device_open): Handle network device. (grub_device_close): Likewise. * grub-core/kern/file.c (grub_file_net_seek) : New variable. (grub_grubnet_fini): Likewise. (grub_file_seek): Seek in network device. * grub-core/kern/fs.c (grub_fs_probe): Handle network devices. * grub-core/kern/ieee1275/init.c (grub_machine_set_prefix): Handle network root. (grub_machine_fini): Call grub_grubnet_fini. * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args): Handle network. (grub_ieee1275_get_aliasdevname): New function. * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_get_mbi_size): Add unofficial Solaris network info. (grub_multiboot_make_mbi): Likewise. * grub-core/fs/i386/pc/pxe.c: Moved from here ... * grub-core/net/i386/pc/pxe.c: ...here. Adapted for new design. * include/grub/device.h (grub_fs): Removed. * include/grub/err.h (grub_err_t): Add network-related values. * include/grub/i386/pc/pxe.h: Removed bootp parts. * include/grub/ieee1275/ieee1275.h (grub_ofnetcard_data): New struct. (grub_ieee1275_get_aliasdevname): New proto. * include/grub/net.h: Rewritten. Also-By: Paulo Pinatti <ppinatti@br.ibm.com> Also-By: Vladimir Serbinenko <phcoder@gmail.com>
This commit is contained in:
commit
90162423e9
35 changed files with 3447 additions and 399 deletions
|
@ -33,6 +33,7 @@
|
|||
#include <grub/relocator.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/net.h>
|
||||
|
||||
/* The bits in the required part of flags field we don't support. */
|
||||
#define UNSUPPORTED_FLAGS 0x0000fff8
|
||||
|
@ -194,7 +195,10 @@ grub_multiboot_load (grub_file_t file)
|
|||
static grub_size_t
|
||||
grub_multiboot_get_mbi_size (void)
|
||||
{
|
||||
return sizeof (struct multiboot_info) + ALIGN_UP (cmdline_size, 4)
|
||||
grub_size_t ret;
|
||||
struct grub_net_network_level_interface *net;
|
||||
|
||||
ret = sizeof (struct multiboot_info) + ALIGN_UP (cmdline_size, 4)
|
||||
+ modcnt * sizeof (struct multiboot_mod_list) + total_modcmd
|
||||
+ ALIGN_UP (sizeof(PACKAGE_STRING), 4)
|
||||
+ grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry)
|
||||
|
@ -205,6 +209,15 @@ grub_multiboot_get_mbi_size (void)
|
|||
+ sizeof (struct grub_vbe_mode_info_block)
|
||||
#endif
|
||||
+ ALIGN_UP (sizeof (struct multiboot_apm_info), 4);
|
||||
|
||||
FOR_NET_NETWORK_LEVEL_INTERFACES(net)
|
||||
if (net->dhcp_ack)
|
||||
{
|
||||
ret += net->dhcp_acklen;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Fill previously allocated Multiboot mmap. */
|
||||
|
@ -530,6 +543,20 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
|||
mbi->flags |= MULTIBOOT_INFO_BOOTDEV;
|
||||
}
|
||||
|
||||
{
|
||||
struct grub_net_network_level_interface *net;
|
||||
FOR_NET_NETWORK_LEVEL_INTERFACES(net)
|
||||
if (net->dhcp_ack)
|
||||
{
|
||||
grub_memcpy (ptrorig, net->dhcp_ack, net->dhcp_acklen);
|
||||
mbi->drives_addr = ptrdest;
|
||||
mbi->drives_length = net->dhcp_acklen;
|
||||
ptrorig += net->dhcp_acklen;
|
||||
ptrdest += net->dhcp_acklen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (elf_sec_num)
|
||||
{
|
||||
mbi->u.elf_sec.addr = ptrdest;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue