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

Re: [MiNT] CPU detection broken



So I propose to write a check_cpu() function fully in compatible assembly, and to call it form crt0.S as soon as possible. It will probably require to rewrite the Getcookie() and get_sysvar() functions in assembler, too.

Differentiating 68000 from 68020+ is rather simple task:

check_cpu:
	moveq #$01,d0
	lea table-1,a0
	move.b (a0,d0.w*2),d0
	rts

table:	dc.b 0,1

After calling that, the d0 register contains 0 if the CPU is 68000 or 1 if 68020 or higher. For ColdFire I don't know.

More precise checks involve using supervisor mode, and the kernel already contains such a routine, so it is better if the MiNTlib uses the cookie value. Reading cookies from crt0.S shouldn't be a problem.

Pozdrawiam
KMK