Posted on 08/19/2003 11:00:12 AM PDT by shadowman99
http://www.freerepublic.com/focus/f-news/966610/posts?page=70#70
The origin of the code in question goes back even further than was known when Bruce wrote this.
The mainstream media will probably pick this up tomorrow. Apparently, the financial markets haven't figured it out yet, because SCO's stock price is down less than 1%. If I were a gambler, I'd be shorting them right now.
SCO has been very publicly discredited. They will have to respond with something that supports their claim -- the question is how diligent their research will be. They won't be able to survive another bogus claim: another slip like this will ruin their credibility.
So SCO is trying to lay claim to the malloc() function? From Lion's no less... why don't I just go patent the fork.
We haven't yet located the original source of this code...
I don't think the Mormon's would ever do that, but I did see a comment from Linus Torvald's email where he talked about doing that. Did you ever see it?
/*
* Copyright (c) 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @(#)subr_rmap.c 1.2 (2.11BSD GTE) 12/24/92
*/
#include "param.h"
#include "systm.h"
#include "map.h"
#include "vm.h"
/*
* Resource map handling routines.
*
* A resource map is an array of structures each of which describes a
* segment of the address space of an available resource. The segments
* are described by their base address and length, and sorted in address
* order. Each resource map has a fixed maximum number of segments
* allowed. Resources are allocated by taking part or all of one of the
* segments of the map.
*
* Returning of resources will require another segment if the returned
* resources are not adjacent in the address space to an existing segment.
* If the return of a segment would require a slot which is not available,
* then one of the resource map segments is discarded after a warning is
* printed.
*
* Returning of resources may also cause the map to collapse by coalescing
* two existing segments and the returned space into a single segment. In
* this case the resource map is made smaller by copying together to fill
* the resultant gap.
*
* N.B.: the current implementation uses a dense array and does not admit
* the value ``0'' as a legal address or size, since that is used as a
* delimiter.
*/
/*
* Allocate 'size' units from the given map. Return the base of the
* allocated space. In a map, the addresses are increasing and the
* list is terminated by a 0 size.
*
* Algorithm is first-fit.
*/
memaddr
malloc(mp, size)
struct map *mp;
register size_t size;
{
register struct mapent *bp, *ep;
memaddr addr;
int retry;
if (!size)
panic("malloc: size = 0");
/*
* Search for a piece of the resource map which has enough
* free space to accomodate the request.
*/
retry = 0;
again:
for (bp = mp->m_map; bp->m_size; ++bp)
if (bp->m_size >= size) {
/*
* Allocate from the map. If we allocated the entire
* piece, move the rest of the map to the left.
*/
addr = bp->m_addr;
bp->m_size -= size;
if (bp->m_size)
bp->m_addr += size;
else for (ep = bp;; ++ep) {
*ep = *++bp;
if (!bp->m_size)
break;
}
#ifdef UCB_METER
if (mp == coremap)
freemem -= size;
#endif
return(addr);
}
/* no entries big enough */
if (!retry++) {
if (mp == swapmap) {
printf("short of swap\n");
xumount(NODEV);
goto again;
}
else if (mp == coremap) {
xuncore(size);
goto again;
}
}
return((memaddr)NULL);
}
...snip...
/*
* Copyright (c) 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @(#)subr_rmap.c 1.2 (2.11BSD GTE) 12/24/92
*/
#include "param.h"
#include "systm.h"
#include "map.h"
#include "vm.h"
/*
* Resource map handling routines.
*
* A resource map is an array of structures each of which describes a
* segment of the address space of an available resource. The segments
* are described by their base address and length, and sorted in address
* order. Each resource map has a fixed maximum number of segments
* allowed. Resources are allocated by taking part or all of one of the
* segments of the map.
*
* Returning of resources will require another segment if the returned
* resources are not adjacent in the address space to an existing segment.
* If the return of a segment would require a slot which is not available,
* then one of the resource map segments is discarded after a warning is
* printed.
*
* Returning of resources may also cause the map to collapse by coalescing
* two existing segments and the returned space into a single segment. In
* this case the resource map is made smaller by copying together to fill
* the resultant gap.
*
* N.B.: the current implementation uses a dense array and does not admit
* the value ``0'' as a legal address or size, since that is used as a
* delimiter.
*/
/*
* Allocate 'size' units from the given map. Return the base of the
* allocated space. In a map, the addresses are increasing and the
* list is terminated by a 0 size.
*
* Algorithm is first-fit.
*/
memaddr
malloc(mp, size)
struct map *mp;
register size_t size;
{
register struct mapent *bp, *ep;
memaddr addr;
int retry;
if (!size)
panic("malloc: size = 0");
/*
* Search for a piece of the resource map which has enough
* free space to accomodate the request.
*/
retry = 0;
again:
for (bp = mp->m_map; bp->m_size; ++bp)
if (bp->m_size >= size) {
/*
* Allocate from the map. If we allocated the entire
* piece, move the rest of the map to the left.
*/
addr = bp->m_addr;
bp->m_size -= size;
if (bp->m_size)
bp->m_addr += size;
else for (ep = bp;; ++ep) {
*ep = *++bp;
if (!bp->m_size)
break;
}
#ifdef UCB_METER
if (mp == coremap)
freemem -= size;
#endif
return(addr);
}
/* no entries big enough */
if (!retry++) {
if (mp == swapmap) {
printf("short of swap\n");
xumount(NODEV);
goto again;
}
else if (mp == coremap) {
xuncore(size);
goto again;
}
}
return((memaddr)NULL);
}
...snip...
>>We haven't yet located the original source of this code...
"The ATT source code is here on the net, from a version released around 1979, although we believe that earlier versions exist."
He is referring to the obfuscated code. Whoever created the Powerpoint slide changed the font to "Symbol".
The consensus elsewhere is that it is a comment from SCO's kernel. Since it can't be found elsewhere, it is probably proprietary. But, SCO is not claiming that it is duplicated in Linux.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.