Machine Type
Chris Hall (132) 3554 posts |
It would be nice to have a SYS call from RISC OS that would identify the machine platform and revision as HALDeviceComms_GPIO does. I have tried SYS “HALDeviceComms_GPIO” but it doesn’t work. |
Tank (53) 374 posts |
SYS “OS_Hardware” ,&403,0,0,0,0,0,0,0,4 TO r0%,r1%,r2% |
Mike Freestone (2564) 131 posts |
This thread seems to cover the same topic, even by the same author. It looks like testing for the feature is the done thing rather than holding a big table of every machine ever made (and those that are yet to be) |
John Williams (567) 768 posts |
For those pasting, there seems to be a problem with SmartQuotes. It don’t work here! |
Chris Hall (132) 3554 posts |
And a ‘SWI name not known’ error means Virtual Risc PC? Or Select? |
Chris Mahoney (1684) 2165 posts |
The Wiki page is in the HAL category, which IIRC was introduced in RISC OS 5. It’s therefore probably not available in Select. |
Chris Hall (132) 3554 posts |
Many thanks. I have added a few lines to RISCOSmark so that I now get both the machine and the filing system being tested:
Which gives the following output:
|
rob andrews (112) 200 posts |
Hi Chris can you post a copy of the altered program i can’t find it any where. |
David Pitt (102) 743 posts |
Done that. Very nice addition, thanks. I did find one tiny little snag, due to user incompetence, having forgotten how romark places its test file. It comes unglued on this Raspberry Pi if the CSD has not been explicitly set, as it isn’t after a boot. System variable 'FileSwitch$SCSI$CSD' not found in line 76 *show FileSwitch* FileSwitch$CurrentFilingSystem : SCSI FileSwitch$SpecialField : FileSwitch$TemporaryFilingSystem : SCSI * N.B. My line numbers that is, after the update, this is the line :- SYS "OS_ReadVarVal","FileSwitch$"+CFS$+"$CSD"+CHR$0,block%,256,0,3 TO ,,pp% I added this to catch the unset state :- SYS "XOS_ReadVarVal","FileSwitch$"+CFS$+"$CSD"+CHR$0,block%,-1,0,3 TO ,,pp% IF pp%=0 THEN CSD$=" - CSD not set" ELSE SYS "OS_ReadVarVal","FileSwitch$"+CFS$+"$CSD"+CHR$0,block%,256,0,3 TO ,,pp% CSD$="" FOR i%=0 TO pp%-1 CSD$+=CHR$(block%?i%) NEXT ENDIF |
Chris Hall (132) 3554 posts |
Yes it comes ‘unglued’ as you say (on any platform) if the CSD is not set. I always run !MultiTask [available from !Store or here] which sets the CSD to the last opened directory or last double clicked file so I don’t have to bother with a full pathname in my BASIC programmes. Then RISCOSMark tests the directory (and filesystem) from which it is run. Uploaded the tweaked RISCOSMark here with the suggested correction for when the CSD is not set. It uses 8Mbytes for the direct load/save test and counts read speed after the file to be read has been created. I chose 8Mbytes so that it was larger than any memory cache. |
David Pitt (102) 743 posts |
I haven’t come by that one before, I’ll give it a look, sounds interesting.
That would be more intuitive. Thanks for that. |
Rick Murray (539) 13806 posts |
Wouldn’t it make more sense to assume |
Chris Hall (132) 3554 posts |
Wouldn’t it make more sense to assume $ instead of complaining the CSD isn’t set? Probably. However the CSD may be set to a different filing system than the current filing system and I think RISCOSMark tests the CSD (@) rather than the current filing system so complaining is perhaps prudent. |
Steve Pampling (1551) 8155 posts |
I believe that’s the reason for using a little Set MyProg$Dir <Obey$Dir>so often in the !Run file calling the !RunImage of various applications and utilities. |
Chris Hall (132) 3554 posts |
Yes, exactly. |
Tank (53) 374 posts |
Well, it seems that my code shown above has a wrong value in… PRINT”Revision &";~!(r2%+68) is correct. The reason I got the +76 value is in the GPIO module the detection code uses the variable set-up in castle/sources/kernel/hdr.GPIODevice, and when the code is assembled it seems the wrong value is used. |