From mint-bounce@lists.fishpool.fi Tue Mar 2 02:59:36 2010 Message-ID: From: "Jo Even Skarstein" To: "mint Mailing-List" References: In-Reply-To: Subject: Re: [MiNT] Xaloader patch, take #2 Date: Tue, 2 Mar 2010 08:58:19 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_009D_01CAB9E6.813325F0" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-EsetScannerBuild: 6673 X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: joska@online.no Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Dette er en melding med flere deler i MIME-format. ------=_NextPart_000_009D_01CAB9E6.813325F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To minimize the code on 68000-kernels, this code should be left out of = 68000-kernels. xaes000.km is the only sensible XaAES to load with these = kernels anyway. The same applies to the Aranym- and Milan-kernels, they = should only look for xaaes.km. None of these systems can be = "dual-booted" with different CPUs. Jo Even From: Peter Persson=20 Sent: Monday, March 01, 2010 10:20 PM To: mint Mailing-List=20 Subject: Re: [MiNT] Xaloader patch, take #2 Ooops, I made a boo-boo! New patch appended.=20 Sorry for spamming, hopefully I'll get this right in the future. On 1 mar 2010, at 22.11, Miro Kropacek wrote: + //if (r =3D=3D 0 && cpu < 20) + if(0) name =3D DEFAULT_68000; + else + name =3D DEFAULT;=20 These lines seem quite strange, is there any reason to include it into = patch? :) --=20 MiKRO / Mystic Bytes http://mikro.atari.org --- ../xaloader.old/xaloader.c Fri Jul 13 23:33:02 2007 +++ xaloader.c Mon Mar 1 22:17:16 2010 @@ -10,6 +10,12 @@ #define DEFAULT "xaaes.km" #define DEFAULT_68000 "xaaes000.km" +#define DEFAULT_68000 "xaaes000.km" +#define DEFAULT_68010 "xaaes010.km" +#define DEFAULT_68020 "xaaes020.km" +#define DEFAULT_68030 "xaaes030.km" +#define DEFAULT_68040 "xaaes040.km" +#define DEFAULT_68060 "xaaes060.km" static void my_strlcpy(char *dst, const char *src, size_t n) @@ -57,7 +63,9 @@ } /* - * - without an argument try to load xaaes.km from sysdir + * - without an argument: + * - try to load xaaes.km from sysdir + * - if xaaes.km is not available, try to load module based on CPU = type * - with argument: * - without a path separator try to load this from sysdir * - with path separator go to this dir and load the module @@ -141,15 +149,43 @@ else { long cpu; -=20 - name =3D DEFAULT; -=20 + char temp[384]; + /* if the system have a 68000 CPU we use the 68000 compiled - * module + * module by default */ r =3D Ssystem(S_GETCOOKIE, C__CPU, &cpu); if (r =3D=3D 0 && cpu < 20) name =3D DEFAULT_68000; + else + name =3D DEFAULT; +=20 + my_strlcpy(temp, path, sizeof(path)); + r =3D Dsetpath(temp); + r =3D Dgetpath(temp, 0); +=20 + my_strlcat(temp, "\\", sizeof(temp)); + my_strlcat(temp, name, sizeof(temp)); +=20 + fh =3D Fopen(temp, O_RDONLY); + if (fh < 0) + { + /* default kernel module not available, select module based on CPU = type */ + r =3D Ssystem(S_GETCOOKIE, C__CPU, &cpu); + if(r =3D=3D 0) + { + switch(cpu) + { + case 20: name =3D DEFAULT_68020; break; + case 30: name =3D DEFAULT_68030; break; + case 40: name =3D DEFAULT_68040; break; + case 60: name =3D DEFAULT_68060; break; +=20 + default: break; + } + } + } + Fclose((int)fh); } /* change to the XaAES module directory */ ------=_NextPart_000_009D_01CAB9E6.813325F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
To minimize the code on 68000-kernels, this = code should=20 be left out of 68000-kernels. xaes000.km is the only sensible XaAES to = load with=20 these kernels anyway. The same applies to the Aranym- and Milan-kernels, = they=20 should only look for xaaes.km. None of these systems can be = "dual-booted" with=20 different CPUs.
 
Jo Even

From: Peter Persson
Sent: Monday, March 01, 2010 10:20 PM
Subject: Re: [MiNT] Xaloader patch, take = #2

Ooops, I made a boo-boo! New patch appended.=20

Sorry for spamming, hopefully I'll get this right in the = future.

On 1 mar 2010, at 22.11, Miro Kropacek wrote:
+             =   //if=20 (r =3D=3D 0 && cpu < 20)
+         =    =20   if(0)
              =    =20      name =3D DEFAULT_68000;
+       =  =20       else
+           =  =20           name =3D DEFAULT;=20

These = lines seem=20 quite strange, is there any reason to include it into patch?=20 :)

--=20
MiKRO / Mystic Bytes
http://mikro.atari.org

--- ../xaloader.old/xaloader.c Fri Jul 13 23:33:02 2007
+++ xaloader.c=20 Mon Mar  1 22:17:16 2010
@@ -10,6 +10,12 @@
 
 #define DEFAULT        "xaaes.km"
 #define DEFAULT_68000  "xaaes000.km"
+#define DEFAULT_68000  "xaaes000.km"
+#define DEFAULT_68010  "xaaes010.km"
+#define DEFAULT_68020  "xaaes020.km"
+#define DEFAULT_68030  "xaaes030.km"
+#define DEFAULT_68040  "xaaes040.km"
+#define DEFAULT_68060  "xaaes060.km"
 
 static void
 my_strlcpy(char *dst, const char *src, size_t n)
@@ -57,7 +63,9 @@
 }
 
 /*
- * - without an argument try to load xaaes.km from sysdir
+ * - without an argument:
+ *   - try to load xaaes.km from sysdir
+ *   - if xaaes.km is not available, try to load module based = on CPU=20 type
  * - with argument:
  *   - without a path separator try to load this = from=20 sysdir
  *   - with path separator go to this dir and load = the=20 module
@@ -141,15 +149,43 @@
 =20 else
  = {
  = long=20 cpu;
- =
- = name =3D=20 DEFAULT;
- =
+ = char=20 temp[384];
+
  = /* if the=20 system have a 68000 CPU we use the 68000 compiled
- * = module
+ * = module by=20 default
  = */
  = r =3D=20 Ssystem(S_GETCOOKIE, C__CPU, &cpu);
  = if (r =3D=3D=20 0 && cpu < 20)
  = name =3D=20 DEFAULT_68000;
+ = else
+ = name =3D=20 DEFAULT;
+ =
+=20 my_strlcpy(temp, path, sizeof(path));
+ r = =3D=20 Dsetpath(temp);
+ r = =3D=20 Dgetpath(temp, 0);
+ =
+=20 my_strlcat(temp, "\\", sizeof(temp));
+=20 my_strlcat(temp, name, sizeof(temp));
+ =
+ fh = =3D=20 Fopen(temp, O_RDONLY);
+ if = (fh <=20 0)
+ = {
+ /* = default=20 kernel module not available, select module based on CPU type */
+ r = =3D=20 Ssystem(S_GETCOOKIE, C__CPU, &cpu);
+ = if(r =3D=3D=20 0)
+ = {
+=20 switch(cpu)
+ = {
+ = case 20: name =3D = DEFAULT_68020; break;
+ = case 30: name =3D = DEFAULT_68030; break;
+ = case 40: name =3D = DEFAULT_68040; break;
+ = case 60: name =3D = DEFAULT_68060; break;
+ =
+ = default: break;
+ = }
+ = }
+ = }
+=20 Fclose((int)fh);
  = }
 
  = /* change=20 to the XaAES module directory */

------=_NextPart_000_009D_01CAB9E6.813325F0--