Rename getptr to bufgetcodec and make it ensure the codec is ready to load
[Rockbox.git] / bootloader / gigabeat-s.c
blob25b9ab5f35f3f7898516e6797d0db0341a17aabb
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Greg White
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include "config.h"
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>
49 char version[] = APPSVERSION;
51 void main(void)
53 lcd_clear_display();
54 printf("Hello world!");
55 printf("Gigabeat S Rockbox Bootloader v.00000001");
56 kernel_init();
57 int rc;
59 rc = ata_init();
60 if(rc)
62 reset_screen();
63 error(EATA, rc);
66 disk_init();
68 rc = disk_mount_all();
69 if (rc<=0)
71 error(EDISK,rc);
74 printf("Congratulations!");
75 while(1);
77 #if 0
78 printf("Loading firmware");
80 loadbuffer = (unsigned char*) 0x100;
81 buffer_size = (unsigned char*)0x400000 - loadbuffer;
83 rc = load_firmware(loadbuffer, BOOTFILE, buffer_size);
84 if(rc < 0)
85 error(EBOOTFILE, rc);
87 if (rc == EOK)
89 kernel_entry = (void*) loadbuffer;
90 rc = kernel_entry();
92 #endif