Commit daa8607f authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Update the method the Cortex kernel uses to determine the UtilityModule & ROM dates

  Three main changes:
  * On odd-numbered (i.e. development) versions of the module, the UtilityModule will now take its date from the VersionNum file instead of using a hard-coded date.
  * All build versions now look for the new "extended ROM footer" (as created by romlinker 0.04+) at the end of the ROM image and use it to determine the ROM build date for return by OS_ReadSysInfo 9,2. Failing to find the build date in the footer will cause OS_ReadSysInfo 9,2 to return 0.
  * On odd-numbered versions, OS_Byte 0 will now use the ROM build date (as found in the extended footer) to generate the error block that's returned to the user. This seems OK as the PRM describes OS_Byte 0 as returning the "creation date of the operation system". Plus it's a convenient way of getting the ROM build date into the Switcher, since the switcher uses OS_Byte 0. If the extended footer can't be found (or if the string hasn't been initialised yet, e.g. before Service_PostInit) the code falls back to a hard-coded string containing the date from the VersionNum file.
  File changes:
  Makefile - Updated to not create the obsolete Time+Date file (previously used for the ROM build date)
  Version - Use date from VersionNum file for development builds
  hdr/Options - New UseNewFX0Error variable/option to make it easy to check which OS_Byte 0 variant should be enabled
  hdr/KernelWS - Added new string buffers & extended ROM footer pointer to workspace
  s/Middle - Updated OS_ReadSysInfo 9 code, and added utility functions for searching the extended ROM footer for certain tags
  s/NewReset - Added a couple of calls to initialise the new string buffers just prior to Service_PostInit. This is required since OS_Byte/OS_ReadSysInfo shouldn't enable interrupts, but date conversion relies on the Territory module, which may enable interrupts.
  s/PMF/osbyte - Updated OS_Byte 0 code
  Tested in OMAP ROM, with and without the extended footer present.

Version 5.35, Tagged as 'Kernel-5_35-4_79_2_98_2_41'
parent 8df5d3f5
......@@ -133,12 +133,11 @@ ${GPADBG}: ${AIFDBG}
s.TMOSHelp: ${TOKENS} HelpStrs
${TOKENISE} ${TOKENS} HelpStrs $@
@echo |IGBLS Builddate|JBuilddate SETS "<Sys$Date> <Sys$Year>.<Sys$Time>" |J|IEND { > s.Time+Date }
settype s.Time+Date FFF
# @echo |IGBLS Builddate|JBuilddate SETS "<Sys$Date> <Sys$Year>.<Sys$Time>" |J|IEND { > s.Time+Date }
# settype s.Time+Date FFF
o.GetAll: s.TMOSHelp \
o.GetAll: s.TMOSHelp
# Exported interface headers
......@@ -16,12 +16,17 @@ Date SETS Module_Date ; version for STB/NC OS
Version SETA 517
VString SETS "5.17"
[ (Version :AND: 1) = 1
Date SETS Module_Date ; Odd-numbered (i.e. development) build, use
; date of last source checkin
Date SETS "19 Jan 2010" ; version for RISC OS on desktop computers
; you may also wish to update the welcome
; and OS information dialogue box templates
; in the sources for Desktop and Switcher
; (especially for year change)
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS ""
Module_Date SETS "24 Jul 2011"
Module_ApplicationDate SETS "24-Jul-11"
Module_MinorVersion SETS ""
Module_Date SETS "31 Jul 2011"
Module_ApplicationDate SETS "31-Jul-11"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 ("
Module_HelpVersion SETS "5.35 (24 Jul 2011)"
Module_FullVersion SETS "5.35 ("
Module_HelpVersion SETS "5.35 (31 Jul 2011)"
......@@ -5,19 +5,19 @@
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 24 Jul 2011
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 31 Jul 2011
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion ""
#define Module_Date "24 Jul 2011"
#define Module_MinorVersion ""
#define Module_Date "31 Jul 2011"
#define Module_ApplicationDate "24-Jul-11"
#define Module_ApplicationDate "31-Jul-11"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 ("
#define Module_HelpVersion "5.35 (24 Jul 2011)"
#define Module_FullVersion "5.35 ("
#define Module_HelpVersion "5.35 (31 Jul 2011)"
#define Module_LibraryVersionInfo "5:35"
......@@ -1317,6 +1317,8 @@ AplWorkSize * AppSpaceDANode + DANode_Size
EnvString # 256
ExtendedROMFooter # 4 ; Pointer to the extended ROM footer structure. 0 if not initialised, -1 if not found.
[ :DEF: ShowWS
! 0, "Free space after EnvString = ":CC::STR:(&500-@)
......@@ -1939,6 +1941,11 @@ GSVarWSpace # GSVarWSpace_Size
SysVarWorkSpace # 40 ; used by the sys$* variables for reading the current time into
ROMBuildDate # 128
[ UseNewFX0Error
NewFX0Error # 64
KbuffsEnd # 0
KbuffsSize * KbuffsEnd - KbuffsBaseAddress ;size of Kernel buffers area
......@@ -390,6 +390,9 @@ PollMouse SETL {FALSE} ; Poll mouse.
GBLL ProcessorVectors
ProcessorVectors SETL {TRUE} ; Processor vectors indirected through 0 page.
GBLL UseNewFX0Error
UseNewFX0Error SETL (:LNOT: Embedded_UI) :LAND: ((Version :AND: 1) = 1) ; Whether *FX 0 should show the ROM link date instead of the UtilityModule date
GBLS GetUnsqueeze
[ SqueezeMods
GetUnsqueeze SETS "GET s.Unsqueeze"
......@@ -1960,9 +1960,33 @@ osri6_maxvalue * (.-4-osri6_table) :SHR: 2
CMP R1, #0
ADREQ R0, RSI9_OSname ; The OS name
CMP R1, #2
ADREQ R0, RSI9_Builddate ; The build date (dynamically generated)
CMP R1, #2 ; The build date (dynamically generated)
MOVNE R0, #0 ; Other ones are unimplemented
LDR R0, =ROMBuildDate
LDRB R1, [R0]
CMP R1, #0
; Build date string hasn't been generated yet. Generate it.
Push "r0,r2-r3,lr"
MOV R0, #0
BL ExtendedROMFooter_FindTag
CMP R0, #0 ; Found it?
STREQ R0, [R13]
; For compatability, make this string match the same format as the old
; string. Conveniently, this matches the format string used by OS_Word
; 14
LDR R1, [R13]
MOV R2, #?ROMBuildDate
ADRL R3, TimeFormat
SWI XOS_ConvertDateAndTime
MOVVS R0, #0
STRVS R0, [R13]
Pull "r0,r2-r3,lr"
MOV R1, #2
......@@ -2032,9 +2056,82 @@ RSI_DebugRX
Pull "r1-r3,r9,r14"
GET s.Time+Date
; Extended ROM footer functions
; These operate on a new tag-based structure located at the end of the ROM
; image. Each entry consists of a one-byte ID, a one-byte length, and then N
; bytes of data. The length byte doesn't count the two initial header bytes.
; The end of the list is implicity terminated by a footer word; the footer word
; contains the length of the structure in the low two bytes (minus the length of
; the footer word), and a 16-bit CRC in the top two bytes (again, minus the
; footer word). The footer word will be word-aligned, but everything else is
; assumed to be byte aligned.
; Current tags:
; 0 ROM build date, stored as 5-byte time (length = 5)
ExtendedROMFooter_Find ROUT
; Find the header word for the extended ROM footer. Returns -1 if not found.
Push "r1-r4,lr"
LDR r4, =ZeroPage
LDR r0, [r4, #ExtendedROMFooter]
CMP r0, #0
; Examine the end of the ROM image
; Footer should be located just before the standard 20 byte footer
LDR r2, =ROM+OSROM_ImageSize*1024-24
LDR r1, [r2]
CMP r1, #-1
MOVEQ r0, r1
; Check CRC
MOV r1, r1, LSL #16
SUB r1, r2, r1, LSR #16
MOV r3, #1
MOVVS r0, #-1
LDR r1, [r2]
CMP r0, r1, LSR #16
MOVNE r0, #-1
MOVEQ r0, r2
STR r0, [r4, #ExtendedROMFooter]
Pull "r1-r4,pc"
ExtendedROMFooter_FindTag ROUT
; Find the tag number given in R0.
; Returns data pointer in R0 & length in R1 on success.
; Returns 0 in R0 (and corrupt R1) for failure.
Push "r2-r3,lr"
MOV r2, r0
BL ExtendedROMFooter_Find
CMP r0, #-1
MOV r3, r0
LDR r0, [r0]
MOV r0, r0, LSL #16
SUB r0, r3, r0, LSR #16
CMP r0, r3
LDRB lr, [r0], #1
LDRB r1, [r0], #1
CMP lr, r2
ADD r0, r0, r1
B %BT05
MOV r0, #0
Pull "r2-r3,pc"
RSI9_OSname = "$SystemName $VString",0
RSI9_Builddate = "$Builddate",0
......@@ -1919,6 +1919,22 @@ ResetPart1Done ; R0 is reset type
MOV R0, #FSControl_SelectFS ; set configured filing system
; OS_ReadSysInfo 9,2 now relies on the Territory module, which may
; enable IRQs. But the PRMs say OS_ReadSysInfo shouldn't alter the IRQ
; state. So call it once here just to initialise the string which it
; uses the Territory module to generate.
; This won't account for any modules using it during ModuleInit, but
; that should be pretty rare (or at least rare from within IRQ-sensitive
; code)
MOV R0, #9
MOV R1, #2
SWI XOS_ReadSysInfo
[ UseNewFX0Error
; Also, *FX 0
BL InitNewFX0Error
[ DebugROMInit
= "Service_PostInit",0
......@@ -231,13 +231,45 @@ Osbyte00 ROUT
TEQ R1, #0
MOVNE R1, #MosVer
MyOsbyte NE
[ UseNewFX0Error
LDR R0, =NewFX0Error
LDR LR, [R0]
CMP LR, #0
ADREQ R0, FX0Error ; Fall back to hardcoded string if new one isn't ready yet
ADR R0, FX0Error
SWI XOS_GenerateError
[ UseNewFX0Error
InitNewFX0Error ROUT
Push "r0-r4,lr"
MOV r0, #0
BL ExtendedROMFooter_FindTag
CMP r0, #0
MOV r1, r0
MOV r0, #-1
LDR r2, =NewFX0Error+4
MOV r3, #?NewFX0Error - 4
ADR r4, NewFX0ErrorFormat
SWI XTerritory_ConvertDateAndTime
; Fill in error number on success
LDRVC r2, =NewFX0Error
MOVVC r3, #&7F
STRVC r3, [r2]
Pull "r0-r4,pc"
& &F7
= "$MosTitle",0
[ UseNewFX0Error
= "$SystemName $VString (%dy %m3 %ce%yr)",0
; *****************************************************************************
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