[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Jet problems



To anybody working on Jet:


A) The cookie structure:

static struct {
	/* fake cookie */
	short op;
	long addr;
	short dbg;
	/* fpu cookie */
	char fpu_sig[4];
	long fpu_val;
	/* cpu cookie */
	char cpu_sig[4];
	long cpu_val;
	/* sysvar cookie */
	char svar_sig[4];
	long svar_val;
	/* last cookie */
	long zero;
} mac_cookies = {
	0x4ef9, 0, 0xa9ff,
	"_FPU", 0,
	"_CPU", 0,
	"SVAR", 0,
	0
};

has several problems:

1) The "fake" cookie doesn't follow the rules for a cookie name: four
printable characters.

2) On a Powerbook 540, the _FPU cookie gets set to 0x10000, which -
according to Atari's docs - means: SFP004 card installed. I assume
that the Gestalt function returned 0, and this means that the _FPU 
cookie should be 0 as well.

The definition of the _FPU cookie is:

low word: != 0 means that software FPU support is installed
high word:

Bit 0: SFP004 FPU card installed
Bit 1..2: 0: no CPU, 1: either 68881 or 68882, 2: 68881, 3: 68882
Bit 3: 68040

So the correct settings would be:

installed    _FPU value

no FPU       0x00000000
68040LC      0x00000000
68881        0x00040000
68882        0x00080000
68040        0x00100000

3) The final "0" cookie have the total number of entries in the cookie
jar as value.

4) The _MAM cookie is missing: it should point to a zero terminated
string with the machine type (like "Macintosh Powerbook").

5) The _VDO and the _MCH cookie should exist and be set to 0xffffffff.

6) The _SND cookie should exist and be set to 0.


B) Sversion() should return *something*, maybe 0.


C) The sysbase structure referenced by the SVAR structure should have
the following layout:

Offset   Size    description    value

0        2       os_entry       anything
2        2       os_version     0x0
4        4       os_reseth      anything
8        4       os_beg         back to offset 0
12       4       os_end         0x0
16       4       os_rsv1        0x0
20       4       os_magic       0x0
24       4       os_date        Jet vsn date in BCD (like $31121996)
28       2       os_conf        0x0
30       2       os_dosdate     Jet vsn date in DOS format
32       4       p_root         0x0
36       4       pkbshift       as set
40       4       prun           as set
44       4       p_rsv2         0x0

This would allow well behaved and MacMiNT-aware problems to idfentify 
the version date of Jet.

Regards, jr