Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucrmath!rhyde From: rhyde@ucrmath.ucr.edu (randy hyde) Newsgroups: comp.sys.apple2 Subject: Re: Building a NEW computer Message-ID: <10395@ucrmath.ucr.edu> Date: 7 Dec 90 17:39:11 GMT References: <10895.apple.net@pro-angmar> <1990Dec6.171148.9281@ux1.cso.uiuc.edu> Organization: University of California, Riverside Lines: 41 The 6502 indeed supports several "test and set" instructions. You've probably known them as LSR and ASL in past incarnations. Both of these instructions can be used to perform an non-interruptable test and set operation. Of course, anyone who has taken a operating systems class in the past 15 years or so *SHOULD* realize that (1) an atomic (non-interruptable) instruction doesn't always do the job. I.e., TSB would not work if you have two processors accessing memory because only memory cycles, not instructions, separate accesses to the semaphores. I ran into this problem when working with a MILL card (6809 coprocessor) on a lowly Apple II (not even a "+"). The solution? (2) Lamport's Bakery algorithm (or Dekker's algorithm for only two processes) works just fine. You don't need uninterruptable instructions to prevent multiple processes from entering a critical region. As for the complaints about the Apple II not supporting multitasking: It most certainly does. I've written a couple of multitasking OSes for the Apple II (mostly as an academic exercise). What people really want is a multitasking DOS 3.3, ProDOS, or GS/OS. *THAT* is probably not possible. But multitasking certainly is; I've done it. While it's true that the 6502 doesn't support memory management (on chip, it can be added) and other neat features, people were running multiprogramming operating systems on CPUs much me primitive that the 6502 25 years ago. To address the other questions of 6502 shortcomings: keep in mind that the 65xxx family is a family of controller chips, not general purpose CPUs. It doesn't support MUL and DIV or (heaven forbid!) floating pont because the applications (i.e., Nintendo) where the chip was destined don't require it. They need something cheap. MUL, DIV, and FP cost money! Apple II (and especially Apple //gs) users think their machines drive the CPU development. DEAD WRONG! Apple has only sold a couple hundred thousand GS machines. Compare that to the millions of Nintendoes sold. If you want to run UNIX, buy a Next (if you're a student) or an AMIGA (if you're not a student). The 65xxx family just doesn't have enough get up and go to support UNIX. Better yet, scoot on over to the comp.sys.nsc32k group and order a PC532 board (32532 CPU). Now that's a great UNIX chip. *** RAndy Hyde O-)