Author: quozl Date: Fri Apr 11 04:07:48 2014 New Revision: 3722 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3722
Log: OLPC XO-4 - dual boot menu for Android and Linux, using /boot-alt for the Android kernel
Added: cpu/arm/olpc/bootmenu.fth cpu/arm/olpc/chooseos.fth cpu/x86/pc/olpc/images/android.565 (contents, props changed) cpu/x86/pc/olpc/images/xos.565 (contents, props changed) Modified: cpu/arm/olpc/4.0/olpc.bth cpu/arm/olpc/build-fw.fth
Modified: cpu/arm/olpc/4.0/olpc.bth ============================================================================== --- cpu/arm/olpc/4.0/olpc.bth Fri Apr 11 04:05:29 2014 (r3721) +++ cpu/arm/olpc/4.0/olpc.bth Fri Apr 11 04:07:48 2014 (r3722) @@ -151,6 +151,10 @@ " ${BP}/cpu/x86/pc/olpc/images/leds.di" $add-file " ${BP}/cpu/x86/pc/olpc/images/ebook.di" $add-file
+ \ icons for boot menu + " ${BP}/cpu/x86/pc/olpc/images/android.565" " android.565" $add-deflated-dropin + " ${BP}/cpu/x86/pc/olpc/images/xos.565" " xos.565" $add-deflated-dropin + " nandblaster15_rx.bin" " nb15_rx" $add-deflated-dropin " nandblaster_tx.bin" " nb_tx" $add-deflated-dropin
Added: cpu/arm/olpc/bootmenu.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/olpc/bootmenu.fth Fri Apr 11 04:07:48 2014 (r3722) @@ -0,0 +1,55 @@ +\ TODO: enable touchscreen + +\ ubuntu:/usr/share/app-install/icons/sugar-xo.svg +icon: xos.icon rom:xos.565 + +\ The Android robot is reproduced or modified from work created and +\ shared by Google and used according to terms described in the +\ Creative Commons 3.0 Attribution License. +\ http://developer.android.com/distribute/googleplay/promote/brand.html +icon: android.icon rom:android.565 + +: choose-linux + restore-scroller ." Choosing Linux" cr + 0 " choose-os" eval + menu-done +; + +: choose-android + restore-scroller ." Choosing Android" cr + 1 " choose-os" eval + menu-done +; + +: boot-menu ( -- ) + d# 1 to rows + d# 5 to cols + + 0 0 set-row-col + " Linux/Sugar" + ['] choose-linux xos.icon 0 0 install-icon + + 0 4 set-row-col + " Android" + ['] choose-android android.icon 0 4 install-icon + + 0 2 selected 2drop +; + +: no-boot-menu ( -- ) + d# 1 to rows + d# 1 to cols + + " No operating system choice installed" + ['] quit-item quit.icon 0 0 selected install-icon +; + +: bootmenu + init-menu clear-menu + " choice-present?" eval if + ['] boot-menu to root-menu + else + ['] no-boot-menu to root-menu + then + (menu) +;
Modified: cpu/arm/olpc/build-fw.fth ============================================================================== --- cpu/arm/olpc/build-fw.fth Fri Apr 11 04:05:29 2014 (r3721) +++ cpu/arm/olpc/build-fw.fth Fri Apr 11 04:07:48 2014 (r3722) @@ -691,6 +691,8 @@
fload ${BP}/cpu/x86/pc/olpc/sound.fth fload ${BP}/cpu/x86/pc/olpc/guardrtc.fth +fload ${BP}/cpu/arm/olpc/chooseos.fth +fload ${BP}/cpu/arm/olpc/bootmenu.fth fload ${BP}/cpu/x86/pc/olpc/security.fth
stand-init: xid @@ -819,6 +821,12 @@ game-key-mask = if protect-fw try-fs-update then ;
+: ?boot-menu ( -- ) + rocker-down game-key? if + protect-fw visible bootmenu show-child invisible + then +; + [ifdef] use-screen-kbd 0 value screen-kbd-ih : open-screen-keyboard ( -- ) @@ -935,6 +943,7 @@ + use-screen-kbd ?text-on ?diags ?fs-update + ?boot-menu
factory-test? 0= if secure-startup then unblock-exceptions
Added: cpu/arm/olpc/chooseos.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/olpc/chooseos.fth Fri Apr 11 04:07:48 2014 (r3722) @@ -0,0 +1,15 @@ +\ See license at end of file +purpose: OS chooser for dual boot (Android and Linux) + +: choice-present? ( -- present? ) + \ TODO: number of partitions > 2, or specific android files present + true +; + +: choose-os ( n -- ) + if + button-o game-key-mask or to game-key-mask + else + button-o invert game-key-mask and to game-key-mask + then +;
Added: cpu/x86/pc/olpc/images/android.565 ============================================================================== Binary file. No diff available.
Added: cpu/x86/pc/olpc/images/xos.565 ============================================================================== Binary file. No diff available.