Natural #01
01 апреля 1998

Ideas - How to write a multi-tasking operating system. What should be the perfect operating system for the Speccy?

<b>Ideas</b> - How to write a multi-tasking operating system.
 What should be the perfect operating system
for the Speccy?
                           IDEAS



                        (C) Sir Ilias.


       How to write a multi-tasking operating system.


       The article was written quite some time - 2 months ago
and some things have already become outdated, but I did not 
change it. Dopolnkniya you will find at the end. 


       (I apologize in advance for their "Skorpionoyazychnost, 
but I have Scorpion and this could not affect the article.)



       The idea of ​​this article dered for some time. And it 
concerns a sore topic - the operating system (OS) for our 
beloved Speccy (Scorpy, Profi, ATM, Pentagon, etc.). 

       It is quite clear that existing solutions do not meet 
and can not respond bolshinsvo users programmers (and for a 
normal, long-term development systems need a standard that is 
most easily established if the system satisfies the majority). 
And if you meet only a small part. For example TR-DOS has long 
been obsolete and use it only out of habit and for lack of 
altenativy. The truth known at least two attempts to breathe 
new life into it - the introduction of support for HDD TR-DOS. 
This MFM hard drive controller C. Veremeenko (ZX-Review 5.4 
1996) and the IDE controller on SMUC (Scorpion and MOA 
Universial Controller) designed for the Scorpion ZS 256 (owner 
whose I am.) 

       IS-DOS is good on the part of the text editor and 
programs printing, as well as support for HDD, which is to the 
best of my information at this time introduced by Kay, ZX-Next 
and the Scorpion (I'm currently working on the HDD 40 Mb, 10 of 
which under the IS-DOS). But it is extremely inconvenient for 
working only with floppy disks, as well as the lack of quality 
instumentalnyh SCS to develop their own software.


       System implementation psevdomnogozadachnosti MagOs good, 
but that was all her charm to an end, as all time affect the 
lack of memory (two 128th program can not be downloaded, 
although in some room ZX-NEWS, was announcement of the 
expansion card to the Scorpion 2-Mb, Sergei Zonova, but 
anywhere else I have about this revision is not heard. ), Also 
MagOs 6.3 Weirdly slow when working with HDD (zagruka / 
unloading slowed times in thirty, just a nightmare! ) In 
addition there are no system restarts and other such 
paraphernalia OS true in the new version of all this promise, 
but so far I do not per se seen. And the most important 
shortcoming of the OS that it can operate only on Scorpion'ah, 
and therefore not will become the standard (unlikely owners 
Profi, ATM, Pentagon 'etc will run out and buy another 
computer.) 

       Radically new reference system has been operating Pink 
Floid by Domen Int. Here multitasking and graphical user 
interface Standard SAA / CUA (ala Windows), and support for 
HTML (the standard for multimedia documents on the PC, Amiga, 
Mac 'etc) and much more. But podkachala implementation of 
multi-tasking and some other ideological errors / 
pogreshnosti.V result, the system was regarded as unsuccessful 
(ODISSEY # 2). 

       In fairness I would like to note that the person at the 
Pink Floid did not work and has formed his opinion based on

description in the ZX-FORMAT # 5, and publications in ODISSEY # 
2 and ZX-NEWS'97 (do not remember the number).



       So what should be a perfect operating system
for the Speccy? I would venture to formulate some kind of 
technical proposals. 


       General provisions:


       Operating system - each user. It should
be as open. Nor any protection from the built-in shadow of 
monitors (ie Scorpion'e must not spoil the eighth Bank of RAM, 
but if the user wants - and can zaportit.) nor any protection 
from Magic. Little whether that will need to perform user for 
their needs. Although, of course, for commercial non-system 
programs (eg games), we must provide the ability to block 
access to the shadow the monitor for its implementation, but 
also provide an unlock screen after completion. But I repeat, 
it is advisable to only for games.


       Maximum use of individual features
user's computer. (Napimer in Scorpion'e have built watch, as 
well as the BIOS, if desired user'a ensure the disc and through 
him, in addition, on many machines are flashing TR-DOS, which 
has routines to read and write to arbitrary ports (in a, (bc): 
ret; out (bc), a: ret), not to use this opportunity should not 
be.) 


       Minimum configuration to recognize the Spectrum 128. (Yes
forgive me, the owners of the 48th Spectrum'ov, but the 128th 
is really the minimum configuration for nomalnoy work.) 

       Switching pages 128th memory ONLY # 7FFD.

       Any application should work fine on a minimal 
configuration. 


       From the perspective of users and programmers:

1. Mnogokatalogovaya disk subsystem.
2. Graphical multi-window interface, preferably in

   Windows 95 (PC), or as in WorkBench X. XX (Amiga).
3. Mouse support (Kempston and AY). And here ostanovochka.

   In various publications on the Speccy more publications 
Village    vyaschennyh standard Kempston Mouse - it's good, but 
there 

   and those that contain CHUDOVISCHNAYA misinformation in

   They write that KEMPSTON MOUSE three buttons (Scheme

   controller SPECTROFON # 20) - it is not so!

   Users, programmers, and remember Tell everyone:


           In KEMPSTON MOUSE - two (2) button!


   (You can read about it in the ZX-REVIEW '91 p. 121, second

   column, ninth line from the top. As well as a description

   controller mouse as Scorpion. If you're still not convinced,

   please ZX-FORMAT - they support tailed with the first
   atomic number. ) And they are interviewed on port # FADF, d0 
= 0 for 

   the left button pressed, d0 = 1 when pressed the left 
button. For 

   Right similarly used d1. If the version of your

   mouse controller three buttons, then do not use a third, not

   break off users who have purchased STANDARD

   Controller Kempston Mouse.
4. Transparent work with MS-, TR-and IS-disks. In the extreme

   If the presence of the converter. (I say this as enough to
   mayavshiysya converted into IS-DOS.)
5. Support for TR-, IS-HDD (Scorpion, Kay, ZX-Next).

   (This is so as not to overwrite the entire IS-screw on the 
floppy and not for    kachivat it to screw the new system.)

6. Support for RAM-disk.
7. Multitasking (details below).
8. Support for the clipboard data between applications.
9. Preferred implementation of analog ARexx (for Amiga - 
mezhprog    Stamping language that allows multiple applications 
to unify 

   a single environment).
10. Preferred implementation of analog IFF - data format (for

    Amiga - a single communication standard for text, music
    ki, graphics, etc.).


       Now, in general terms about the internal structure.


                 Multitasking.


       I have long been dered the idea of ​​multitasking on the 
Speccy. Had worked many options and in the research I had found 
the only best option for multitasking architecture ZX Spectrum. 
It imposes minimum restrictions on the program and does not 
require a radical change of programming style (cool praised ;-).


       Method based on the second interrupt mode. Now
details.

       Suppose we have in mind is two (2) programs and
we need to carry out their running in parallel. The first is 
located at # C000, the second # E000. Part of the system 
responsible for multitasking drivers, etc. depends on 
interrupts. We report the system address of the program through 
the table in the appointed place. The table looks like this: 


                            # C000

                            # E000.

The system transfers control to the first program entry through 
the desired address on the stack (ld hl, # c000: push hl) and 
out of the masked interrupt executing RETI. Then, the first 
program runs quietly until, until comes INT, the processor 
enters the current address of program 1 ( Register PC, for 
example # E32E) onto the stack and goes to the processing 
masked interrupt, that is, the system starts. System preserves 
all the registers and takes from the stack CURRENT ADDRESS 
Program 1, and place the file it to our table. Table becomes as 
follows: 

                            # C32E

                            # E000.

The system then calls the drivers, residents, increasing the 
system clock, etc. Increases the index table, puts different 
value on the stack (in our case # E000) and returns from the 
interrupt. Then run the program 2. Then again comes to 
interrupt and the system, restore the pre-registers for the 
program 1, switches to it. 

       This creates the illusion of running in parallel program 
execution. In reality, the system just once in the interrupt 
switches to another task. I hope now everything is clear. 

       From the foregoing, understand the limitations imposed on
program:

       1. Does not prohibit the interruption (except for 
special cases). 

       2. The program itself must be adjusted to the desired 
address 

          (To be relotsiruemoy).

       3. Write on the screen only by drivers

          system (an exception can be made only for

          full-screen mode (see below)).

       4. Switch memory pages only through the driver

          system.


       It is clear that even the two major programs will not
function normally in the 48th space on this
I suggest the following allocation of memory (approx.):


    # 4000 - # 5b00 ... Screen area

    # 5b00-# 8000 ... Nucleus (restarts), IM2-module (provides

                    multitasking), buffer-descriptor prog
                    Ramm (registers, the current address), 
location 

                    for residents, drivers, etc.

    # 8000 - # C000 ... Place for 48 modules. (Program

                    should consist of two (or more) per hour
                    Taylor, a managing memory

                    # 8000 - # C000, while the other side of 
the pages. 

    # C000-# FFFF ... Place for the programs themselves.


       This example is conditional and not a non-binding.


       The program should be able to be in three main modes of 
operation (similar to Windows 95): 


       1. Window. Via the driver system.

          (For some programs do not necessarily (for games).)

       2. Full screen. Can be done via the OS

          and through their own routines. (For some
          ryh programs are also not required).

       3. The so-called "sleep" or "collapsed" when

          program is in memory, but do not call system
          theme (the current address of the program is skipped 
in the table           face addresses). If necessary, you can 
return to 

          program.


       The operating system should enable one
application to rent another, if necessary, applying for
permission to the user.

       By the way, restarts can be made as to the IS-DOS 
through RST 16, but DO NOT THROUGH RST 8, because in this case

break compatibility with Scorpion'ami. You can also make
Restarts a CALL ADDR, but in this case have not changed
this address in future versions of the OS. While CALL ADDR and 
takes 2 bytes larger, but will act quickly so as not

program is executed from ROM, also need not worry which bank 
ROM connected. 


           Priorities in software development

                  software for the new OS.


       In the first place must be in programming, that is, 
basic disk with the new OS should have its own assembler, 
developed specifically for this system, rather than creepy 
adaptation. This should be a comfortable environment for 
creating programs. If the environment is comfortable, then 
programmers will create the same convenient programs. Assembler 
must provide (as standard) relotsiruemyh generation programs, 
drivers, residents of the new OS. Later, you can write SI - 
Wednesday, etc. Well, probably to ensure BASIC-support. 

       Then there are utilities, games and applications. (
Here creators Pink Floid gone right way by announcing
their game "expansion.") You also need to ensure TRDOSovskih 
launch programs from the OS. 

       Moschny very helpful in the dissemination and 
popularization of the new operating system could issue of a 
periodical (e-magazine / newspaper) for it, which to maximize 
its capabilities (multi-tasking, window interface, etc.). This 
publication could cover problems / prospects of the OS, share 
new technologies for it, but do not dwell only on her, and be 
just an interesting publication. 


       Well Well, once you've read here, you navenyaka Projects 
interested in this as a user, programmer or developer and you 
have certainly raised some questions. I'll try to answer some.



               Why are you all here written?


       - I think that my idea of ​​multitasking
quite interesting and the way I proposed is sufficient
optimal. I hope someone reads this creation and
write to the same normal, friendly, multi-tasking operating 
system for the ZX Spectrum (and may well somewhere my imechko 
mention ... ;-). 

        Vobschem all the ideas presented in this paper, I 
present the fact who will take to implement them. Yes, if you 
take, do not be lazy, write me - I'm happy. 


   Why you did not started to implement this Projects?


       - Guts. I have no experience in OS development. A 
"please" You emergence of a mutant ... it is not for me.


       That's all, if you did not guess your question is, do 
not be angry - I still do not clairvoyant, send it to me. 


       Now the promised add-on. From a telephone conversation
with a company representative Scorpion (carried out by
robbing his grandmother ;-) I learned that an expansion card
includes the "extender" memory up to 2 mb, expanding the 
graphical display, the resolution of which will be in my 
opinion (do not remember exactly) 512 to 384, color is set for 
each byte (for 8 points), plus hardware scrolling. There will 
also be introduced Two new modes, identical in performance to 
firm Speccy, and Pentagon'u. The board also will be flash-ROM

ROM containing the latest version of Scorpion, and everyone in 
the future will be able to update the ROM version without any 
problems - from a floppy! It remains to say that the fee is $ 
10 (1 USD = 06.05 rub.) and to remind the phone company 
Scorpion: 


         (812) 298-06-53, 172-31-17 (Order Department)

               251-12-62 (repair service)

               130-19-95 (office software).





Other articles:

Entry - Perm computer newspaper.

Read Me - Ol Speccy is going through difficult times in our city.

Ideas - How to write a multi-tasking operating system. What should be the perfect operating system for the Speccy?

Fantasy - the story "Reservation."

Humor - Several homemade prikolov.Snachala about all your favorite PC.

Detective - Wanted version of the graphical editor Art Studio supports kempston mouse.

Advertising - Ads are published free of charge (at least until slyuchae).


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Music scene - Review active in 2007-2008, Spectrum musicians.
Feedback - contact the publisher.

В этот день...   21 November