Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!spectre.ccsf.caltech.edu!tybalt.caltech.edu!toddpw From: toddpw@tybalt.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: System programming for the Apple II (preferably the IIe) Message-ID: <1990Mar8.021023.4384@spectre.ccsf.caltech.edu> Date: 8 Mar 90 02:10:23 GMT References: <6673@hydra.gatech.EDU> <7368@latcs1.oz.au> <7373@latcs1.oz.au> Sender: news@spectre.ccsf.caltech.edu Organization: California Institute of Technology Lines: 48 stephens@latcs1.oz.au (Philip J Stephens) writes: >That doesn't mean you can't create a stripped-down version of >Unix which supports single processes. >It would simply >become more like CP/M than Unix (TM). What use is there for CP/M anymore... A single process unix is not unix, it's useless. > Maybe what I should have said is that the Apple //e is not the best computer >to implement a multi-tasking operating system like Unix, simply because it >doesn't provide an interrupt source. Sure, you can get an interrupt source >by adding the right card, but a standard //e can't do it. You'd need to >interpret your code, and that's slow. Interpret what? Who said anything about that? You can multitask without interrupts if you do it Multifinder style: All task switches occur during GetNextEvent or WaitNextEvent calls to the system (there may be more but it does work on a _cooperative_ basis, that is you must tell multifinder that you may be switched out and asking for an event does this because you are assumed to have processed all of yours before you call it). On the 6502, this could be done by the BRK instruction... Since it would also have the same hardware effect as an interrupt from a card then you could move to a real pre-emptive system with less trouble. Context switching would take some thinking out though. > OK, so it _could_ be done if someone decided to sit down and work very >patiently through the problems. But the fact remains, the 6502 isn't a good >processor for the job, and _alot_ of messy, sneaky tricks would be needed to >get it to work. I wouldn't like to be the one who has to figure out the >best way to implement virtual memory and paging (without exception conditions, >you've got to simulate this in software) and so on. I'm sorry about this, >but I hate messy code, that's all, which is why I said it in the first place. You're forgetting something which lots of people like to ignore: In real systems doing things in hardware usually means moving the mess into hardware unless somebody thinks of a clean way to implement it. Granted, it is much easier to implement the stuff in hardware, but I like the idea of figuring out a simple and efficient VM/paging system for the 6502 because it would encourage decent programming practices and might lead to the development of a great compiler and possibly an entire operating system. The 6502's virtue is that it is simple and cheap. The rest is up to us. Todd Whitesel toddpw @ tybalt.caltech.edu