Commit 71bf193a authored by Stewart Brodie's avatar Stewart Brodie
Browse files

AIF image header checks improved.

Detail:
  AIF headers declare how much space they are going to need in addition
    to the size of the executable on the filesystem.  This information
    is now extracted by FileSwitch to validate that the memory limit
    will not be exceeded.
Admin:
  Built.  Not tested.


Version 2.61. Tagged as 'FileSwitch-2_61'
parent 4b9cb9e9
......@@ -11,14 +11,14 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.60"
Module_Version SETA 260
Module_MajorVersion SETS "2.61"
Module_Version SETA 261
Module_MinorVersion SETS ""
Module_Date SETS "14 May 2001"
Module_ApplicationDate2 SETS "14-May-01"
Module_ApplicationDate4 SETS "14-May-2001"
Module_Date SETS "30 May 2001"
Module_ApplicationDate2 SETS "30-May-01"
Module_ApplicationDate4 SETS "30-May-2001"
Module_ComponentName SETS "FileSwitch"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/FileSwitch"
Module_FullVersion SETS "2.60"
Module_HelpVersion SETS "2.60 (14 May 2001)"
Module_FullVersion SETS "2.61"
Module_HelpVersion SETS "2.61 (30 May 2001)"
END
/* (2.60)
/* (2.61)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 2.60
#define Module_MajorVersion_CMHG 2.61
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 May 2001
#define Module_Date_CMHG 30 May 2001
#define Module_MajorVersion "2.60"
#define Module_Version 260
#define Module_MajorVersion "2.61"
#define Module_Version 261
#define Module_MinorVersion ""
#define Module_Date "14 May 2001"
#define Module_Date "30 May 2001"
#define Module_ApplicationDate2 "14-May-01"
#define Module_ApplicationDate4 "14-May-2001"
#define Module_ApplicationDate2 "30-May-01"
#define Module_ApplicationDate4 "30-May-2001"
#define Module_ComponentName "FileSwitch"
#define Module_ComponentPath "RiscOS/Sources/FileSys/FileSwitch"
#define Module_FullVersion "2.60"
#define Module_HelpVersion "2.60 (14 May 2001)"
#define Module_FullVersion "2.61"
#define Module_HelpVersion "2.61 (30 May 2001)"
......@@ -343,6 +343,31 @@ Run_UndatedFile
MOV r1, r0 ; NB. Our strings are all dead now
BL SkipOverNameAndSpaces ; r1 -> copy of command tail
;Check absolute AIF image memory limits
CMP r2, #&8000
BNE %FT71
LDR lr, [r2, #&0C]
AND r12, lr, #&FF000000
TEQ r12, #&EB000000 ; is this instruction a branch
BNE %FT71 ; nope - not executable AIF then
LDR lr, [r2, #&10]! ; should be SWI OS_Exit (&EF000011 for AIF), R2 := R2 + 16
MOV r12, #&EF000000
ORR r12, r12, #&00000011
TEQ lr, r12 ; OS_Exit check worked?
LDMEQIB r2, {r0,r1,r12,lr} ; load RO size, RW size, Debug size, ZI size
SUB r2, r2, #&10 ; R2 := &8000
BNE %FT71 ; not AIF then
ADD r0, r0, r1 ; R0 := read only + read write
ADD r12, r12, lr ; R12 := debug + zero init
ADD r0, r0, r12 ; R0 := read only + read write + debug + zero init
ADD r5, r2, r0 ; R5 := base address + size required
BL ValidateR2R5_WriteToCoreCodeLoad
BVS RunExit_FF
71
[ StrongARM
;Check whether it's a squeezed app.
CMP r2, #&8000
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment