[OpenBIOS] cell size in paflof

Stefan Reinauer stepan at openbios.net
Wed May 29 22:06:50 CEST 2002


Hi Segher and others,

I made a little patch for paflof so it automatically recognizes the 
cell size of the machine it is compiled on. It can probably be done
nicer, but I got sick of changing the code while changing machines ;)
Should I commit this?

Best regards,
  Stefan Reinauer
  
-- 
The x86 isn't all that complex - it just doesn't make a lot of
sense.          -- Mike Johnson, Leader of 80x86 Design at AMD
	                          Microprocessor Report (1994)
-------------- next part --------------
? cell
? cell.c
? cellsize.diff
? dict.xt
? paflof
? paflof.s
Index: ref.pl
===================================================================
RCS file: /srv/cvs/openbios/paflof/ref.pl,v
retrieving revision 1.3
diff -u -r1.3 ref.pl
--- ref.pl	2002/05/29 15:30:45	1.3
+++ ref.pl	2002/05/29 18:51:45
@@ -1,6 +1,17 @@
 #!/usr/bin/perl
 
-$CELL = 4;
+open F, ">.cellsize.c";
+print F <<'HERE';
+#include <stdio.h>
+int main(void) 
+{
+	printf("%d\n",(int)sizeof(void *));
+	return 0; 
+}
+HERE
+system("make .cellsize >>.cellsize.log 2>&1");
+$CELL = qx { ./.cellsize };
+system("rm -f .cellsize*");
 
 sub string
 {


More information about the openbios mailing list