To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 883
882  |  884
Subject: 
malloc() bug found -- BAD MEMORY REGION :-(
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 1 Mar 2000 21:12:09 GMT
Viewed: 
1463 times
  
It looks like it's not a bug in legOS, but in the RCX hardware:
Memory from 0xfb80 to 0xfd7f is simply NOT WRITEABLE, or more exactly,
always read as 0xff, at least on my RCX !

Try the following little test:

//
// memory test
//

#include <conio.h>

#define ADDRESS 0xfb80
#define value 0x7777

int main(int argc,char *argv[])
{
  volatile size_t *addrp = ADDRESS;
  *addrp = value;
  cputw(*addrp);

  return 0;
}

On my RCX, this displays FFFF. If anybody has a RCX, where 7777 appears
when this program is run, i'd be very interested to hear about.

To make the legOS kernel ignore this bad range, change one line in mm.c,
function mm_init().
Replace:
MM_BLOCK_RESERVED(0xfd80);    // vectors
by
MM_BLOCK_RESERVED(0xfb80);    // not writeable

i'll go ahead now and check if this fixes my dll hangups. Hopefully
there are no more dead regions in memory. Perhaps we should add some
code to mm_init that checks for bad regions and marks them as reserved ?

so long, Martin



Message has 1 Reply:
  Re: malloc() bug found -- BAD MEMORY REGION :-(
 
(...) made some tests, and - Yep, it works ! I'd strongly encourage everybody experiencing strange hangups to apply the little fix to mm_init() i suggested. For me, it makes malloc() and dll work perfectly. BTW, there are some minor flaws in dll[x], (...) (25 years ago, 2-Mar-00, to lugnet.robotics.rcx.legos)

10 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR