[Coco] the final stage of optimization
Gene Heskett
gene.heskett at verizon.net
Sat Nov 21 17:09:39 EST 2009
On Saturday 21 November 2009, Lothan wrote:
>If you're currently booting from a good OS-9 or NitrOS-9 boot disk/image,
>all you really need to do is merge the driver and descriptor, load the
>merged file into memory, and then init the descriptor:
>
>merge /dd/modules/rbf/rammer.dr /dd/modules/rbf/r0_128k.dd >/dd/cmds/ramr0
>attr /dd/cmds/ramr0 e pe
>load ramr0
>link rammer
>link r0
>iniz /r0
>format /r0
>
You only need to 'link' the first module of a merged group of them, which you
did above. And if you use 'myram', the last two steps are un-necessary since
it formats itself on the first access, in about 100 milliseconds. It also
works (many times verified) at up to around 1.7 megs of ramdisk when used on
a 2 meg machine. Deiniz it, dmode for the size you want, and do a "dir /r0"
and its setup and usable for the new size. Deiniz'ing it also returns every
byte it used to the memory pool. Its size is determined by the sct variable
you can change with dmode, and IIRC that value is = number of 8k blocks of
ram it is to ask the system for and make use of.
The ramdisk, any ramdisk for that matter, being a 256 byte block oriented
device without any formatting, really only needs the basic lsn0 (to identify
it to os9), the FAT (up to 64k but typically only 3 or 4 sectors), the root
directories fd.seg sector composed and written and a 64 byte root directory
written in the next sector. Formatting the whole capacity of a ramdisk disk
is a huge waste of processor time.
myram I _thought_ was in the 3rdparty directory, but seems to have been
dropped from recent (3.2.6-3.2.8) nitros9 distributions. I only see it in an
older /opt/os9/3rdparty directory here on this linux machine. But it still
works, I have a boot disk of 3.2.8 that includes it.
Why was it dropped, Boisy / Robert? It is good solid, bulletproof code, but
then I'm biased since I wrote it. :-)
Anybody that wants to play with it, I can email it to you privately.
The archive is about 7k, in lzh format.
In reading my old docs, I see that it may not set the creation date in lsn0
correctly unless it is actually in the os9boot file, something about access
via the F$Time function requires it to be in the system ram image for valid
access to direct page 0 by the F$Time getstt. The latest version also self-
adjusts to the cpu its running on, falling back to older, slightly slower
code for the 6809's. And slower is relative, IIRC megaread time is 11
seconds on my 6309, and 13 seconds on a 6809.
>At this point /r0 is ready to use. Also note that I used r0_128k.dd as an
>example, but you can use either of the r0_8k.dd, r0_96k.dd, r0_128k.dd, or
>r0_192k.dd descriptors as appropriate.
>
>--------------------------------------------------
>From: "Wayne Campbell" <asa.rand at yahoo.com>
>Sent: Friday, November 20, 2009 11:45 PM
>To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
>Subject: Re: [Coco] the final stage of optimization
>
>> When I wrote DCom I used a RAM disk. I recommended the use of a RAM disk
>> as it did speed up the program significantly. With the current setup I'm
>> using, I am unable to setup a ram drive. The NitrOS9 disk image I'm using
>> is not a proper system master, and I'm spending all of my available time
>> working on this project. I just don't have time to try to figure it out
>> right now. I'm attempting to get the copy of the OS9 system disk to boot,
>> but for reasons unknown the screen comes up black-on-black with a magenta
>> cursor, and the display commands don't change it. If I can't see what I'm
>> doing, I can't work on anything. So, I make do with what I have.
>>
>> The sort I'm using is based on the bubble sort, but instead of repeatedly
>> starting at the top and working to the bottom, it souts back upward when
>> it gets to the bottom. This way, it is constantly sorting in both
>> directions, and uses fewer iterations of the loop. It proved to be over
>> twice as fast as top-to-bottom-top-to-bottom.
>>
>> Thanks for the tips. I've heard of mergesort, but have never seen it in
>> operation or looked at its code. I know there were many things developed
>> on the mainframes for dealing with massive volume sequential data, but
>> I've never been around it. Always looking from a distance. I'll see what
>> I can find on the web.
>>
>> Wayne
[...]
--
Cheers, Gene
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
The NRA is offering FREE Associate memberships to anyone who wants them.
<https://www.nrahq.org/nrabonus/accept-membership.asp>
It's currently a problem of access to gigabits through punybaud.
-- J. C. R. Licklider
More information about the Coco
mailing list