Path: utzoo!utgpu!water!watmath!clyde!rutgers!umd5!vrdxhq!dgis!csed-1!roskos From: roskos@csed-1.UUCP (Eric Roskos) Newsgroups: comp.os.minix Subject: Re: porting minix to the mac Summary: lack of low-level doc'n on Mac may be a problem Message-ID: <254@csed-47.csed-1.UUCP> Date: 21 Jan 88 02:50:52 GMT References: <1436@lll-lcc.aRpA> <1825@botter.cs.vu.nl> Organization: IDA, Alexandria, VA Lines: 44 Another problem with porting to the Mac will probably be that the really low-level interfaces are not well documented at all. There is some boundary between what's in ROM and what is loaded by the resource manager from the system file, but (because Apple didn't want people to bypass the well-defined interfaces) this doesn't seem to be documented anywhere in the amount of detail needed to port another OS to the Mac. For example, how system initialization occurs (*in detail*) when you first start the system does not seem to be documented anywhere. This is likely to be a problem in at least two areas (besides initialization): 1) There's no character generator, so ideally you would like to use QuickDraw, probably, to write to the display. But how to get QuickDraw to use a particular font you have (given that the normal QuickDraw calls use the Font Manager and Resource Manager) without initializing some other parts of the Mac Toolbox may take some work to figure out. (Also on some of the earlier Macs there were not fonts in ROM.) 2) Disk I/O to the floppy disk drive is not done via a disk controller the way it is on the PC; it is done via an "Integrated Woz Machine" which seems to be just some simple control logic you can use to turn on the drive, toggle the write line (or sense the read line) from the disk head, step the head, etc. They have a tight loop in the disk driver that sits and looks at bits coming in, or generates bits going out, rather than issuing a request to the disk drive like "read a block" or "seek to track n". Again, this means that the best way to do it would be to use the ROM, but again it is not that well documented exactly how to do it. (Also, while disk I/O is going on you can't do anything else, which means you lose some of your concurrency.) This is not to say "don't try it," but rather just that the documentation supplied by Apple is not as helpful as that provided with the PC (in the Technical Reference) since they intentionally have tried to layer the machine's architecture such that what you see as an applications programmer is a "smart machine" with the underlying mechanisms hidden. Actually this is an admirable design goal (despite the many drawbacks of the conventional parts of the OS, which are very primitive), but to keep people from "cheating" they way they do on the PC (calling the BIOS directly, etc.) I think an intentional attempt was made not to document the low-level architecture. There seem to be scattered "underground" documents where people have gone in and figured out things by trial-and-error or disassembly of parts of the ROM, though, (e.g., in MacTutor, maybe), so with some research you probably can find those. But it is likely to take some time just to figure out how to work the machine before you can start porting Minix to it.