[MOD] 10MB RAM Increase kernels/boot.img for Dream and Magic 32B[01/13]

Search This thread

daproy

Senior Member
Dec 3, 2008
166
1
The original thread troubleshooting and creating this patch can be found here

Kernel source for the boot.img I post here can be found here. The patch is here.

Discussion on whether to include this in future Cyanogen Mods can be found here

By modifying the memory map in the kernel we are able to increase the amount of usable linux memory by 10MB bringing the mapped LINUX ram to 110MB (minus kernel used memory making it around 107MB).

The patch moves the ram console and framebuffer memory to SMI on chip and changes the GPU1 ram from 8MB to 0MB. GPU0 still has 7MB mapped in SMI so only 3D intensive applications and games seem to suffer after this patch. The benefit is more RAM memory for linux to use. Several people have reported system performance improvements at the sacrifice of 3D graphics applications.

Note: you will not see extra ram under in recovery since it uses it's own (unpatched) kernel to boot.

CM 4.2.14.1 CFS boot.img
MD5SUM fd12d3635858d1da00e2590566b73564
http://www.mediafire.com/?aydmodmkdqk
http://www.sendspace.com/file/uqcy2e

CM 4.2.13 CFS boot.img by pershoot
http://rapidshare.com/files/334987707/boot-4213-dp_mem.zip
http://www.sendspace.com/file/9dvmvi

CM 4.2.13 CFS boot.img
MD5SUM be744f56306f1733ccabe48d4c8c974e
http://www.mediafire.com/?1hnzmnmfw2j
http://www.sendspace.com/file/t0sdkx

CM 4.2.13 BFS-313 boot.img
MD5SUM a82f08a68ec393f0d8bee416588d5b16
http://www.mediafire.com/?xwkeoidw52z
http://www.sendspace.com/file/2nmh6a

CM 4.2.12.2 CFS boot.img
MD5SUM 27601954b73c857ff6b70d112667ca69
http://www.mediafire.com/?ouzmzygguxz

CM 4.2.12.2 BFS-313 boot.img
MD5SUM c8d6a1aa4ad853406b3dd4bb683e043d
http://www.mediafire.com/?5noz0njajiz

CM 4.2.11.1 BFS-313 boot.img with ext fix
MD5SUM 70a1ce95a9017de62d7276a84e58e804
http://www.mediafire.com/?nodemj2xnet

CM 4.2.11.1 BFS-313 boot.img
MD5SUM 7fe910461d09d84b1a856de926e29311
http://www.mediafire.com/?z5tnmnmg4rq

CM 4.2.11.1 CFS boot.img
MD5SUM a5b229fc4704b8dbb1c12af170fd95e1
http://www.mediafire.com/?yyxzmyewjtq

CM 4.2.9.1 BFS-311 boot.img
MD5SUM 0582eb144c761d46fd097960ab9ce2c5
http://www.mediafire.com/?djvmmkozzkz

CM 4.2.9.1 CFS boot.img
MD5SUM 45fee1ab029af69a521ddae2f7c36f91
http://www.mediafire.com/?nm2mnmdyiwu

CM 4.2.9 CFS boot.img by dumfuq
http://www.mediafire.com/?zmdmhjmyzjy

CM 4.2.8 BFS-311 boot.img
http://www.mediafire.com/?fm1yngfm4fz
MD5SUM 72e990cf1bdeb9cc2e2c61f658fbc0dd

CM 4.2.8 CFS boot.img
http://www.mediafire.com/?xlwwmlzny2n
MD5SUM 9157e804c101bc41e4d4ce93f4466543

CM 4.2.7.1 BFS-311 boot.img
http://www.mediafire.com/?2mjywndydz1
MD5SUM 6a19bb778e912ef2ec8d53a2cbd4305e

CM 4.2.7.1 CFS boot.img by dwang
http://drop.io/f2hwhjz#

CM 4.2.6 BFS-311 boot.img
http://www.mediafire.com/?djmrreijnzk
MD5SUM bd4fc8d8bb25f326bcfa08fa30c1199d

CM 4.2.6 CFS boot.img
http://www.mediafire.com/?uzbnnmz124j
MD5SUM a7f8d6882abc9d583abe1aff46f8656b

CM 4.2.6 CFS boot.img by dumfuq
http://www.mediafire.com/?2gtjwngtydn

CM 4.2.5 CFS boot.img by dwang
http://drop.io/ga5vgpk#

CM 4.2.4 CFS boot.img
http://www.mediafire.com/?ndmjkk2zmga
MD5SUM 9672701c93db85da3e98755a7c12eb3d

CM 4.2.3.1 CFS boot.img
http://www.mediafire.com/?tzdnyjyg4iq
MD5SUM e874ada3f78fb709814e7e65ebc1e7f3

CM 4.2.1 BFS-304 boot.img
http://www.mediafire.com/?2znaudyduy3
MD5SUM 8c0e51737dc19ed192572b2f51c99bca

CM 4.2.1 CFS boot.img
http://www.mediafire.com/?tm5jbqv1ouf
MD5SUM eb7107ebb2025ce517b1af308de2fb28

CM 4.1.9999 BFS-304 boot.img
http://www.mediafire.com/?emeyhmzmqiz
MD5SUM c3f76045c7737d99f50518cb912f0f08

CM 4.1.999 BFS-303 boot.img packed by statickaos
https://home.statickaos.net/public/boot-new.img

CM 4.1.99 BFS-303 boot.img
http://www.mediafire.com/?nnk2mtiuioi
MD5SUM 8b11ace91c745138cde58b4bd1d7848a

CM 4.1.99 BFS-302 boot.img
http://www.mediafire.com/?ndwmmw2ti2y
MD5SUM 80cda08de15da8af824ffcb665c21c2f

CM 4.1.99 BFS-300 boot.img
http://www.mediafire.com/?mtlujofbkml
MD5SUM bc8c356d1b97c7c0ebc46c50a03b9eaa

CM 4.1.11.1 BFS-302 boot.img
MD5SUM 9d7f189db371ac3cc8ac7845d513be50
http://www.mediafire.com/?emzyyk5zwve

CM 4.1.11.1 BFS-300 boot.img
MD5SUM ab8978a92436f600ecd05fbf7ddbf027
http://www.mediafire.com/?yztwczjnzgo

CM 4.1.11.1 kernel boot.img
MD5SUM 9e49829ad466b2f3adf9402bcba9c9c0
http://www.mediafire.com/?dvwmwyit4yn
http://drop.io/mempatch

CM 4.1.11.1 kernel with CFS instead of BFS boot.img (by dumfuq only for Dream)
http://www.mediafire.com/?nzyg1f4jniu

CM 4.0.4 kernel boot.img (by dumfuq only for Dream)
http://www.mediafire.com/?12xboktlldj

HTC sourced kernel (by cyrowski and jac)
http://xdaforums.com/showthread.php?t=534479

Stock Android 1.6 Kernel (by dwang)
http://xdaforums.com/showthread.php?t=566676

Installation Instructions where boot.img is the name of the boot.img you download

As suggested by IConrad01 it is advisable to test a new boot.img before flashing it with:

Code:
fastboot boot boot.img

Make a nandroid backup before installing or download the stock boot.img to go back.

Fastboot Install

Code:
fastboot flash boot boot.img
fastboot reboot

Terminal Emulator Install

Copy the boot.img to the root of your sdcard. Then issue these commands from the terminal emulator.

Code:
su
flash_image boot /sdcard/boot.img
reboot

Check Linux Memory from Terminal Emulator

free or cat /proc/meminfo

Check Linux Memory from ADB

adb shell free or adb shell cat /proc/meminfo

Obviously, there is still room for improvement with this patch. Currently working on getting GPU1 RAM moved to SMI successfully and potentially accessing another 18MB of RAM if the specs on EBI memory are correct (128MB). Any ideas?
 
Last edited:

david1171

Senior Member
Apr 29, 2009
3,202
166
actually if you do the conversion from kilobytes, its roughly 105MB, but who's counting anyways? lol.

thanks daproy for the boost ;)

more=better, i have more then before; therefore, i am happy. :)

john has 2 apples; jill has 3 oranges; and bill has 4 stamps of acid, so the real question is, which 1 is your friend?

numbers are fun.
 
Last edited:

Booker-T

Senior Member
Jun 12, 2009
425
9
Great! I've been finding the patch for cm4.0.4 for a long time.

The performance improved is great but I just have 104mb ram......
 

skrki

Senior Member
Sep 1, 2009
416
2
Canberra
Just reporting:
Code:
              total         used         free
  Mem:       107292       105836         1456
 Swap:        30864         4356        26508
Total:       138156       110192        27964

Nice :D
Haven't flashed it yet, I'm just gonna monitor the behaviour for a while...
Thanks!!!!!
 

jokersax11

Inactive Recognized Developer
Aug 13, 2009
4,155
7,006
www.jokersax.com
some of the winmo mods had camera hacks and programs to set the ram to different settings without flashing all the time. how hard would it be to create a program that flashes the files necessary with the simple clicking of no extra gpu or default. also can we look into pulling from other sources this way like wifi and camera.
 

andonnguyen

Senior Member
Nov 12, 2008
842
3
some of the winmo mods had camera hacks and programs to set the ram to different settings without flashing all the time. how hard would it be to create a program that flashes the files necessary with the simple clicking of no extra gpu or default. also can we look into pulling from other sources this way like wifi and camera.

I don't think we'd be able to modify and recompile the kernel through an app on the phone.
 

Binary100100

Retired Forum Moderator
Apr 6, 2008
6,470
1,649
Detroit, Mi
Wow. What an increase. I'm a pretty heavy user so I'll update if I have any issues on 4.1.11.1.

BEFORE:
C:\Users\Greg\Desktop>adb shell free
total used free shared buffers
Mem: 97900 8860 89040 0 64
Swap: 0 0 0
Total: 97900 8860 89040

C:\Users\Greg\Desktop>adb shell reboot bootloader

C:\Users\Greg\Desktop>fastboot flash boot bootmem.img
sending 'boot' (2002 KB)... OKAY
writing 'boot'... OKAY

C:\Users\Greg\Desktop>fastboot reboot
rebooting...

AFTER:

C:\Users\Greg\Desktop>adb shell
# free
free
total used free shared buffers
Mem: 107292 11876 95416 0 952
Swap: 0 0 0
Total: 107292 11876 95416
#
 

IConrad01

Senior Member
Mar 13, 2009
219
2
Well, there's discussion in the include-in-Cyanogen area (instigated mostly by me) that's pushing for the idea of inclusion.

There seems to be a few options that could be taken to make this work.

1) We could, rather than simply allocating the GPU1 to 0 RAM, allocate its RAM to shared memory rather than none at all. This would make its RAM-"space" available when 3D games are /not/ in use. I don't know how easy that would be; conceivably it could be as simple as mounting the GPU1 as /dev/shm. No idea there. (We'd need some way to unmount as /dev/shm whenever the GPU1 is called for 3d games, in order to prevent errors.)

2) We could reduce the original filespace sizes for both GPU0 and GPU1, and give them both dedicated /dev/shm devices; or, to even go a step further, somehow "nest" /dev/shm within /dev/block/ramzswap0, for those who have it. If we could do that while keeping the compress/decompress on the CPU rather than GPU side, this would probably greatly extend the available memory and even increase graphical performance of the device -- at, of course, the cost of battery life in the form of processor load. Frankly, I don't think using traditional swap would be a good idea at all here; while a GPU could withstand nanosecond delays in data, I suspect the latency of millisecond delays would be above the threshold for human observation.

3) We could simply keep the patch as is, and do an active mount/unmount call whenever the GPU0 gets overburdened. This would be the "cleanest" of the three solutions, but would also limit the total available memory whenever the 3D graphics load gets heavy. It might also require game/app programmers to be aware of this so they establish the proper calls, unless it can be done on the device-side of things.

It is worth noting, once again, that I am /not/ a programmer -- I have no idea how difficult what I'm suggesting here is.
 

xile6

Senior Member
Dec 2, 2008
1,709
215
Dallas
CM 4.1.11.1 kernel boot.img
works on stock 1.6 just to let people know.
It also helps out with the browser not reloading so much
 

j8dailo

Senior Member
May 16, 2009
67
1
im not sure if i am doing this wrong but when i patched it and restart my phone...it just goes to a blank screen and stays there...