Checking what type of pack is in a slot!

Be clear with the topic titles to help members find the answers
Post Reply
User avatar
Martin
Global Admin
Posts: 286
Joined: Mon Jan 02, 2023 5:18 pm

Checking what type of pack is in a slot!

Post by Martin »

Does anyone know how to PEEK at a pack in either slot to see if it is a Datapak, Rampak or Flashpak?

I have seen it somewhere but can't find it now.

Sincerely Martin
thesourcerer
Posts: 77
Joined: Sat Jan 07, 2023 1:00 pm

Re: Checking what type of pack is in a slot!

Post by thesourcerer »

Hi Martin were you thinking of the one on Jaaps site, technical documents, other documents, organiser models and version numbers?
thesourcerer
Posts: 77
Joined: Sat Jan 07, 2023 1:00 pm

Re: Checking what type of pack is in a slot!

Post by thesourcerer »

The INFO program that I have on the same pack as the Y2K patch and boot for P250 shows the type of pack, size etc etc. Rampacks, datapacks, Flash datapacks, barcode readers, Comms Links, paralinks, all with version numbers where applicable.
User avatar
Martin
Global Admin
Posts: 286
Joined: Mon Jan 02, 2023 5:18 pm

Jaap's INFO routine

Post by Martin »

Thanks Peter... You are right I have Jaap's INFO.OPL here. It Does report the pack types... I'll need to study the PEEKing to get to the bottom of it, but it is doable.

Sincerely
Martin
MartinP
Posts: 54
Joined: Wed Jan 04, 2023 7:51 pm

Re: Checking what type of pack is in a slot!

Post by MartinP »

See this, which explains that pack IDs can be read from a list starting at address $20D7, https://www.jaapsch.net/psion/tech09.htm

It’s the first of the 10 bytes, the ID byte, which gives the pack type. Try using PEEKB to find out.
PKA_PKID $94-Set by PK$SETP. Pointer to current pack identifier in array
PKT_ID.

PKT_ID $20D7-Set by PK$SETP. An array of 4 elements each 10 bytes long
that contain the id string of each of the 4 devices A:,B:,C:
and D: respectively. See description of login below.



______________
9.4.3 PACK ID STRING

Every pack logged on the Organiser has a ten byte string for
identification. This string is blown onto a blank pack by the Organiser
during "sizing". It consists of an ID byte, a size byte, a 6 byte time
string and a 2 byte checksum.

0 1 2 3 4 5 6 7 8 9
ID SZ YR MTH DAY HR FRH FRL CHKH CHKL


ID -Id byte. This byte describes the pack type and function. The
bits of this byte signify the following:

0. This is clear for a valid MKII Organiser pack.

1. This is set if the pack is an eprom pack (cleared if it is a
ram pack).

2. This is set if the pack is paged.

3. This is cleared if the pack is write protected.

4. This is cleared if the pack is bootable.

5. This is set if the pack is copyable.

6. This is normally set (reserved for future expansion).

7. This is set if the pack is a MK1 Organiser datapack. If this
is the case then the id string on the datapack is different to
that stored in the id table. The operating system converts
the MK1 id string on the datapack to a valid MKII id string in
the id table.


SZ- This contains the size of the pack in 8k (8096) units. (e.g. =1
for an 8k pack, 2 for a 16k pack etc).

YR- The year the pack was sized.

MNTH- The month the pack was sized.

DAY- The day of the month the pack was sized.

HR- The hour the pack was sized.

FRH and FRL- A unique two byte number, generated by reading the
contents of the free running counter at the time of sizing.

CHKH and CHKL- A word checksum of the first 4 words of the ID
string.


PK$SETP sets PKA_PKID to point to the relevant ID string in PKT_ID for the
requested slot.
When PK$SETP is called and a valid pack is in the requested slot then the
first 10 bytes of the pack are compared to the 10 bytes stored in RAM for
that particular slot. If they are not the same, then the 10 bytes from the
pack are copied into RAM and, if requested, a "PACK CHANGED" error is
reported.

The word checksum is used in rampacks to determine if they have been
corrupted. If this checksum is not correct in a rampack it is assumed that
they have been corrupted and they are filled with $FF and then resized (all
data in them is lost). This does not apply to the CM operating system as
it does not handle rampacks.

The first 2 bytes of the ID string are useful in determining the pack type
and size.

The following is a list of the 1st 2 bytes of the ID string for a number of
standard datapacks:

8k datapack-$7A $01

16k datapack-$7A $02

32k datapack-$7E $04

64k datapack-$7E $08

128k datapack-$7E $10
amenjet
Posts: 290
Joined: Tue Jan 03, 2023 7:54 pm

Re: Checking what type of pack is in a slot!

Post by amenjet »

I've just had a quick look at INFO.OPL and I can't quite see how it is determining that a flashpack is present. It looks at 20D7 but that is just a copy of the pack header which doesn't seem to explicitly indicate flashpack. Or is that one of the future extension mentioned?
MartinP
Posts: 54
Joined: Wed Jan 04, 2023 7:51 pm

Re: Checking what type of pack is in a slot!

Post by MartinP »

Andrew,
Looks like you are correct. The line in INFO.OPL is:

Code: Select all

IF (B1% AND 66)=2
     A$=A$+"FlashPak"
Where B1% is the ID byte of a pack, and bit 1 (value 2) should be high and bit 6 (value 64) should be low for a FlashPak. Bit 6 is the "future extension" bit
Martin P.
Post Reply