diff -uNr linux-2.6.20.6/arch/i386/kernel/e820.c linux-2.6.20.6-appletv/arch/i386/kernel/e820.c --- linux-2.6.20.6/arch/i386/kernel/e820.c 2007-04-07 14:48:09.000000000 +0200 +++ linux-2.6.20.6-appletv/arch/i386/kernel/e820.c 2007-04-07 10:22:54.000000000 +0200 @@ -828,6 +828,9 @@ u64 start = s; u64 end = e; int i; + + if (efi_enabled) return 1; + for (i = 0; i < e820.nr_map; i++) { struct e820entry *ei = &e820.map[i]; if (type && ei->type != type) diff -uNr linux-2.6.20.6/arch/i386/kernel/efi.c linux-2.6.20.6-appletv/arch/i386/kernel/efi.c --- linux-2.6.20.6/arch/i386/kernel/efi.c 2007-04-07 14:48:09.000000000 +0200 +++ linux-2.6.20.6-appletv/arch/i386/kernel/efi.c 2007-04-07 10:43:43.000000000 +0200 @@ -481,39 +481,39 @@ static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) { - return efi_call_virt(get_time, tm, tc); +// return efi_call_virt(get_time, tm, tc); } static efi_status_t virt_efi_set_time (efi_time_t *tm) { - return efi_call_virt(set_time, tm); +// return efi_call_virt(set_time, tm); } static efi_status_t virt_efi_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, efi_time_t *tm) { - return efi_call_virt(get_wakeup_time, enabled, pending, tm); +// return efi_call_virt(get_wakeup_time, enabled, pending, tm); } static efi_status_t virt_efi_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) { - return efi_call_virt(set_wakeup_time, enabled, tm); +// return efi_call_virt(set_wakeup_time, enabled, tm); } static efi_status_t virt_efi_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, unsigned long *data_size, void *data) { - return efi_call_virt(get_variable, name, vendor, attr, data_size, data); +// return efi_call_virt(get_variable, name, vendor, attr, data_size, data); } static efi_status_t virt_efi_get_next_variable (unsigned long *name_size, efi_char16_t *name, efi_guid_t *vendor) { - return efi_call_virt(get_next_variable, name_size, name, vendor); +// return efi_call_virt(get_next_variable, name_size, name, vendor); } static efi_status_t virt_efi_set_variable (efi_char16_t *name, @@ -521,19 +521,20 @@ unsigned long attr, unsigned long data_size, void *data) { - return efi_call_virt(set_variable, name, vendor, attr, data_size, data); +// return efi_call_virt(set_variable, name, vendor, attr, data_size, data); } static efi_status_t virt_efi_get_next_high_mono_count (u32 *count) { - return efi_call_virt(get_next_high_mono_count, count); +// return efi_call_virt(get_next_high_mono_count, count); } static void virt_efi_reset_system (int reset_type, efi_status_t status, unsigned long data_size, efi_char16_t *data) { - efi_call_virt(reset_system, reset_type, status, data_size, data); + emergency_reboot(); +// efi_call_virt(reset_system, reset_type, status, data_size, data); } /* @@ -571,6 +572,7 @@ BUG_ON(!efi.systab); + /* status = phys_efi_set_virtual_address_map( memmap.desc_size * memmap.nr_map, memmap.desc_size, @@ -581,14 +583,17 @@ printk (KERN_ALERT "You are screwed! " "Unable to switch EFI into virtual mode " "(status=%lx)\n", status); + //emergency_reboot(); panic("EFI call to SetVirtualAddressMap() failed!"); } + */ /* * Now that EFI is in virtual mode, update the function * pointers in the runtime service table to the new virtual addresses. */ + /* efi.get_time = virt_efi_get_time; efi.set_time = virt_efi_set_time; efi.get_wakeup_time = virt_efi_get_wakeup_time; @@ -597,6 +602,7 @@ efi.get_next_variable = virt_efi_get_next_variable; efi.set_variable = virt_efi_set_variable; efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; + */ efi.reset_system = virt_efi_reset_system; } diff -uNr linux-2.6.20.6/arch/i386/kernel/setup.c linux-2.6.20.6-appletv/arch/i386/kernel/setup.c --- linux-2.6.20.6/arch/i386/kernel/setup.c 2007-04-07 14:48:09.000000000 +0200 +++ linux-2.6.20.6-appletv/arch/i386/kernel/setup.c 2007-04-07 10:22:54.000000000 +0200 @@ -676,3 +676,28 @@ * c-basic-offset:8 * End: */ +asmlinkage void emergency_reboot(void) { + #define load_idt(dtr) __asm__ __volatile("lidt %0"::"m" (*dtr)) + struct Xgt_desc_struct { + unsigned short size; + unsigned long address __attribute__((packed)); + unsigned short pad; + } __attribute__ ((packed)); + + static unsigned long long + real_mode_gdt_entries [3] = + { + 0x0000000000000000ULL, /* Null descriptor */ + 0x00009a000000ffffULL, /* 16-bit real-mode 64k code at 0x00000000 */ + 0x000092000100ffffULL /* 16-bit real-mode 64k data at 0x00000100 */ + }; + + + static struct Xgt_desc_struct + real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, (long)real_mode_gdt_entries }, + real_mode_idt = { 0x3ff, 0 }, + no_idt = { 0, 0 }; + + load_idt(&no_idt); + __asm__("int3"); +} diff -uNr linux-2.6.20.6/drivers/usb/storage/usb.c linux-2.6.20.6-appletv/drivers/usb/storage/usb.c --- linux-2.6.20.6/drivers/usb/storage/usb.c 2007-04-07 14:48:35.000000000 +0200 +++ linux-2.6.20.6-appletv/drivers/usb/storage/usb.c 2007-04-07 10:22:54.000000000 +0200 @@ -107,7 +107,7 @@ MODULE_DESCRIPTION("USB Mass Storage driver for Linux"); MODULE_LICENSE("GPL"); -static unsigned int delay_use = 5; +static unsigned int delay_use = 0; module_param(delay_use, uint, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device"); diff -uNr linux-2.6.20.6/drivers/video/imacfb.c linux-2.6.20.6-appletv/drivers/video/imacfb.c --- linux-2.6.20.6/drivers/video/imacfb.c 2006-11-29 22:57:37.000000000 +0100 +++ linux-2.6.20.6-appletv/drivers/video/imacfb.c 2007-04-07 10:23:13.000000000 +0200 @@ -30,6 +30,7 @@ M_I20, M_MINI, M_MACBOOK, + M_APPLETV, M_UNKNOWN } MAC_TYPE; @@ -57,6 +58,8 @@ static int model = M_UNKNOWN; static int manual_height; static int manual_width; +static int manual_linelength; +static u32 manual_base; static int set_system(struct dmi_system_id *id) { @@ -81,6 +84,9 @@ { set_system, "Macmini1,1", { DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."), DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}, (void *)M_MINI}, + { set_system, "AppleTV1,1", { + DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."), + DMI_MATCH(DMI_PRODUCT_NAME,"AppleTV1,1")}, (void *)M_APPLETV}, {}, }; @@ -142,10 +148,16 @@ model = M_MINI; else if (!strcmp(this_opt, "macbook")) model = M_MACBOOK; + else if (!strcmp(this_opt, "appletv")) + model = M_APPLETV; else if (!strncmp(this_opt, "height:", 7)) manual_height = simple_strtoul(this_opt+7, NULL, 0); else if (!strncmp(this_opt, "width:", 6)) manual_width = simple_strtoul(this_opt+6, NULL, 0); + else if (!strncmp(this_opt, "linelength:", 11)) + manual_linelength = simple_strtoul(this_opt+11, NULL, 0); + else if (!strncmp(this_opt, "base:", 5)) + manual_base = simple_strtoul(this_opt+5, NULL, 0); } return 0; } @@ -195,6 +207,12 @@ screen_info.lfb_linelength = 2048 * 4; screen_info.lfb_base = 0x80000000; break; + case M_APPLETV: + screen_info.lfb_width = 1440; + screen_info.lfb_height = 900; + screen_info.lfb_linelength = 1536 * 4; + screen_info.lfb_base = 0x10030000; + break; } /* if the user wants to manually specify height/width, @@ -204,6 +222,10 @@ screen_info.lfb_height = manual_height; if (manual_width > 0) screen_info.lfb_width = manual_width; + if (manual_linelength > 0) + screen_info.lfb_linelength = manual_linelength; + if (manual_base > 0) + screen_info.lfb_base = manual_base; imacfb_fix.smem_start = screen_info.lfb_base; imacfb_defined.bits_per_pixel = screen_info.lfb_depth; @@ -361,10 +383,11 @@ return -ENODEV; if (model == M_UNKNOWN) return -ENODEV; - if (fb_get_options("imacfb", &option)) return -ENODEV; + //emergency_reboot(); + //model = M_APPLETV; imacfb_setup(option); ret = platform_driver_register(&imacfb_driver); diff -uNr linux-2.6.20.6/Makefile linux-2.6.20.6-appletv/Makefile --- linux-2.6.20.6/Makefile 2007-04-07 14:49:00.000000000 +0200 +++ linux-2.6.20.6-appletv/Makefile 2007-04-07 10:22:54.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 20 -EXTRAVERSION = .6 +EXTRAVERSION = .6-appletv NAME = Homicidal Dwarf Hamster # *DOCUMENTATION* Binärdateien linux-2.6.20.6/scripts/kconfig/mconf and linux-2.6.20.6-appletv/scripts/kconfig/mconf sind verschieden.