Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame^] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2006 by Greg White |
| 11 | * |
| 12 | * All files in this archive are subject to the GNU General Public License. |
| 13 | * See the file COPYING in the source tree root for full license agreement. |
| 14 | * |
| 15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 16 | * KIND, either express or implied. |
| 17 | * |
| 18 | ****************************************************************************/ |
| 19 | #include "config.h" |
| 20 | |
| 21 | #include <stdlib.h> |
| 22 | #include <stdio.h> |
| 23 | #include "inttypes.h" |
| 24 | #include "string.h" |
| 25 | #include "cpu.h" |
| 26 | #include "system.h" |
| 27 | #include "lcd.h" |
| 28 | #include "kernel.h" |
| 29 | #include "thread.h" |
| 30 | #include "ata.h" |
| 31 | #include "fat.h" |
| 32 | #include "disk.h" |
| 33 | #include "font.h" |
| 34 | #include "adc.h" |
| 35 | #include "backlight.h" |
| 36 | #include "backlight-target.h" |
| 37 | #include "button.h" |
| 38 | #include "panic.h" |
| 39 | #include "power.h" |
| 40 | #include "file.h" |
| 41 | #include "common.h" |
| 42 | #include "rbunicode.h" |
| 43 | #include "usb.h" |
| 44 | #include "mmu-imx31.h" |
| 45 | #include "lcd-target.h" |
| 46 | #include "avic-imx31.h" |
| 47 | #include <stdarg.h> |
| 48 | |
| 49 | char version[] = APPSVERSION; |
| 50 | |
| 51 | void main(void) |
| 52 | { |
| 53 | lcd_clear_display(); |
| 54 | printf("Hello world!"); |
| 55 | printf("Gigabeat S Rockbox Bootloader v.00000001"); |
| 56 | kernel_init(); |
| 57 | int rc; |
| 58 | |
| 59 | rc = ata_init(); |
| 60 | if(rc) |
| 61 | { |
| 62 | reset_screen(); |
| 63 | error(EATA, rc); |
| 64 | } |
| 65 | |
| 66 | disk_init(); |
| 67 | |
| 68 | rc = disk_mount_all(); |
| 69 | if (rc<=0) |
| 70 | { |
| 71 | error(EDISK,rc); |
| 72 | } |
| 73 | |
| 74 | printf("Congratulations!"); |
| 75 | while(1); |
| 76 | |
| 77 | #if 0 |
| 78 | printf("Loading firmware"); |
| 79 | |
| 80 | loadbuffer = (unsigned char*) 0x100; |
| 81 | buffer_size = (unsigned char*)0x400000 - loadbuffer; |
| 82 | |
| 83 | rc = load_firmware(loadbuffer, BOOTFILE, buffer_size); |
| 84 | if(rc < 0) |
| 85 | error(EBOOTFILE, rc); |
| 86 | |
| 87 | if (rc == EOK) |
| 88 | { |
| 89 | kernel_entry = (void*) loadbuffer; |
| 90 | rc = kernel_entry(); |
| 91 | } |
| 92 | #endif |
| 93 | } |
| 94 | |