Reading Kernal version

Chat about anything CX16 related that doesn't fit elsewhere
Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

Reading Kernal version

Post by Scott Robison »



6 minutes ago, John Chow Seymour said:




Pardon my ignorance, what's a "mist signature"?



I'm assuming it is related to Michael Steil (aka mist) who is working on the kernal. There is a four byte signature in the source code, though I don't find it at $FFF8.

 

Greg King
Posts: 162
Joined: Wed Jul 08, 2020 1:14 pm

Reading Kernal version

Post by Greg King »


 


39 minutes ago, Scott Robison said:




I'm assuming it is related to Michael Steil (aka mist) who is working on the kernal. There is a four byte signature in the source code, though I don't find it at $FFF8.



 



Run the emulator.  Use BASIC's MON command to start the monitor.  Give the command "m fff0 ffff".  You'll see it.

Snickers11001001
Posts: 140
Joined: Wed Jan 20, 2021 6:43 pm

Reading Kernal version

Post by Snickers11001001 »



43 minutes ago, Greg King said:




Run the emulator.  Use BASIC's MON command to start the monitor.  Give the command "m fff0 ffff".  You'll see it.



or you can even grok it from the basic command line:

FOR I= $FFF6 TO $FFFA : PRINT CHR$ (PEEK (I)); : NEXT


 

Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

Reading Kernal version

Post by Scott Robison »



1 hour ago, Greg King said:




Run the emulator.  Use BASIC's MON command to start the monitor.  Give the command "m fff0 ffff".  You'll see it.



I looked at the rom.bin image and didn't see the signature at that offset.

Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

Reading Kernal version

Post by Scott Robison »



Just now, Scott Robison said:




I looked at the rom.bin image and didn't see the signature at that offset.



DOH! I didn't think about the rom being 16K pages. I was looking for the bytes at the byte offset, which would have put it in bank 3.

Though: It still doesn't start at $FFF8, hence part of my confusion. But the bigger issue was my duh me moment expecting to see file offsets as addresses.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Reading Kernal version

Post by BruceMcF »



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.

Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

Reading Kernal version

Post by Scott Robison »



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.

Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

Reading Kernal version

Post by Scott Robison »



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.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Reading Kernal version

Post by BruceMcF »



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.

 

Scott Robison
Posts: 952
Joined: Fri Mar 19, 2021 9:06 pm

Reading Kernal version

Post by Scott Robison »



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.

Post Reply