kkman20xx
Posts: 14
Joined: Mon Mar 05, 2012 3:47 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 12:59 am

It is all very well about how code should be written but when you look at the target purpose of the Pi then you realise its limitation/simplexity is its strength.

Also there will never be enough RAM, you will just have to work with the limitations.  If it is too little for you then Pi is not a suitable platform to do the things you wanted to do.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27422
Joined: Sat Jul 30, 2011 7:41 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 10:10 am

tbgclark said:


tufty said:


Joe Schmoe said:


"Write clean, obvious code that any moron [aka, the next 'maintenance programmer' we hire] can follow and modify"


You'll probably find that the maintenance programmer is vastly more intelligent than you are.


Having written code that has needed maintaining, I generally find the maintenance programmer is less intelligent. Because it's usually me a few years later having lost many brain cells in the interim That's why I stopped writing write-only code not too far into the 43 years I've been coding.

Aim to produce elegant code, and the result almost automatically will be free of all vices: readable, meet well established coding principles, and not be profligate with resources. It may need forethought, but it pays off when you find it needs very little debugging and is much more satisfying. And surely that's what we all hope of the project: that it develops programmers who can fell pride in producing something well designed, or simply elegant.


Agreed. I also pack my code with comments and try to write it as clearly as possible, because I know, at some point, I'm going to need to come back to it for some reason. And I am the one who is going to need all those comments. But then, I've been programming for 25 years, and have to come back to old code a LOT of times. Experience counts here.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

knobby67
Posts: 40
Joined: Fri Mar 09, 2012 9:18 am

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 10:15 am

I think it's easy to go on about the good old days, I learnt to programme assembler on the BBC B.  However in those days you weren't linking in libraries or loading hi-rez images.  So it's not just a case of how big your code is it's what's running with it.

colin B
Posts: 119
Joined: Sun Mar 04, 2012 12:23 pm
Contact: Website

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 10:43 am

I made a moving forward total stock control program for 700 lines of stock covering a period of 26 weeks with a lowly Spectrum 128, this code originaly was on a ZX80 16K wobbly. True the damn thing got very hot and would often freeze, but that basic code fitted into the 128K with room to spare - certainly couldn't get a modern program into anything like that.
On a clear disk one can seek forever

User avatar
grumpyoldgit
Posts: 1452
Joined: Thu Jan 05, 2012 12:20 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 10:46 am

Wouldn't that have been the ZX81 with the 16k wobbly rampack?

colin B
Posts: 119
Joined: Sun Mar 04, 2012 12:23 pm
Contact: Website

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 10:52 am

Grumpyoldgit said:


Wouldn't that have been the ZX81 with the 16k wobbly rampack?



Yes it would have been.
On a clear disk one can seek forever

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 12:02 pm

There was a chess program available for the ZX80. That's in 1k. I understand that it played a fair game, but did not try to trap illegal moves.

User avatar
Jongoleur
Posts: 1179
Joined: Thu Aug 11, 2011 12:47 pm
Location: O'erlooking the sea, and all those effin windfarms...

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 12:14 pm

bodgyuk said:


Grumpyoldgit said:


Wouldn't that have been the ZX81 with the 16k wobbly rampack?


Yes it would have been.



You only had WobblyRAMPack once.  After you lost an entire evenings work due to your mum putting a mug of Ovaltine down too heavily next to your ZX81, you went out THE NEXT DAY and bought a small packet of BluTak.

A sausage of that between the RAM pack and the back of the ZX81 cured wobble permanently!

I'm just a bouncer, splatterers do it with more force.....

Smartybones
Posts: 176
Joined: Wed Feb 08, 2012 5:03 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 12:22 pm

Jongoleur said:


You only had WobblyRAMPack once.  After you lost an entire evenings work ........, you went out THE NEXT DAY and bought a small packet of BluTak.

A sausage of that between the RAM pack and the back of the ZX81 cured wobble permanently!




my particular solution was a little more permanent. In a rage after loosing code for the 3rd time that night I had some Araldite on my desk (I had just finished fixing a couple of loose eyes on my fishing rod)

that sucker never "wobbled" again !

as for the chess games, my first test for any computer chess was to see if it had been programmed to watch for the fools mate move. Most didn't some still dont.

Smartybones
Posts: 176
Joined: Wed Feb 08, 2012 5:03 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 1:03 pm

back to the optimizing code conundrum,

Its all well and good writing code that is so full of comments notes that 10 years later you can go back and fix something, or add a new feature, or even someone else can..

I haven't had my programmers hat on for quite a while, I got sick of writing front ends for access databases, my boss just dismissed a php/mysql out of hand, so I ended up dismissing myself before I needed powerful prescription medication and a jacket that fastened up at the back.

When I was ready to compile, i used to go through and remove all comments and notes, getting that source as small as I could before compiling to an executable. Even though the comments were supposed to be ignored, the exec allways ended up  little smaller (and  quicker) than if I left the comments in. I could never understand why as the compiler was supposed to ignore comments!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27422
Joined: Sat Jul 30, 2011 7:41 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 1:13 pm

Smartybones said:


I could never understand why as the compiler was supposed to ignore comments!


Because the compiler was crap?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

chorlton
Posts: 50
Joined: Mon Feb 06, 2012 1:57 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 1:47 pm

Smartybones said:

When I was ready to compile, i used to go through and remove all comments and notes, getting that source as small as I could before compiling to an executable. Even though the comments were supposed to be ignored, the exec allways ended up  little smaller (and  quicker) than if I left the comments in. I could never understand why as the compiler was supposed to ignore comments!
What were you using? Because any C/C++ language runs the code through a pre-processor who's specific function is to replace macros and remove comments. You can set the compilation steps to not delete the intermediate files and view those pre-processed files which should look like what you did manually?

Try it again. Go on, you know you want to. Put the hat back on.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 2:23 pm

Actually, executable smaller is not outside the realm of possibility.  You never know.

The C standards jockeys will certainly tell you that there is no requirement for a pre-processor to remove comments (the "as if" rule, and all that).  Though, of course, most implementations do do exactly that.

But faster executing?  That seems strange.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Adding more RAM - presumably impossible?

Wed Mar 14, 2012 2:55 pm

Just curious if it really was the executable that was really shorter or if it just was the .elf file which was shorter.

User avatar
rew
Posts: 438
Joined: Fri Aug 26, 2011 3:25 pm

Re: Adding more RAM - presumably impossible?

Sat May 26, 2012 5:03 pm

Back to adding more RAM.....

How are the chances of a Samsung K4P8G304EB-AG 1Gigabyte chip working instead of the K4P2G324ED-AG that I have on there now?

Both are 1.2V, (I thought the RAM was powered at 1.8V, but apparently there is some 1.2/1.8V hybrid scheme) 168 FBGA, 12x12, 1chx32 POP memories.

Hmm. The 8G version is "QDP, whereas the 2G has no marking there.

Hmm. The 8G has 2CS, 2CKE, which the 2G chip doesn't...

There is at least a 4G version that looks more compatible: K4P4G324EB-AG, this would give us 512Mbyte of memory.

I can't find any public datasheets on any of these chips. :-(
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Adding more RAM - presumably impossible?

Sat May 26, 2012 6:00 pm

Joe Schmoe wrote:Actually, executable smaller is not outside the realm of possibility.  You never know.

The C standards jockeys will certainly tell you that there is no requirement for a pre-processor to remove comments (the "as if" rule, and all that).  Though, of course, most implementations do do exactly that.

But faster executing?  That seems strange.
The C preprocessor does not remove comments.

However, the compiler ignores them completely. There is no compiler flag that says 'keep my comments in the executable'. Comments are a source code annotation, and that's all. By the time you've got to the object code stage, they are gone. No more. Pining for the fjords, etc.

Comment your code with impunity. It doesn't affect object code size, it doesn't affect execution speed.

Simon

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27422
Joined: Sat Jul 30, 2011 7:41 pm

Re: Adding more RAM - presumably impossible?

Sat May 26, 2012 6:17 pm

rew wrote:Back to adding more RAM.....

How are the chances of a Samsung K4P8G304EB-AG 1Gigabyte chip working instead of the K4P2G324ED-AG that I have on there now?

Both are 1.2V, (I thought the RAM was powered at 1.8V, but apparently there is some 1.2/1.8V hybrid scheme) 168 FBGA, 12x12, 1chx32 POP memories.

Hmm. The 8G version is "QDP, whereas the 2G has no marking there.

Hmm. The 8G has 2CS, 2CKE, which the 2G chip doesn't...

There is at least a 4G version that looks more compatible: K4P4G324EB-AG, this would give us 512Mbyte of memory.

I can't find any public datasheets on any of these chips. :-(
Might work, might not. But it is a lot more expensive!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
jojopi
Posts: 3353
Joined: Tue Oct 11, 2011 8:38 pm

Re: Adding more RAM - presumably impossible?

Sat May 26, 2012 6:29 pm

tufty wrote:The C preprocessor does not remove comments.

Code: Select all

echo "The C preprocessor does /*not*/ remove comments." |cpp

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Adding more RAM - presumably impossible?

Sat May 26, 2012 6:42 pm

jojopi wrote:
tufty wrote:The C preprocessor does not remove comments.

Code: Select all

echo "The C preprocessor does /*not*/ remove comments." |cpp
Woops. Is there a "shuffles off and hopes nobody notices" emoticon on here?

Still, the point remains. Comment your code. Removing comments is not an "optimisation".

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Adding more RAM - presumably impossible?

Sun May 27, 2012 12:27 am

rew wrote:Back to adding more RAM.....

How are the chances of a Samsung K4P8G304EB-AG 1Gigabyte chip working instead of the K4P2G324ED-AG that I have on there now?
On other embedded-linux projects I've seen where a "larger but compatible" RAM chip has been soldered in place of the old chip, it's always needed a new version of the bootloader to make this extra memory usable by the OS (otherwise it just appears the same size as the old RAM). And on the RPi the bootloader runs on the GPU, so there's no way you're going to be able to modify it...

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Adding more RAM - presumably impossible?

Sun May 27, 2012 12:51 am

AndrewS wrote: On other embedded-linux projects I've seen where a "larger but compatible" RAM chip has been soldered in place of the old chip, it's always needed a new version of the bootloader to make this extra memory usable by the OS (otherwise it just appears the same size as the old RAM). And on the RPi the bootloader runs on the GPU, so there's no way you're going to be able to modify it...
Not that I claim to actually know anything about this, but I think that one or both of the following are true:

1) That even though us mere mortals couldn't possibly get access to or any knowledge of or any update of "the blob", that there do exist certain Foundation members or associates who are in good enough with Broadcom that they could get it for us - especially if the change were trivial.

2) That it might, in fact, be as simple as poking in a new value (hacking the binary, as they call it...) in some specific locations. Somebody here on the forum did some research/hacking/reverse-engineering of the blob (aka "start.elf") and figured out that the memory size exists in a few certain places in the blob. Hacking those values may be all that's needed to support memory > 256M.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Adding more RAM - presumably impossible?

Sun May 27, 2012 1:51 am

Joe Schmoe wrote:Not that I claim to actually know anything about this, but I think that one or both of the following are true:
Not that I'm disagreeing with what you've said but:
1) That even though us mere mortals couldn't possibly get access to or any knowledge of or any update of "the blob", that there do exist certain Foundation members or associates who are in good enough with Broadcom that they could get it for us - especially if the change were trivial.
In the "Ask Eben" video he says the Foundation is keen to stick to 256MB of memory as a consistent baseline. So I doubt the foundation would want to 'enable' the confusion of having "some" (albeit hacked) Raspis with more than that?
2) That it might, in fact, be as simple as poking in a new value (hacking the binary, as they call it...) in some specific locations. Somebody here on the forum did some research/hacking/reverse-engineering of the blob (aka "start.elf") and figured out that the memory size exists in a few certain places in the blob. Hacking those values may be all that's needed to support memory > 256M.
Assuming there's no checksumming/signing in place to prevent tampering ;)
I did a (tiny) bit of start.elf reverse-engineering too http://www.raspberrypi.org/phpBB3/viewt ... 026#p82026

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13374
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Adding more RAM - presumably impossible?

Sun May 27, 2012 1:52 am

For a 512 MB model to exist, it must be made first, its all and well to speculate what would be needed to "get it working", but I assume the answer would be "nothing".
I assume that the SoC has all the signals to its top solder balls present so that a 512MB RAM chip could be placed, and connected up, but it takes very special equipment to actually solder the two chips together, and it almost (in the sense of "maybe NASA can do it") certainly cannot be an "upgrade" of an existing package on package module.

In other words, when the RPF releases an 512MB model, then (and not before that) we will have a 512MB model. If anything else is "needed" (which I doubt) to get it to work the RPF will have done it.

User avatar
rew
Posts: 438
Joined: Fri Aug 26, 2011 3:25 pm

Re: Adding more RAM - presumably impossible?

Sun May 27, 2012 4:03 am

AndrewS wrote: And on the RPi the bootloader runs on the GPU, so there's no way you're going to be able to modify it...
I have been able to poke at the binary to make it start up with "unsupported" memory configurations. I've had my 'pi run with 208/48 memory split. So why wouldn't it be possible to poke at it and run with 512MB? It's a lot harder, than what I did, but it can be done. And I'll bet you can get JamesH or Dom to recompile the blob by sending them a modified 'pi.

Anyway.... I found an online quote for the 4Gb chip for $11. The 8Gb (1 gigabyte) one costs $495!. That's a bit too expensive. :-)

@mahjongg, I'd do the "surgery" once the queue clears. The guys at broadcom simply don't have the experience of doing such things yourself. On a bunch of hobbyist forums I've similarly seen people shy away from SMD soldering. Until you've done it, you don't know how easy it is.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Adding more RAM - presumably impossible?

Sun May 27, 2012 6:25 am

First of all I see a problem removing the RAM without pulling the underlying processor package. But if you could you would needed to clean up the processor. The new memory package should have solder balls on it. Without cleaning you would end up with too much solder and end up with cross connections. I do not know if the GPU can be updated (as firmware?) while on the board, but I am guessing it can. You will not have access to that software. So you would have to get a co-conspirator at the foundation to update the settings of the GPU bootloader. Redoing a start.elf appears to be possible.

So anyone have a guess as to how many RasPii will have to throw themselves under the bus for this project to be successful?

One little twitch of the processor, during memory removal, and it may be out of alignment and useless. The same with the memory package. I cannot see any way to clamp the underlying processor package. By the time you have enough heat to get the memory off the processor will probably be moving too. Do not get me wrong I am all for this project, but let's be honest in the hurdles that have to be faced. If high-temp silicone would not damage the PCB, or traces it might, just might, hold the processor package in place during the reheat and removal. Depends on whether any of the processor package is visible or not. Just a possibility.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

Return to “General discussion”