[Coco] Virtual Memory in OS-9

Joel Ewy jcewy at swbell.net
Tue Jan 22 22:02:38 EST 2008


William Schaub wrote:
> 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/
>>
> Are there any surviving level 1 docs someplace?
The documentation for NitrOS-9 can be found here: 
http://nitros9.sourceforge.net/
There are 3 PDFs:  Getting Started With NitrOS-9, The NitrOS-9 Technical
Reference Manual, and The NitrOS-9 Level 2 Windowing System.

I haven't done any C programming on the CoCo in the NitrOS-9 era, so I
haven't used these manuals as a programming reference, but a cursory
glance makes me think they're just what you need.
>>> 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...
>>
> I'm mainly interested in NitrOS9 I'm looking through the sourceforge
> trees and wondering
> what tools are needed to compile it as I might be interested in
> monkeying around with the internals a bit. From looking at the docs
> there appears to be a way to map blocks of memory outside the process
> address space into the process address space. I wonder if a system
> could be setup where theres a paging file  and gets paged into and out
> of a buffer that can be mapped into a processes address space. Only
> problem with that is I'm not sure if there is any way possible to
> produce page faults to drive the pager I think a VM system like I'm
> used to requires a bit more hardware than the coco has availabe.
>
I think you're right that "demand paging" by means of hardware page
faults is not available in the CoCo's hardware.
>>> 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. 
On an OS-9/68K machine like an MM/1 with 1-9M of RAM it's not too hard
to port reasonably sized UNIX code.  Stuff like NetPBM works great on
the MM/1.  With the CoCo, even with level II (Nitr)OS-9, each process is
limited by the 64K address space.  Yes, your program can dynamically map
memory in and out of its address space, but it's still a much more
constrained environment than the comparatively big, flat address space
of the 68000.
>>> 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.
>>
There are two different systems of screen codes:  the one for Level I,
using the VDG in the CoCo 1/2, or VDG-compatible GIME display modes in
the CoCo 3; and the Level II system for the CoCo 3 high resolution
graphics modes and 40/80 column text modes.  The VDG stuff works in
Level I or II, on all CoCos that can run (Nitr)OS-9, and the
grafint/windint stuff only works on the CoCo 3.  The latter has all
kinds of nifty window support, but all of them support basic stuff like
positioning the cursor, etc.  There is support for all this stuff in C
and BASIC09.  The WindInt 'API' was copied and extended for KWindows on
the MM/1, so anything you write for that system could easily be ported
to OS-9/68K.
> I'm guessing that the same codes work between level 1 and 2. I hope
> the curses port is still around someplace.
>
If you use the VDG screen codes, it will work on all CoCos and will work
with Level I and Level II, presuming the VDGINT module is loaded.  I
believe that VDGINT only works with the 32-column screen and graphics up
to 256x192, whereas the GRFINT/WINDINT modules work at 40/80 columns and
allow use of the CoCo 3's 320x200x16 and 640x200x4 graphics screens, and
WINDINT has support for goodies like scroll bars, overlay windows, and
the mouse.

I'd love to see what kind of software you come up with!0

JCE
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>




More information about the Coco mailing list