diff options
Diffstat (limited to 'bootloader/x1000/boot.c')
-rw-r--r-- | bootloader/x1000/boot.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/bootloader/x1000/boot.c b/bootloader/x1000/boot.c index bb9528ba3c..6719375151 100644 --- a/bootloader/x1000/boot.c +++ b/bootloader/x1000/boot.c | |||
@@ -21,8 +21,6 @@ | |||
21 | 21 | ||
22 | #include "x1000bootloader.h" | 22 | #include "x1000bootloader.h" |
23 | #include "core_alloc.h" | 23 | #include "core_alloc.h" |
24 | #include "rb-loader.h" | ||
25 | #include "loader_strerror.h" | ||
26 | #include "system.h" | 24 | #include "system.h" |
27 | #include "kernel.h" | 25 | #include "kernel.h" |
28 | #include "power.h" | 26 | #include "power.h" |
@@ -30,27 +28,13 @@ | |||
30 | 28 | ||
31 | void boot_rockbox(void) | 29 | void boot_rockbox(void) |
32 | { | 30 | { |
33 | if(check_disk(true) != DISK_PRESENT) | 31 | size_t length; |
32 | int handle = load_rockbox(BOOTFILE, &length); | ||
33 | if(handle < 0) | ||
34 | return; | 34 | return; |
35 | 35 | ||
36 | size_t max_size = 0; | ||
37 | int handle = core_alloc_maximum("rockbox", &max_size, &buflib_ops_locked); | ||
38 | if(handle < 0) { | ||
39 | splash(5*HZ, "Out of memory"); | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | unsigned char* loadbuffer = core_get_data(handle); | ||
44 | int rc = load_firmware(loadbuffer, BOOTFILE, max_size); | ||
45 | if(rc <= 0) { | ||
46 | core_free(handle); | ||
47 | splash2(5*HZ, "Error loading Rockbox", loader_strerror(rc)); | ||
48 | return; | ||
49 | } | ||
50 | |||
51 | gui_shutdown(); | 36 | gui_shutdown(); |
52 | 37 | x1000_boot_rockbox(core_get_data(handle), length); | |
53 | x1000_boot_rockbox(loadbuffer, rc); | ||
54 | } | 38 | } |
55 | 39 | ||
56 | void shutdown(void) | 40 | void shutdown(void) |