www.beck-ipc.comwww.beck-ipc.com  | ImprintImprint
FAQFAQ  | SearchSearch  |

Prüfsumme bei Programm im RAM

Questions and discussions about the operating system RTOS and the corresponding C-LIB.

ich möchte die Prüfsumme des Programmcodes einer laufenden Applikation im RAM überprüfen.
Wie bekomme ich hierfür die Anfangs- und Endadresse des Programmcodes im RAM?

Thomas Rebhan

I thought this question would be easy to answer. But after looking at Rtl\Source\Startup\co.asm it appears we have not made this easy to solve. More section marking public symbols with a leading underscore for C language to access would have made life easier.

For a rough cut, you could define some far constant in your C program that the linker will be placed here after the _TEXT section (and after large model series of TEXT* segments, one per compilation unit) ...

Code: Select all
                public FARCONSTSEG
FARCONSTSEG     label   byte
                public FARDATASEG
FARDATASEG      label   byte

Or some assembly language function could return the FARCONSTSEG symbol's address to your C program.

These list of segment definitions are from the c0.asm file. You are free to link into your program a custom c0.asm, if you wanted to add more public symbols here. The Paradigm target expert has some option for this.

Beware that a checksum computed at build time on your build station over the EXE would be affected by the segment relocations that occur when the program is loaded. And beware that dynamically linked Beck library functions will also cause code modifications. And so do debugger software breakpoints.

Code integrity checking is a difficult problem.
Jack Gatrost
Software Development
Beck IPC GmbH

Return to RTOS

Who is online

Users browsing this forum: No registered users and 1 guest