DSITRI
Dr. H. Nikolaus Schaller Information Technology Research Initiative (DSITRI), Oberhaching,
Germany
1. What is Mac06?
"Mac06" is a lightweight environment resembling the UNIXª programming
and user interface running on top of MacOSª. It is therefore virtually
hardware independent within the Macintosh computer series, as the already
existing device drivers are used. The file system completely relies on
the MacOS HFS and, therefore, transferring data between Mac06 and MacOS
is very simple. Programs can be compiled using the integrated development
system or external IDE like Symantec C++/THINK C or Metrowerks CodeWarrior.
In this environment, even the MacToolbox (dialogs, windows etc) can be
used within Mac06 executables. It is also possible to launch any Mac application
from within the Mac06 system.
2. Where can I download the files?
Either from the info-mac archives or directly from
http://www.dsitri.de/projects/mac06/index.html
Please note the COPYRIGHT and LICENCE conditions and the README file as
well as the latest Release Notes.
3. Which hardware is supported?
Regarding processors, all Macintosh, Macintosh Performa and PowerPC platforms
are supported in principle as well as MacOS 8.x - but they have not been
tested in all apects. In fact, the system relies completely on the documented
MacOS programming interface. Only devices mapped into the Mac06 system
calls are available. These are in the current release:
-
monitor screen (any LCD or CRT, any resolution and color depth)
-
mouse
-
keyboard
-
HFS disks (IDE, SCSI, internal, external, hard and soft, floppies and CD-ROMs)
-
sockets (MacTCP)
-
serial interfaces
There is no printer support yet. BSD socket calls for TCP/IP including
UDP and DNS are supported through MacTCP and the PPP-version you have installed.
The system has been compiled and tested on a Performa 5200 with MacOS 8.5.1
using Symantec C++ for Power PC version 8.0.3, and a PowerBook 165 with
MacOS 7.5.5 and Think C 7.0.
4. What is the latest release?
The latest release is mac06-1.1.
5. When is the next release coming and what is on the roadmap?
I can't announce the next release yet, but there are already too much ideas
to include:
-
more POSIX compliance
-
POSIX.2 compliant shell
-
XPG4 compliance
-
improve terminal window capabilities
-
platform independence and ELF
-
math library
-
much higher performance of system calls
-
protected processes and real preemptive multitasking
-
X11R6 and Xt, Motif etc.
-
A Finder-like GUI based on Motif
-
...
Tell me what you would like to have next.
6. Where can I find the source code?
Sorry, but the policy is not to publish the source code of the kernel,
the libraries and the applications but it can be made available on individual
negotiation of a contract. All code has been completely rewritten by using
publically avaliable descriptions and is not based on freeware/shareware
source code from e.g. GNU, Linux software.
7. What does "Mac06" stand for?
Mac06 (pronounced "mac-oh-six") is an allusion to "POSIX" (the portable
operating system standard IEEE Std. 1003.1-1988/90) and to the Macintosh
operating system "MacOS". The idea to rename the system from the initial
working title "minux" (mini-unix) hit the author while walking to attend
the "Systems 97" fair in Munich - the time the vision of an Mac-POSIX operating
system began to grow from "mini" to "full sized".
8. How are file names converted?
File names having dots only (i.e. ".", "..", etc.) under MacOS are prefixed
by two additional dots in Mac06. Therefore
-
"." becomes "..."
-
".." becomes "...."
-
".x" becomes ".x"
-
"..z" becomes "....z"
Additionally, slash characters ("/") are replaced by ":" and blanks ("
") by underscores ("?"). Therefore, the MacOS file "..Test x/y" is listed
under Mac06 as "..Test?x:y". These rules are applied vice versa for creating
new files and directories. All this is done to keep the directory structure
transparent. Note that the virtual files (to be correct: directories) "."
and ".." are available under Mac06 only and have no direct MacOS equivalent.
And, finally, please note that upper and lower case characters are
distinguished! - At least mostly. Unfortunately, you can't create
two files that are distinguished only by uper- and lower case, i.e. Makefile
and makefile. Either one will be listed correctly and found only when entered
appropriately, but the Mac HFS can't store both.
9. How do I write appliction software for Mac06?
At the current stage, there are two solutions:
-
use the integrated development system (c89 C compiler, as
assembler, ld linker and the libraries provided)
-
use Think C or Symantec C++ for Power PowerPC.
A sample project (68k and PPC versions) can be found in /home/demo/src-Think.
-
use Code Warrior. A sampe project written by Erik Winkler can be downloaded
from http://www.erols.com/ewinkler/cwmac06.sea.hqx.
10. How are the file creator and file type attributes handled?
-
For listing files, the file type 'APPL' makes ll display a 'x'
(for executable).
-
For text files, the file type 'TEXT' makes read (and write) calls to convert
'\n' to '\r' and vice versa.
-
If new files are created, a kernel-builtin table (later on defined by /etc/mactags)
is consulted to define the creator and type. With this table, the kernel
tries to identify the file name extension (.c, .h, .doc, .zip, .gif, .sit
etc.) and set the creator and type. If this fails, the file is created
initially with creator '????' and type 'TEXT', and after the first write
to the file, the first bytes are scanned for a magic pattern. Then, the
creator and type attributes are modified accordingly. If this still fails,
you should drag the file onto 'Binary Pump' which has its own (configurable)
tags table. By the way, only the u+w attribute (chmod u+w, u-w) is changeable.
11. How to Quit?
Either:
-
select Quit from the File menu
-
send an 'quit' 'aevt' through AppleScript to the Mac06
application
-
enter 'shutdown' in a root shell
-
press cmd-alt-. to kill the kernel (application processes will
keep running!)
If the kernel is killed and application processes keep hanging around in
the MacOS process list, kill them by hand (tricky on the Finder - but AppWatcher
from www.mauisoftware.com may
be helpful).
12. Where does /usr/bin/sh.1 come from?
This is a tribute to the way MacOS launches applications. Although MacOS
7.x is a multi-tasking system, there is the restriction, that each application
can be run only once. The reason lies in the way, application configurations
are stored in the ressource fork of the file. Therefore, several images
of the same application code in memory could mangle up the resource fork
and therefore MacOS does not permit to launch the same application file
more than once.
If you are running a server system, you may be aware of an exeption.
It is possible to set the multiLaunch flag through ResEdit. Then, the same
application can be run on an AppleShare network on different machines
- but still not on the same.
Mac06 therefore tries firstly to launch the original. If this fails
because the process is already running, the kernel makes a copy of the
application file (named sh.1, sh.2 etc.) and launches
this. Therfore, two ressource forks exist, the files have different names
and MacOS will launch the application for a second time. This copy will
never be deleted automatically, but it will be reused. By calling shell
scripts and some applications which fork() and exec()
others, you will certainly run across this feature.
13. Why is Mac06 a full kernel and not simply a POSIX library doing all
this file name conversion stuff?
Well, most of the POSIX system calls could be implemented in a library
module that transforms all the Mac Toolbox calls to POSIX conventions.
Even processes could be managed - but the fork() command has a very special
side effect: all file descriptors in both processes share the current file
access pointers. This can not be implemented in a library with variables
local to each process. Therfore, a separate kernel process holding this
information is required. Additionally, this concept is much more flexible
and allows for much better multitasking. Nevertheless, the multitasking
model is not preemptive as in UNIX but cooperative.
14. What are the terminal control characters?
/dev/console and /dev/tty1 etc. emulate a VT52 with 24x80
screen. If you resize the window, neither the number of lines and columns
is updated, nor the LINES and COLUMNS environment variables.
15. How far dows the POSIX compatibility go?
Compatibility is currently somewhere between 90% and 95%. Not supported
are:
-
terminal attributes for serial devices
-
floating point support
-
full fork() and exec() sematics (only a non-standard
forkexec()
function is supported)
-
file links are not handled properly
-
the shell is not exactly POSIX compatible (syntax & sematics)
-
POSIX signal handlers
-
NLS and wide character support
The fork() and exec() topic can not be easily solved.
The others are being worked on.
16. What is UCODE?
UCODE is a bytecode for a virtual machine very similar to the conecept
used for Java (and was used for the UCSD PASCAL 20 years ago). This bytecode
defines the operations to be done for executing a program. The UCODE is
based on a stack machine model that is easily interpreted and is optimized
for the C code of UNIX applications. Therefore special codes are included
for strcpy, memcpy, switch and system calls.
The idea behind using UCODE is that it gives platform independent application
codes (although they are slower that e.g. 680x0 or Power PC native code).
17. Which Books can you recommend?
-
Donald Lewine, POSIX Programmer's Guide, O'Reilly&Assoc., Inc., Sebastopol,
ISBN 0-937175-73-0
-
Thomas Horn, Systemprogrammierung unter UNIX, VTB, Berlin, ISBN 3-341-01090-4/0863-0860
-
Michael Beck et. al., Linux-Kernel-Programmierung, Addison Wesley, Bonn,
ISBN 3-89313-939-X
-
Banahan Rutter, UNIX
Back to Mac06 Home Page
©hns@dsitri.de
Last Modification: 01 Jul 2001