From mint-bounce@lists.fishpool.fi Mon Jun 1 06:56:01 2009 X-Authentication-Warning: antyk.ibi.uw.edu.pl: draco owned process doing -bs Date: Mon, 1 Jun 2009 12:11:48 +0200 (CEST) From: "Konrad M. Kokoszkiewicz" X-X-Sender: draco@antyk.ibi.uw.edu.pl To: =?ISO-8859-15?Q?Vincent_Rivi=E8re?= cc: mint Subject: Re: [MiNT] CPU detection broken In-Reply-To: <4A225A61.9000901@freesbee.fr> Message-ID: References: <4A225A61.9000901@freesbee.fr> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (antyk.ibi.uw.edu.pl [127.0.0.1]); Mon, 01 Jun 2009 12:11:48 +0200 (CEST) X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: draco@obta.uw.edu.pl Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: > 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