2009-05-03 Vladimir Serbinenko <phcoder@gmail.com>
xnu support * conf/i386-efi.rmk (kernel_mod_HEADERS): added i386/pit.h (pkglib_MODULES): add xnu.mod (xnu_mod_SOURCES): new variable (xnu_mod_CFLAGS): likewise (xnu_mod_LDFLAGS): likewise (xnu_mod_ASFLAGS): likewise * conf/i386-pc.rmk: likewise * conf/x86_64-efi.rmk: likewise * include/grub/efi/efi.h (grub_efi_finish_boot_services): new declaration * include/grub/i386/macho.h: new file * include/grub/i386/xnu.h: likewise * include/grub/macho.h: likewise * include/grub/machoload.h: likewise * include/grub/x86_64/macho.h: likewise * include/grub/x86_64/xnu.h: likewise * include/grub/xnu.h: likewise * kern/efi/efi.c (grub_efi_finish_boot_services): new function * kern/efi/mm.c (MAX_HEAP_SIZE): increase * loader/i386/efi/xnu.c: new file * loader/i386/pc/xnu.c: likewise * loader/i386/xnu.c: likewise * loader/i386/xnu_helper.S: likewise * loader/macho.c: likewise * loader/xnu.c: likewise * loader/xnu_resume.c: likewise * util/grub-dumpdevtree: likewise * include/grub/i386/pit.h: include grub/err.h (grub_pit_wait): export * util/grub.d/30_os-prober.in: support Darwin/Mac OS X
This commit is contained in:
parent
5caf964d75
commit
bbee0f2b56
24 changed files with 3378 additions and 6 deletions
11
include/grub/i386/macho.h
Normal file
11
include/grub/i386/macho.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#define GRUB_MACHO_CPUTYPE_IS_HOST32(x) ((x)==0x00000007)
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST64(x) ((x)==0x01000007)
|
||||
|
||||
struct grub_macho_thread32
|
||||
{
|
||||
grub_uint32_t cmd;
|
||||
grub_uint32_t cmdsize;
|
||||
grub_uint8_t unknown1[48];
|
||||
grub_uint32_t entry_point;
|
||||
grub_uint8_t unknown2[20];
|
||||
} __attribute__ ((packed));
|
|
@ -20,7 +20,8 @@
|
|||
#define KERNEL_CPU_PIT_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
|
||||
extern void grub_pit_wait (grub_uint16_t tics);
|
||||
void EXPORT_FUNC(grub_pit_wait) (grub_uint16_t tics);
|
||||
|
||||
#endif /* ! KERNEL_CPU_PIT_HEADER */
|
||||
|
|
60
include/grub/i386/xnu.h
Normal file
60
include/grub/i386/xnu.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
#ifndef GRUB_CPU_XNU_H
|
||||
#define GRUB_CPU_XNU_H 1
|
||||
|
||||
#define GRUB_XNU_PAGESIZE 4096
|
||||
typedef grub_uint32_t grub_xnu_ptr_t;
|
||||
|
||||
struct grub_xnu_boot_params
|
||||
{
|
||||
grub_uint16_t verminor;
|
||||
grub_uint16_t vermajor;
|
||||
/* Command line passed to xnu. */
|
||||
grub_uint8_t cmdline[1024];
|
||||
|
||||
/* Later are the same as EFI's get_memory_map (). */
|
||||
grub_xnu_ptr_t efi_mmap;
|
||||
grub_uint32_t efi_mmap_size;
|
||||
grub_uint32_t efi_mem_desc_size;
|
||||
grub_uint32_t efi_mem_desc_version;
|
||||
|
||||
/* Later are video parameters. */
|
||||
grub_xnu_ptr_t lfb_base;
|
||||
#define GRUB_XNU_VIDEO_SPLASH 1
|
||||
#define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2
|
||||
grub_uint32_t lfb_mode;
|
||||
grub_uint32_t lfb_line_len;
|
||||
grub_uint32_t lfb_width;
|
||||
grub_uint32_t lfb_height;
|
||||
grub_uint32_t lfb_depth;
|
||||
|
||||
/* Pointer to device tree and its len. */
|
||||
grub_xnu_ptr_t devtree;
|
||||
grub_uint32_t devtreelen;
|
||||
|
||||
/* First used address by kernel or boot structures. */
|
||||
grub_xnu_ptr_t heap_start;
|
||||
/* Last used address by kernel or boot structures minus previous value. */
|
||||
grub_uint32_t heap_size;
|
||||
|
||||
/* First memory page containing runtime code or data. */
|
||||
grub_uint32_t efi_runtime_first_page;
|
||||
/* First memory page containing runtime code or data minus previous value. */
|
||||
grub_uint32_t efi_runtime_npages;
|
||||
grub_uint32_t efi_system_table;
|
||||
/* Size of grub_efi_uintn_t in bits. */
|
||||
grub_uint8_t efi_uintnbits;
|
||||
} __attribute__ ((packed));
|
||||
#define GRUB_XNU_BOOTARGS_VERMINOR 4
|
||||
#define GRUB_XNU_BOOTARGS_VERMAJOR 1
|
||||
|
||||
extern grub_uint32_t grub_xnu_entry_point;
|
||||
extern grub_uint32_t grub_xnu_stack;
|
||||
extern grub_uint32_t grub_xnu_arg1;
|
||||
extern char grub_xnu_cmdline[1024];
|
||||
grub_err_t grub_xnu_boot (void);
|
||||
grub_err_t grub_cpu_xnu_fill_devicetree (void);
|
||||
grub_err_t grub_xnu_set_video (struct grub_xnu_boot_params *bootparams_relloc);
|
||||
extern grub_uint32_t grub_xnu_heap_will_be_at;
|
||||
extern grub_uint8_t grub_xnu_launcher_start[];
|
||||
extern grub_uint8_t grub_xnu_launcher_end[];
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue