summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/mkboot.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/mkboot.c b/tools/mkboot.c
index 77f65d9dc7..b305da2eae 100644
--- a/tools/mkboot.c
+++ b/tools/mkboot.c
@@ -23,6 +23,13 @@
23#include <string.h> 23#include <string.h>
24#include "mkboot.h" 24#include "mkboot.h"
25 25
26#define SECTOR_SIZE 0x200
27#define RAW_IMAGE_SIZE 0x400000
28#define TOTAL_IMAGE_SIZE (RAW_IMAGE_SIZE + HEADER2_SIZE)
29#define ALIGNED_IMAGE_SIZE (TOTAL_IMAGE_SIZE + SECTOR_SIZE - (TOTAL_IMAGE_SIZE % SECTOR_SIZE))
30#define HEADER1_SIZE SECTOR_SIZE
31#define HEADER2_SIZE 0x20
32
26#ifndef RBUTIL 33#ifndef RBUTIL
27static void usage(void) 34static void usage(void)
28{ 35{
@@ -63,7 +70,12 @@ int main(int argc, char *argv[])
63} 70}
64#endif 71#endif
65 72
66static unsigned char image[0x400000 + 0x220 + 0x400000/0x200]; 73/*
74 * initial header size plus
75 * the rounded up size (includes the raw data and its length header) plus
76 * the checksums for the raw data and its length header
77 */
78static unsigned char image[ALIGNED_IMAGE_SIZE + HEADER1_SIZE + ALIGNED_IMAGE_SIZE / SECTOR_SIZE];
67 79
68int mkboot_iriver(const char* infile, const char* bootfile, const char* outfile, int origin) 80int mkboot_iriver(const char* infile, const char* bootfile, const char* outfile, int origin)
69{ 81{