Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pacbell!noe!marc From: marc@noe.UUCP (Marc de Groot) Newsgroups: comp.lang.forth Subject: Re: Mini History Keywords: FIG Message-ID: <730@noe.UUCP> Date: 10 Dec 89 02:49:20 GMT References: <5565@sdcc6.ucsd.edu> <6467@tekgvs.LABS.TEK.COM> Sender: usenet@noe.UUCP Reply-To: marc@noe.UUCP (Marc de Groot) Organization: Noe Systems, San Francisco Lines: 77 In article <6467@tekgvs.LABS.TEK.COM> toma@tekgvs.LABS.TEK.COM (Tom Almy) writes: >In article <5565@sdcc6.ucsd.edu> ir230@sdcc6.ucsd.edu (john wavrik) writes: >>The Forth Interest Group did a very interesting thing at about this time.They >>defined a language by a model rather than a standard. Their model included a >>suggested implementation. As a result, they defined, in fact, a tightly mixed >>blend of language, operating system, language implementation,and mapping to a >>host processor. Forth is actually the name for Siamese quadruplets! > >And an excellent idea! I found figFORTH to be the most portable version I >ever used because the implementation was defined! Prior to figFORTH I had >brief brushings with URTH (University of Rochester forTH) and STOIC, but >these (along with Forth Inc's products and MMS Forth -- another early >commercial entrant) were totally non portable. I used figForth implementations >for 8080, Z-80, 6502, 6809, PDP-11 (and VAX using 11 emulation mode), 8086, >and 68000, from different vendors, with complete code portability. Amen. I ported a complete development system (editor, debugger, decompiler, source-finding utilities) from my 8080 CP/M fig-Forth system to my housemate's LSI-11 system in one afternoon, with ZERO changes to the source. The vast majority of the effort went into establishing an RS-232 link between the computers. >I hacked on my 8080 >version to make it multi-user and ended up with a terrific 3 user version >on my 5 Mhz Z-80 system. I even had a printer spooler task so that all >users could share the printer (they would print by sending a command line >to the printer task), and printing would then progress in the background. >Each user had its own "termcap", and the CP/M 3 O.S. had disk cashing which >minimized disk thrashing. > >Of course, nobody really cares about multi-user systems these days, but it >was facinating to see it in action. Right. ;-) I hacked up my 8080 fig-Forth to multitask. It even had job control! You could type bg wordname to put a Forth word in background. Each task had a fixed portion of RAM which included stack space, dictionary space, and user variables. A task could compile source from the disk and then run it. By playing with the link fields Forth words could be traded between tasks. The fetch and store words did memory bounds checking, which gave a certain amount of memory protection. I wrote an IPC package which was independent of the transport layer and which ran in a "system task". I then ported the system task code to a fig-Forth on an Apple II and ran the IPC package over a serial line, just to show it would work. Terminal I/O was vectored and I could attach my terminal to different tasks by patching the vectors. My housemate and I entertained our- selves by playing "Forth dictionary wars" -- seeing who could crash who with two terminals attached to different tasks. The system was "pre-emptive" rather than "polite": I wanted all the code I had written for Forth to run without inserting PAUSE all over the place to get it to context-switch. I used a 1-byte counter which was decremented. Context switched every 256 (or less) times through NEXT. The number was settable for each task, allowing very flexible scheduling. This mechanism allowed one task to single-step another, by setting the down-counter of the task to 1. This would cause it to switch context after one cycle through next, allowing the controlling task to "grab" control. A task could be made to sleep by setting its counter to 0. BTW, the overhead for all this wonderful stuff: 3% of the CPU time. A single task running on the multiuser system took 3% longer to run than the same task on a single user system. But, like Tom said, nobody cares about multi-tasking systems anymore. Too bad. -- Marc de Groot (KG6KF) |"...few people know what to do with a computer. Noe Systems, San Francisco | They decide that running an operating system UUCP: uunet!hoptoad!noe!marc | is a substitute for doing productive work." Internet: marc@kg6kf.AMPR.ORG | -Chuck Moore