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

Prüfsumme bei Programm im RAM

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

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?

mfg
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
_TEXT           SEGMENT PAGE PUBLIC 'CODE'
                ENDS
_FARCONST       SEGMENT PAGE PUBLIC 'FAR_CONST'
                public FARCONSTSEG
FARCONSTSEG     label   byte
                ENDS
_FARDATA        SEGMENT PAGE PUBLIC 'FAR_DATA'
                public FARDATASEG
FARDATASEG      label   byte
                ENDS


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


cron