Memory Management - Code And Large Flash Objects

Official FreeEMS vanilla firmware development, the heart and soul of the system!
MotoFab
1N4001 - Signed up
Posts: 307
Joined: Thu May 29, 2008 1:23 am
Location: Long Beach CA

Re: Memory Management - Code And Large Flash Objects

Post by MotoFab »

Fred wrote:Fortunately the compiler takes care of both moving to the page IF required and moving back to the caller page afterwards IF required.
I've been thinking about the automatic-ness of compiler page switching since you mentioned it, Fred. I cannot imagine how the compiler accomplishes that. I mean, processor page switching and return is a dynamic process. And the need for page switching depends on which instruction (memory page) the processor is executing at the time the call is made.

The compiler can be set up to add additional duplicate instructions to the source code before every call. Instructions for the processor to determine what memory page it's on, and then switch pages if needed. But that process occurs inside the EMS processor while running the program and operating the motor.

Granted, I may not be understanding the relevant issues. Or maybe you were just talking about the compiler adding those duplicate instructions to the source code before every call instruction, before it compiles. Or maybe there's a method of writing code that is fully 'deterministic'. I've learned a few things about coding methodologies from you and from this forum.

- Jim
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Memory Management - Code And Large Flash Objects

Post by Fred »

MotoFab wrote:I've been thinking about the automatic-ness of compiler page switching since you mentioned it, Fred. I cannot imagine how the compiler accomplishes that.
Quit thinking about it and RTFM :-)
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
MotoFab
1N4001 - Signed up
Posts: 307
Joined: Thu May 29, 2008 1:23 am
Location: Long Beach CA

Re: Memory Management - Code And Large Flash Objects

Post by MotoFab »

Heh heh. You mean for the compiler? If you can point me to a link or thread I'd appreciate it. You're using Linux and I have an XP box, so I did not follow along with how your development environment is set up. Along those lines, has anyone set up an open source Windows environment for the EWS? Thanks.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Memory Management - Code And Large Flash Objects

Post by Fred »

DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
MotoFab
1N4001 - Signed up
Posts: 307
Joined: Thu May 29, 2008 1:23 am
Location: Long Beach CA

Re: Memory Management - Code And Large Flash Objects

Post by MotoFab »

Thanks for the links, Fred. That section explained the linker function nicely.

- Jim
Post Reply