]>
git.proxmox.com Git - grub2.git/blob - grub-core/kern/efi/init.c
1 /* init.c - generic EFI initialization and finalization */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2006,2007 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #include <grub/efi/efi.h>
21 #include <grub/efi/console.h>
22 #include <grub/efi/disk.h>
23 #include <grub/term.h>
24 #include <grub/misc.h>
27 #include <grub/kernel.h>
29 grub_addr_t grub_modbase
;
34 grub_modbase
= grub_efi_modules_addr ();
35 /* First of all, initialize the console so that GRUB can display
39 /* Initialize the memory management system. */
42 efi_call_4 (grub_efi_system_table
->boot_services
->set_watchdog_timer
,
48 void (*grub_efi_net_config
) (grub_efi_handle_t hnd
,
53 grub_machine_get_bootlocation (char **device
, char **path
)
55 grub_efi_loaded_image_t
*image
= NULL
;
58 image
= grub_efi_get_loaded_image (grub_efi_image_handle
);
61 *device
= grub_efidisk_get_device_name (image
->device_handle
);
62 if (!*device
&& grub_efi_net_config
)
64 grub_efi_net_config (image
->device_handle
, device
, path
);
68 *path
= grub_efi_get_filename (image
->file_path
);
71 /* Get the directory. */
72 p
= grub_strrchr (*path
, '/');