freemyipod r133 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r132‎ | r133 | r134 >
Date:02:29, 14 August 2010
Author:theseven
Status:new
Tags:
Comment:
Move the initbss to allow space for embedded apps (like the installer), fix some stupid bugs
Modified paths:
  • /embios/trunk/init.c (modified) (history)
  • /embios/trunk/target/ipodnano2g/ls.x (modified) (history)
  • /embios/trunk/target/ipodnano4g/ls.x (modified) (history)

Diff [purge]

Index: embios/trunk/init.c
@@ -99,7 +99,7 @@
100100 if (ucl_decompress(addr, size, &_initstart, (uint32_t*)&size)) goto dataflashfailed;
101101 }
102102 else if (read(fd, &_initstart, size) != size) goto dataflashfailed;
103 - if (execimage(&_initstart) < 0) return;
 103+ if (execimage(&_initstart) >= 0) return;
104104 }
105105 dataflashfailed:
106106 #endif
@@ -114,14 +114,14 @@
115115 if (bootinfo.bootflashflags & 1)
116116 {
117117 if (ucl_decompress(addr, size, &_initstart, (uint32_t*)&size)) goto bootflashfailed;
118 - if (execimage(&_initstart) < 0) return;
 118+ if (execimage(&_initstart) >= 0) return;
119119 }
120120 else if (bootinfo.bootflashflags & 2)
121121 {
122122 memcpy(&_initstart, addr, size);
123 - if (execimage(&_initstart) < 0) return;
 123+ if (execimage(&_initstart) >= 0) return;
124124 }
125 - else execimage(addr);
 125+ else if (execimage(addr) >= 0) return;
126126 #else
127127 if (bootinfo.bootflashflags & 1)
128128 {
@@ -132,7 +132,7 @@
133133 }
134134 else if (bootflash_read(bootinfo.bootimagename, &_initstart, 0, size) != size)
135135 goto bootflashfailed;
136 - if (execimage(&_initstart) < 0) return;
 136+ if (execimage(&_initstart) >= 0) return;
137137 #endif
138138 }
139139 bootflashfailed:
@@ -140,18 +140,18 @@
141141 if (bootinfo.trymemmapped)
142142 {
143143 int size = bootinfo.memmappedsize;
144 - if (bootinfo.bootflashflags & 1)
 144+ if (bootinfo.memmappedflags & 1)
145145 {
146146 if (ucl_decompress(bootinfo.memmappedaddr, size, &_initstart, (uint32_t*)&size))
147147 goto memmappedfailed;
148 - if (execimage(&_initstart) < 0) return;
 148+ if (execimage(&_initstart) >= 0) return;
149149 }
150 - else if (bootinfo.bootflashflags & 2)
 150+ else if (bootinfo.memmappedflags & 2)
151151 {
152152 memcpy(&_initstart, bootinfo.memmappedaddr, size);
153 - if (execimage(&_initstart) < 0) return;
 153+ if (execimage(&_initstart) >= 0) return;
154154 }
155 - else if (execimage(bootinfo.memmappedaddr) < 0) return;
 155+ else if (execimage(bootinfo.memmappedaddr) >= 0) return;
156156 }
157157 memmappedfailed:
158158 if (bootinfo.trydataflash || bootinfo.trybootflash || bootinfo.trymemmapped)
Index: embios/trunk/target/ipodnano2g/ls.x
@@ -6,9 +6,10 @@
77 MEMORY
88 {
99 INIT : ORIGIN = 0x08000000, LENGTH = 0x01eff000
10 - INITSTACK : ORIGIN = 0x09eff000, LENGTH = 0x00001000
 10+ INITBSS : ORIGIN = 0x09e00000, LENGTH = 0x0017f000
 11+ INITSTACK : ORIGIN = 0x09f7f000, LENGTH = 0x00001000
1112 SRAM : ORIGIN = 0x22000000, LENGTH = 0x0002bdf0
12 - SDRAM : ORIGIN = 0x09f00000, LENGTH = 0x00100000
 13+ SDRAM : ORIGIN = 0x09f80000, LENGTH = 0x00100000
1314 }
1415
1516 SECTIONS
@@ -61,7 +62,7 @@
6263 . += 0x400;
6364 _initstackend = .;
6465 _initbssend = .;
65 - } > INIT
 66+ } > INITBSS
6667
6768 .ibss (NOLOAD) :
6869 {
Index: embios/trunk/target/ipodnano4g/ls.x
@@ -6,9 +6,10 @@
77 MEMORY
88 {
99 INIT : ORIGIN = 0x08000000, LENGTH = 0x01eff000
10 - INITSTACK : ORIGIN = 0x09eff000, LENGTH = 0x00001000
 10+ INITBSS : ORIGIN = 0x09e00000, LENGTH = 0x0017f000
 11+ INITSTACK : ORIGIN = 0x09f7f000, LENGTH = 0x00001000
1112 SRAM : ORIGIN = 0x22000000, LENGTH = 0x00030000
12 - SDRAM : ORIGIN = 0x09f00000, LENGTH = 0x00100000
 13+ SDRAM : ORIGIN = 0x09f80000, LENGTH = 0x00100000
1314 }
1415
1516 SECTIONS
@@ -61,7 +62,7 @@
6263 . += 0x400;
6364 _initstackend = .;
6465 _initbssend = .;
65 - } > INIT
 66+ } > INITBSS
6667
6768 .ibss (NOLOAD) :
6869 {