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 / 3548
3547  |  3549
Subject: 
Re: My problems with adding a Best Fit algorithm for memory management to kernel/mm.c
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 7 Dec 2003 05:17:10 GMT
Viewed: 
4223 times
  
In lugnet.robotics.rcx.legos, Michael Martelli wrote:
The results I am getting a very odd.

If I load this version of the OS and then load my testing program (one which
mallocs a few blocks, then frees some, and then mallocs a few more and then
finally scans user memory and prints out the memory layout, i.e. the address,
PID, size of each block) then it seems to allocate everything fine, except for
one random block of memory which is size 7 in the after all the of OS tasks are
allocated.

But if I turn the RCX off then on either:
(a) after downloading the program or
(b)after just running the program
and then run the program again, all of the OS tasks that were allocated now
somehow must have their PID set to MM_FREE and then they are all joined together
as 1 free block of memory beginning at mm_start.  And then after that the user
program is allocated (and is fine throughout the whole process, nothing happens
to it, its PID is fine) the OS tasks get allocated again, and then from any time
after that the memory layout remains the same (i.e. no other blocks get reset
and joined to create a giant free block of memory).

Does anyone have any idea what is going on? And why?

The rest of my mm.c file is the same as the original and the same as my Best Fit
version which worls perfectly.

Hi Mike,

It would be helpful to see each of the memory block dumps and some notation as
to what actions you took between each dump (i.e. RCX on/off, program downloaded,
etc...)

Mark



Message has 1 Reply:
  Re: My problems with adding a Best Fit algorithm for memory management to kernel/mm.c
 
(...) Mark, Thanks for the reply, and sorry I forgot to include some more details I have results from 2 memory scans (the values may be a bit off from each other (i.e. starting addresses, but that is becuase they are from 2 times I ran it, and I (...) (21 years ago, 7-Dec-03, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: My problems with adding a Best Fit algorithm for memory management to kernel/mm.c
 
Well, I have another problem - this time with Worst Fit. It may be becuase I have been looking at this code for so much time over the past few months, but I have encountered this problem with my implementation and my mind is boggled (as well as (...) (21 years ago, 7-Dec-03, to lugnet.robotics.rcx.legos)

14 Messages in This Thread:



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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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