2008-04-25 Bean <bean123ch@gmail.com>
* Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and i386-linuxbios. * commands/hexdump.c (grub_cmd_hexdump): Support dumping of device, change the buffer size to 4096 for cdrom device. * conf/i386-ieee1275.rmk (pkglib_MODULES): Add _linux.mod, linux.mod and nand.mod. (_linux_mod_SOURCES): New variable. (_linux_mod_CFLAGS): Likewise. (_linux_mod_LDFLAGS): Likewise. (linux_mod_SOURCES): Likewise. (linux_mod_CFLAGS): Likewise. (linux_mod_LDFLAGS): Likewise. (nand_mod_SOURCES): Likewise. (nand_mod_CFLAGS): Likewise. (nand_mod_LDFLAGS): Likewise. * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Return GRUB_ERR_UNKNOWN_DEVICE instead of GRUB_ERR_BAD_DEVICE if no device type property. (nand device in olpc don't have this property) * include/grub/disk.h (grub_disk_dev_id): New macro GRUB_DISK_DEVICE_NAND_ID. * include/grub/i386/ieee1275/loader.h (grub_rescue_cmd_linux): New function prototype. (grub_rescue_cmd_initrd): Likewise. * include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro. (linux_kernel_params): Add new member ofw_signature, ofw_num_items, ofw_cif_handler and ofw_idt, adjust padding number. * include/grub/i386/pc/memory.h (grub_upper_mem): Export it if GRUB_MACHINE_IEEE1275 is defined. * include/grub/ieee1275/ieee1275.h (grub_available_iterate): Use NESTED_FUNC_ATTR attribute on the hook parameter. * kern/powerpc/ieee1275/init.c (grub_claim_heap): Use NESTED_FUNC_ATTR on nested function heap_init. (grub_upper_mem): New variable for i386-ieee1275. (grub_get_extended_memory): New function for i386-ieee1275. (grub_machine_init): Call grub_get_extended_memory for i386-ieee1275. * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type property. * loader/i386/ieee1275/linux.c: New file. * loader/i386/ieee1275/linux_normal.c: New file. * disk/ieee1275/nand.c: New file.
This commit is contained in:
parent
e0c5dacbf4
commit
25f16ec1f6
17 changed files with 917 additions and 30 deletions
|
@ -37,6 +37,7 @@ enum grub_disk_dev_id
|
|||
GRUB_DISK_DEVICE_HOST_ID,
|
||||
GRUB_DISK_DEVICE_ATA_ID,
|
||||
GRUB_DISK_DEVICE_MEMDISK_ID,
|
||||
GRUB_DISK_DEVICE_NAND_ID,
|
||||
};
|
||||
|
||||
struct grub_disk;
|
||||
|
|
|
@ -27,4 +27,7 @@ void EXPORT_FUNC(grub_multiboot2_real_boot) (grub_addr_t entry,
|
|||
struct grub_multiboot_info *mbi)
|
||||
__attribute__ ((noreturn));
|
||||
|
||||
void grub_rescue_cmd_linux (int argc, char *argv[]);
|
||||
void grub_rescue_cmd_initrd (int argc, char *argv[]);
|
||||
|
||||
#endif /* ! GRUB_LOADER_MACHINE_HEADER */
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
#define GRUB_LINUX_EFI_SIGNATURE \
|
||||
('E' << 24 | 'F' << 16 | 'I' << 8 | 'L')
|
||||
|
||||
#define GRUB_LINUX_OFW_SIGNATURE \
|
||||
(' ' << 24 | 'W' << 16 | 'F' << 8 | 'O')
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
/* For the Linux/i386 boot protocol version 2.03. */
|
||||
|
@ -154,7 +157,14 @@ struct linux_kernel_params
|
|||
grub_uint8_t hd1_drive_info[0x10]; /* 90 */
|
||||
grub_uint16_t rom_config_len; /* a0 */
|
||||
|
||||
grub_uint8_t padding6[0x1c0 - 0xa2];
|
||||
grub_uint8_t padding6[0xb0 - 0xa2];
|
||||
|
||||
grub_uint32_t ofw_signature; /* b0 */
|
||||
grub_uint32_t ofw_num_items; /* b4 */
|
||||
grub_uint32_t ofw_cif_handler; /* b8 */
|
||||
grub_uint32_t ofw_idt; /* bc */
|
||||
|
||||
grub_uint8_t padding7[0x1c0 - 0xc0];
|
||||
|
||||
grub_uint32_t efi_signature; /* 1c0 */
|
||||
grub_uint32_t efi_system_table; /* 1c4 */
|
||||
|
@ -163,15 +173,15 @@ struct linux_kernel_params
|
|||
grub_uint32_t efi_mmap; /* 1d0 */
|
||||
grub_uint32_t efi_mmap_size; /* 1d4 */
|
||||
|
||||
grub_uint8_t padding7[0x1e0 - 0x1d8];
|
||||
grub_uint8_t padding8[0x1e0 - 0x1d8];
|
||||
|
||||
grub_uint32_t alt_mem; /* 1e0 */
|
||||
|
||||
grub_uint8_t padding8[0x1e8 - 0x1e4];
|
||||
grub_uint8_t padding9[0x1e8 - 0x1e4];
|
||||
|
||||
grub_uint32_t mmap_size; /* 1e8 */
|
||||
|
||||
grub_uint8_t padding9[0x1ff - 0x1ec];
|
||||
grub_uint8_t padding10[0x1ff - 0x1ec];
|
||||
|
||||
grub_uint8_t ps_mouse; /* 1ff */
|
||||
} __attribute__ ((packed));
|
||||
|
|
|
@ -76,11 +76,14 @@
|
|||
/* The data segment of the pseudo real mode. */
|
||||
#define GRUB_MEMORY_MACHINE_PSEUDO_REAL_DSEG 0x20
|
||||
|
||||
#ifndef GRUB_MACHINE_IEEE1275
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#ifndef GRUB_MACHINE_IEEE1275
|
||||
extern grub_size_t EXPORT_VAR(grub_lower_mem);
|
||||
extern grub_size_t EXPORT_VAR(grub_upper_mem);
|
||||
#endif
|
||||
|
||||
extern grub_size_t EXPORT_VAR(grub_upper_mem);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_MEMORY_MACHINE_HEADER */
|
||||
|
|
|
@ -159,7 +159,7 @@ grub_err_t EXPORT_FUNC(grub_devalias_iterate)
|
|||
grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath,
|
||||
int (*hook) (struct grub_ieee1275_devalias *alias));
|
||||
grub_err_t EXPORT_FUNC(grub_available_iterate)
|
||||
(int (*hook) (grub_uint64_t, grub_uint64_t));
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t));
|
||||
int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size);
|
||||
|
||||
char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue