[Coco] Virtual Memory in OS-9
Gene Heskett
gene.heskett at verizon.net
Tue Jan 22 16:46:38 EST 2008
On Tuesday 22 January 2008, Bob Devries wrote:
>William said:
>>I just wanted to ask if the operating system has calls for allocating more
>>memory to a process, or if everything has to have memory allocated
>>statically.
>
>There are system calls to allocate more memory in OS-9.
>The OS-9 system manuals (level 2) are available in PDF form online. Try
>ftp.clubltdstudios.com/coco/downunder/OS9/
>
>> Also I really want to know if it's possible to execute programs that use
>> more memory than is physically installed by paging to mass storage of some
>> sort.
>> It would be very nice if something similar to the UNIX mmap() system call
>> is available.
>
>This would require extensive changes/additions to the stock OS-9. Even
>Nitros9 would need much change. Not saying it isn't possible, but...
>
Changes in the os? No, the calls to map the ram are there and I used them
extensively in 'myram', a ramdisk I wrote a decade or so back, and which
could make a ramdisk out of almost every spare byte in the machine, tested to
as much as 1.8 megabytes of ramdisk on a 2 megabyte machine. That code might
make a good tutorial about how to do at least that part of the memory
shuffling. I put it on rtsi quite some time ago.
Changes in the compiler or assembler? Yes, fairly major surgery, because the
compiler or assembler would have to have knowledge of what block was mapped
where on a dynamic basis as it followed the code to build the application.
Otherwise it could not know what/where the target address of the next branch
or jump that crossed an 8k block boundary would be when it fills in those
addresses in without that knowledge.
Larger than 48k or so programs are probably best done by calling a separate
shell to exec the next piece of it, using one always present supervisory
module that all other modules returned to when their work was finished. If
return values were needed, then again its a matter of mapping a shared block
to both modules that contains the data structures.
This I believe has already been done by some of the game authors such as Steve
Bjork, and maybe by John (sockmaster) Kowalski. Maybe Roger is doing it too,
but he hasn't said so in so many words.
One _could_ page to disk, and with a fast disk it wouldn't be to much slower
than pageing ram around once the supervisory module has preloaded the
available ram using the same methods I used in myram. Data speeds in and out
of a fast disk, or i/o to myram, are both in the 11 seconds a megabyte range
as that is as fast as the coco3 can move data anyway.
>> I plan on starting out with the OS-9 C compiler as it looks like it has a
>> lot of UNIX compat stuff in it. I would like to see just how much of a
>> UNIX like environment I could re-create on OS-9
>
>The European OS9 usergroup once produces a work called TOP -- The OS9
>Project. While this was, I believe based around OS9/68000, it was designed
>to give a UNIX-ish feel to OS9.
>
>> I saw a lot of unix tool ports on the rtsi archive so it cant be too bad.
>> But I'm wondering if theres a way to make curses apps run on OS-9 does the
>> OS-9 console emulate any particular type of terminal? (one that implements
>> escapes for character attributes, cursor movement and such) at the worst I
>> could always hang a real terminal off of an RS232 port.
>
>There is a curses port for OS-9/6809, but I've had mixed reports as to
>whether it works or not. The codes used by OS-9 for screen/keyboard are
>documented in the manuals.
>
>--
>Regards, Bob Devries, Dalby, Queensland, Australia
>
>Isaiah 50:4 The sovereign Lord has given me
>the capacity to be his spokesman,
>so that I know how to help the weary.
>
>website: http://www.home.gil.com.au/~bdevasl
>my blog: http://bdevries.invigorated.org/
>
>----- Original Message -----
>From: "William Schaub" <wschaub at steubentech.com>
>To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
>Sent: Wednesday, January 23, 2008 5:59 AM
>Subject: [Coco] Virtual Memory in OS-9
>
>>I am looking into possibly working with OS-9 on both the coco2 and the new
>>coco3 when it arrives from cloud9. I know I should hunt down the manuals,
>>but I'm not 100% sure where to look. I just wanted to ask if the operating
>>system has calls for allocating more memory to a process, or if everything
>>has to have memory allocated statically.
>>
>> Also I really want to know if it's possible to execute programs that use
>> more memory than is physically installed by paging to mass storage of some
>> sort.
>> It would be very nice if something similar to the UNIX mmap() system call
>> is available.
>>
>> I plan on starting out with the OS-9 C compiler as it looks like it has a
>> lot of UNIX compat stuff in it. I would like to see just how much of a
>> UNIX like environment I could re-create on OS-9
>>
>> I saw a lot of unix tool ports on the rtsi archive so it cant be too bad.
>> But I'm wondering if theres a way to make curses apps run on OS-9 does the
>> OS-9 console emulate any particular type of terminal? (one that implements
>> escapes for character attributes, cursor movement and such) at the worst I
>> could always hang a real terminal off of an RS232 port.
>>
>> I would like to see just how far I can go with both OS-9 Level 1 and 2
>> (most likely NitrOS-9)
>> one of the ideas being a sockets library for OS-9 that talks over a serial
>> line to a PC and gives access to the sockets library of the connected PC
>> plus some UNIX network tools that get linked to that library.
>>
>> But knowing very little about OS-9 and so far not knowing where to find
>> the manuals (Particularly the Level 1 manuals) I'm not sure if any of this
>> is even possible.
>>
>> I also plan to learn 6809 assembly and how to interface directly with
>> hardware, but I figured C would be a good first step. If everything works
>> out nicely I do plan to put together a nice virtual hard drive image with
>> a full development system + UNIX tools etc.
>>
>> I hope I'm not being a pest with this post Ive spent most of my time on
>> UNIX and grew up with the coco2 being the first computer I got when I was
>> 5, and the machine that got me into computers in the first place. so now
>> 20 years later I dusted my old coco off and figured I could still put it
>> to use to teach me about things I never got around to learning, like
>> assembly language and interfacing to hardware directly, writing drivers
>> etc. since its a simple system that is well documented I could learn a lot
>> of fundamental concepts quickly at least thats my thinking. I can't
>> imagine trying to do this on modern PC hardware which is many times more
>> complex and aside from the really standard chips not that well documented
>> at all unless you sign an NDA.
>>
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>
>--
>Coco mailing list
>Coco at maltedmedia.com
>http://five.pairlist.net/mailman/listinfo/coco
--
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)
She blinded me with science!
More information about the Coco
mailing list