Jump to content
Stefan

Reading Kernal version

Recommended Posts

10 hours ago, Scott Robison said:

Though: It still doesn't start at $FFF8, ...

You need an address that has a zero in the Basic Bank in R38 (whether it's R39 or later is not an issue, because if you get to the Kernel bank, the "mist" signature is stable.

Share this post


Link to post
Share on other sites
5 hours ago, BruceMcF said:

You need an address that has a zero in the Basic Bank in R38 (whether it's R39 or later is not an issue, because if you get to the Kernel bank, the "mist" signature is stable.

I'm not sure I understand how one relates to the other. My only meaning was "the signature includes $FFF8 but starts at $FFF6". That is true regardless of what bytes exist in any other ROM bank.

Share this post


Link to post
Share on other sites
6 hours ago, BruceMcF said:

You need an address that has a zero in the Basic Bank in R38 (whether it's R39 or later is not an issue, because if you get to the Kernel bank, the "mist" signature is stable.

Wait, did you type "need" when you meant I "read" a byte? I didn't use the emulator to read the ROM, I just looked at bank 3 instead of bank 0, which would be GEOS bank, not BASIC. But as I later wrote, I finally realized my mistake. I used hexdump on the rom.bin file and my mind said offset FFF8 would be the signature location because I failed to take into account the fact that each rom bank is only 16K, not the entire 64K address space. I can be dense sometimes especially when I have other things on my mind. 🙂

Also: I was looking at a home built R39 I built on April 25, just in case there has been drift since then as I've not pulled any updates since then, more or less.

Edited by Scott Robison

Share this post


Link to post
Share on other sites
On 7/23/2021 at 11:53 PM, Scott Robison said:

Wait, did you type "need" when you meant I "read" a byte? I didn't use the emulator to read the ROM, I just looked at bank 3 instead of bank 0, which would be GEOS bank, not BASIC. But as I later wrote, I finally realized my mistake. I used hexdump on the rom.bin file and my mind said offset FFF8 would be the signature location because I failed to take into account the fact that each rom bank is only 16K, not the entire 64K address space. I can be dense sometimes especially when I have other things on my mind. 🙂

Also: I was looking at a home built R39 I built on April 25, just in case there has been drift since then as I've not pulled any updates since then, more or less.

The "you" here is not you in particular, its the Commonwealth English "one".

I meant the stable "mist" signature is four bytes that are positive and non-zero, so to test a single flag as soon as you load, as the code quoted by @Greg King does, you need a zero in the parallel position in the Basic bank (or else a byte with b7 set so you can use "BPL", but a zero works). That just happens to be the case at $FFF8 in Bank4 ... that's why it used $FFF8 and not the starting point of the signature.

 

Share this post


Link to post
Share on other sites
2 minutes ago, BruceMcF said:

The "you" here is not you in particular, its the Commonwealth English "one".

I meant the stable "mist" signature is four bytes that are positive and non-zero, so to test a single flag as soon as you load, as the code quoted by @Greg King does, you need a zero in the parallel position in the Basic bank (or else a byte with b7 set so you can use "BPL", but a zero works). That just happens to be the case at $FFF8 in Bank4 ... that's why it used $FFF8 and not the starting point of the signature.

Looks like I picked the wrong week to stop drinking. Makes sense, sorry for the noise.

Share this post


Link to post
Share on other sites
17 minutes ago, Scott Robison said:

Looks like I picked the wrong week to stop drinking. Makes sense, sorry for the noise.

Well, it IS a bit subtle, in that in one possible logical branch, if storing the Kernel bank number into $0001 does nothing, that requires a specific Basic ROM binary, so that we know exactly which values are where ... and the Basic ROM binary is subject to change.

But while the Basic ROM binary is subject to change, if it DOES change, then the system will be Revision 39 or later, and storing $0001 will in fact take you to the Kernel bank, where the "mist" signature is stable between revisions.

I didn't actually catch that until the second time I thought about the code.

Share this post


Link to post
Share on other sites
58 minutes ago, BruceMcF said:

Well, it IS a bit subtle, in that in one possible logical branch, if storing the Kernel bank number into $0001 does nothing, that requires a specific Basic ROM binary, so that we know exactly which values are where ... and the Basic ROM binary is subject to change.

But while the Basic ROM binary is subject to change, if it DOES change, then the system will be Revision 39 or later, and storing $0001 will in fact take you to the Kernel bank, where the "mist" signature is stable between revisions.

I didn't actually catch that until the second time I thought about the code.

Yes, it's a clever solution.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use