l4-hurd
[Top][All Lists]
Advanced

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

Bugs in laden (?)


From: Bas Wijnen
Subject: Bugs in laden (?)
Date: Wed, 17 Sep 2003 23:52:26 +0200
User-agent: Mutt/1.4i

Hi,

A bit sooner than I promised, I'm back again.  I didn't read all the source
code yet, but I did finish the L4 specification (except the non-ia32
architecture specifics) and I started reading the code from cvs to get used
to how L4 works.  I've just read the source of laden to see if I can
recognize anything from the specification in it.

And of course I keep my eyes open for bugs.  I think I've found some.  If I'm
right, then fix them, if not then tell me why not ;-)

- file laden/ia32-cmain.c, line 261-266 is:

      if (mbi->mem_lower & 0x2ff)
        panic ("Lower memory end address 0x%x is unaligned",
               mbi->mem_lower);
      if (mbi->mem_upper & 0x2ff)
        panic ("Upper memory end address 0x%x is unaligned",
               mbi->mem_upper);

I think both checks should be with (1 << 10) - 1 = 0x3ff, not 0x2ff.  On
lines 247-248 (1 << 10) - 1 is used by the way, perhaps it would be nice to
use the same notation in both places.

- file laden/laden.c, line 132 says (in the help text):
"  -r, --reboot      reboot the system at error\n",
while line 174 (the implementation of the option) says:
else if (!strcmp (argv[i], "-r") || !strcmp (argv[i], "--reset"))
These should be equal (reset or reboot)

Bye,
Bas Wijnen

-- 
/** mastermind. input 4 numbers 0-5. output <right>.<in the right place> **/

 main(){int  c[4]   ,x=3  ,l=getpid()  ,i;;   for(  srand(l);c[  x]=-   rand
()%6         ,x--   ;);;  for(         ;44>   x;){  char         a[9] ,*p=
 "%.1f\n",   b[9];x=i=0;  gets(a);for   (l=4 ;l--   ;)x+=-(a[l]  -=48)==
       (b[l  ]=c[   l]);  ;for           (l=0;16    >i;l         =++i %4)x
+=(b[i/4]+   a[l]   ?0:(  a[l]=b[i/4]     =10))     ;printf(p,x  *.1)   ;};}

/** This signature should be viewed in a monospaced font, e.g. courier.  **/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]