OS Topic - We finally decided to organize a special section to discuss a topic that, despite the bold statements of some individuals, nevertheless worries Spectrumists a lot.

ZX Time #11
 Theme >OS<
---------------------------------------
                                        
 In early youth, the muscles of their jaws
    I developed the study of law,          
 And so often I argued with my wife, 
    What I learned to chew to perfection!       
 /Lewis Carroll/
                                        
 Editor: We finally decided to
organizing a special section for discussing
of the theme, which, despite the bold
statements of some individuals, however-
she is very worried about spektrumists. In this
section will contain a variety of
notes, judgments, examples, discussions,
comments, etc. regarding the implementation
tions on the Spectrum of the new operating system
topics. Therefore, I appeal to all concerned
evil - WRITE!!!                     
                                        
   The first article in this section is
reflections Vladislav Semchenko from
Kharkov about the implementation of the so-called  ZeroOS.
Give him the floor: - - -                  
                                        
ZerOS                                  
---------------------------------------
 Vladislav Semchenko
                                        
   Since the memory address space is
Ti Z80 is limited to 16 bits or
bChKb, then filling this minimum also
OS is extremely undesirable from the point of view
assembler programmer.  In my opinion
In my humble opinion, it is precisely the problem of shortage
memory and is the reason why
swarm on  Speccy  none of them took root
OSes, proposed at one time by the program
mystami. Of course, it can be argued that
Speccy you can install 128Kb or more,
but we should not forget that it will be
mapped memory as opposed to bCHKb
direct access memory. In other words,
the processor has no means of efficient
memory accesses over bChKb. Access to
the rest of the volume is produced through
mechanism for replacing memory pages, that is
- via a very fast block device -
in. Linear address spacefrom above
bChKb, which is available on the Z380 and eZ80, does not
into account, because while the basic process
ROM Speccy is Z80 only.         
                                        
  The idea below allows you to give back
at the disposal of the user's task practically
virtually all BCs of the address space
processor memory, and at the same time enough
comfortably place the OS.                
                                        
   So, to the essence of the idea. For simplicity of exposition
material, we believe that the computer
contains two memory areas, let's call them
fields (field), each with a volume of bCHKb.
Each of the fields belongs equally to
lies in the processor, is located throughout
its address space and does not intersect
communicates with his double. These two areas
memories are located as if on two hundred
ronah of the same coin never meeting
with each other. The last statement is not
absolutely true, but more on that below. One
of the fields is assigned to OS, and the second is assigned to
user task/tasks.          
                                        
  The system of field relationships is reminiscent of
has a mechanism for replacing memory pages, but
firstly, the replacement is not 1bKb
pages, and all bChKb at once, secondly
switching fields is not carried out
res port, and through the processor command RST 0,
which is almost never used.This solution makes it possible to simplify and
speed up the field exchange mechanism, and
will relieve headaches in the future
upgrading to Z380 or eZ80.              
                                        
  As is known, by command RST 0 and by
RESET (also via TRAP in Z380 and eZ80)
The processor fetches an instruction from
addresses #0000, setting all bits
address bus to "0".  We use this property
we use it to control the operation of the trigger
switch fields.                     
                                        
  Now it's time to explain how
this all works in practice. Presumably
press that the processor executes the program,
being in the field field0. Meeting the team
RST 0 the processor puts the contents of the register
tra PC to the top of the stack and goes to
execution of commands starting from address
#0000.  At that moment when all the ranks
address buses are set to "0", co-
accompanied by active MREQ signals,
RD and M1, the trigger switches
ra and replacing field0 with field1.  When
the processor will continue executing the program
grams, being already in the field field1.
Field0 is also returned
by command RST 0 (see figure).             
                                        
+->#0000+-------+ +->#0000+-------+     
|       |field0| |       |field 1|     
|       |       |-+ |       |----+
|       +-------+ +-------+ |
+---------------------------------------+
                                        
 The main problem when switching
lei - saving and recording content
stack pointer register. The point is
that by exchanging fields we lose
stack! Each field will be forced to have
your stack. Moreover, it follows from this
and that passing parameters through the stack
also turns out to be impossible - parameter-
ry must be passed in registers.
The stack maintenance procedure may have
something like this:                     
                                        
0000 LD (nn),SP ;save SP   
 ;"old" field  
0003 LD SP,(mm) ;SP recovery
                      ;"new" field   
0006 RET ;go to sub- 
 ;program This fragment must be present
at the beginning of both fields. This will allow the work
information about OSu and the user's task, supplementing
each other. It is only important that OSb before
after finishing her work she threw it at her
stack address of software processor
jerks and only then handed over control
to the user's task. If you are
Which option does not suit you, then in the OSu field
it is possible to place such a maintenance procedure
stack living:                          
                                        
0000 LD (nn),SP ;save SP   
 ;"old" field  
0003 LD SP,(mm) ;SP recovery
                      ;"new" field   
0006 JR 0008 ;                 
0008 .......... ;interrupt handler
                      ;vanii           
                                        
  As already mentioned, the fields field 0 and
field1 are independent of each other and in
in principle should not intersect, but absolutely
Complete orthogonality of fields is impossible.
The thing is,what the OSu field should have
access to the task field, at least for the purpose
setting up a stack maintenance procedure,
not to mention the fact that all procedures for
loading/unloading field memory arrays
user tasks, as well as fulfillment
a number of other tasks must be performed by OSb
from your field.                         
                                        
  For programmers who wish
take advantage of this idea and be able to
Maybe they’ll write OSb for Spectruma, I’d like to
I would recommend adhering to the following
purpose when using reg-
line when passing parameters, which
largely coincides with the proposed Zi-
logom for processor macros:       
                                        
 I - software interrupt number
  IX/IY - interrupt function           
A/A' - argument                     
ВС/ВС' - counter                      
 DE/DE' - receiver                     
HL/HL' - transmitter                  
 F/F' - flags                       
 RS - countercommands              
 SP - stack top pointer      
 R - counter                      
                                        
 In conclusion, I would like to say that
This feature does not carry any harmful atavistic properties.
ical action and software written under
it will not need to be redone when re-
transition to Z380 and eZ80. In addition, when
transition to new processors itself
The product disappears automatically! It's all about
that when using the Z380 and eZ80
The handler at address #0000 changes, which
which will not only preserve and
restore the SP value, but also at every
house address by RST 0 change address transfer
processor output in the 1bMB range.     
                                        
                 - - -                  
                                        
 Editor: And the following material is provided
submitted for publication which became the last
time for an "incredibly" prolific author -
KilleRam (as many as two!!! articles for the week!
Considering that I am the only unfortunate replacement
Knocked the shit out of him for several months,
then this “coming of thoughts” is simply amazing
lies :)))).                              
                                        
  ArticleKilleRamcombines non-
how many topics are directly related to
OS problem on Spectrum. Perhaps not
which topics will seem painfully wrong -
similar (like me), but as stated
Kolya himself gives, everything is quite feasible!   
                                        
 - - -                  
                                        
Why???                               
---------------------------------------
 Nikolay Dvornik /K!LleR@M/
                                        
  You may ask: “why is the article called
"WHY?!"  I answer - because in it
I'll tell you about what pisses me off. And on
There are two things that irritate me at the moment: 
                                        
1. Lack of a normal OS on SPECCY:  
 a) lack of multitasking;        
 b) poorly organized disk
     space;                      
 c) closedarchitecture;              
 d) lack of a developed driver system
     ditch;                               
2. "SPECCY INTERNET EXPLORER" problem. 
                                        
 Question one              
 ---------------             
 Multitasking and OS          
                                        
  I can no longer remain silent, because in the edit...
a huge number of people came to share the newspaper
several incorrect responses due to
Do articles about the OS and the implementation of multitasking
honesty... If anyone thinks that SPECCY
in this matter it loses to other platforms
rmam, then I suggest you either stop chi-
Read this article, or read the following
same text, where I will try
state your position on this matter.  
                                        
  First, I admit that multitasking
the reality will not be realtime, but it will
will seriously facilitate the work on our TITA-
NOT, though, on realtime system tasks
simply ZARULIT!!!              
                                        
HowI imagine this:      
 -----------------------------      
                                        
 1. The program is being executed:         
 a) the program is written with a special
       style.  More precisely - everything is on JR's and
       we calmly, at any moment
       I throw it into free memory
       and continue execution;         
                                        
 b) the program is written standardly, but it
       length is given taking into account the stack used
       used memory cells.  I see,
       that in this case the stack and cells lie
       "not far" from the main program.
                                        
 2. Interrupts have arrived.  Clearly not
     IM2, and special ones (for example, "pri-
     we hand" NMI, or interrupt controller
     ny, something like IM2, but with the possibility
     the ability to set time intervals
     catch) go to the handler, MANAGER
     TASKS, it stops the program,
 saves PC to table (RELOCATION
     TABLE, more about the format later), length in
     it is already recorded initially, recorded
     tells which bank it will be res-
     displaced(split MEMORY into banks
     1bkb or blocks of variable length
     (256-16384b - not yet decided), as
     com bank it must be executed and
     from what address should it be posted?
     originally recorded. When switching -
     between tasks the current suspension
     poured according to the above scheme,
     and the one you switched to is in
     according to RT is transferred and
     starts from the address of the last OS
     tanova.                            
                                        
 3. The whole process is repeated all over again.   
                                        
  Tasks cannot overlap areas
data can be shared
buffer and screen :), controls all this -
with DISPATCHER and SYSTEM MONITOR.
I want to tell everyone who “disagrees” that this is
everything is fine - everything is written and checked,
works, as VNN says - "chick-py-
ki!"                                   
                                        
 Second question              
 ---------------             
 SPECCY INTERNET EXPLORER You will probably say that this is nonsense and
You will be partly right (you will understand why).
I want to note that this is one of the projects
which I'm working on. At the moment
I'm studying a little TCP/IP protocols (already
it hurts they were poorly painted
CODENET.RU).                            
                                        
  I don't suggest making a copy of mustdie'
Evsky.  On the contrary, I suggest refusing
from HTML, JAVA, FLASH (although with
over time, HTML can be modified), and create
give your own hypertext format, based on
on control codes (multiple-type
only augmented text format, which
ry YOU are reading now) with support for-
jocks, etc.                            
                                        
  You may ask why INTERNET and not
FIDO, ZX-NET, etc.?  Yes because they
not so global and the organization in them
WEB structures will be difficult.     
                                        
  As you already understood I-NET in the described
I use the system as a search engine
and no one will be able to view SPECCY-
sites on other platforms (they're stupid)
freaks :)). You will say that the Z80 will not cope
I-NET speed?  The solution is this: put
DMA and modem with ATM (the one made as
DAC-ADC) and get such speeds,
that even ZyXEL Prestige DeLUXE will be
sat :), we just need the text in
special formatdrag it from the server, and Z80
it will be processed, and the file will not be uploaded at all
nonsense!!!                               
                                        
  The main problem: create your own server
(ideal - LINUX) and place the country on it
prostrate for a small fee. Why for a fee?
you probably understand.                     
                                        
  Why not on free servers? Yes, yes
because they advertise on your
page, and in this page format it is
not real.                             
                                        
                 - - -                  
                                        
 Editor:  I purposely do not comment
KilleRam's article, although I have the same
ki tongue itches:)... I want you, chi-
ateliers themselves expressed their opinion about
all of the above.                     
                                        
   And the last thing I wanted to do was
is to produce a short review of letters,
who came to the editorial office regarding the OS and
multitasking.                        
                                        
   One of the first to write about this
sal Dmitry Mikhalchenkov:              
  MD: "1. Regarding the article about OSK. The point is
the fact that killing BasicCh8 in favor of the OS is not
it will succeed! Yes, indeed, the bass is already from-
lived himself, now there is practically no
programs, but... When I started coding,
then I used a lot of subroutines from the ROM ba-
Sika, weren’t you like that? And that we're semi-
What if we kill him? We will get more than 50%
non-working software..."                   
                                        
   DWT: I’ll say even more - they won’t go
all 90% of programs! I wonder where I am
Lag to kill BASIC48?!!  I'm just
wrote about what BASIC48 serves as a modern
to this (I emphasize MODERN) Spec-
truma. And, I repeat, it serves as a launcher
some programs in machine code. But go on
such a radical measure as eliminating
BASIC48 is more than stupid and short-sighted
new. After all, this will not only give rise to
niy, I'm sorry, hemorrhoids (I'll have to though
would be to remake the main systems for
needs of the new OS), but also total incompatibility
cost - which will cause complete apathy towards
the user's new OS.                
                                        
 MD: "There are two outputs:                 
1) Write in such a way that all procedures remain
were in their places... - insanity! This
just hellish torture! Athe winnings are all the same
but it will turn out to be practically zero. Such
the story was already with the TR-DOS ROM for Bay-
Comrade  Normal Bytes do not have TR-DOSi,
they are installed on SR/M, and the ports are on
controller are completely different - so
You can’t just install a TRDOS ROM... What
do?  Resourceful spektrumists have tricked
went ahead and wrote a new ROM TR_DOS, where
all port addresses are translated from standard
contact details for TRDOS to the addresses of your contact
rollerball. At the same time, I earned only 70-80%
of all the software, no matter what you do, it predicts
It’s hard to call..."                      
                                        
   DWT: And therefore - let's leave BASIC48 in
complete peace!  We do not under any circumstances
should lose compatibility with the program -
mi written under TRDOS&BASIC48!      
                                        
 MD: "2) Do not touch the BASICCH8 ROM, but
look towards ROM B128..."      
                                        
   DWT: That's exactly what I'm suggesting!       
                                        
 MD: "...or come up with something original-
nal.  After all, a normal AXIS in 16k is not
shut up, anyway you'll have to load the wood
zit, but it’s best to leave it in ROM only
for universal firewood, computer test, ka-
some kind of debugger monitor and bootloader
AXIS..." DWT: That's possible. And personally I think
that the ROM should contain only important
the most basic and time-invariant processes
fools (for example, handling a disk drive,
keyboard driver, etc.), as well as
"mechanism" for accessing system resources,
also preferably independent of "maneuver-
the ditch of time." Everything else is on external
drives or on a ROM disk.          
                                        
 MD: "...It seems to me that the second method is
children are more profitable.  What do we get by registering
The axis in ROM is another TRDOS or worse
go - basicCh8-2! I'm not a fan of IS-DOS,
but it was distinguished by its special universality
advantage in that it did not depend on the ROM,
not counting the hdd version, but there was only
to a bootloader that could be replaced
thread loading from a floppy disk... For starters -
BASIC ROM is the most important base!  
                                        
   DWT: No, we won’t get BASICCh8-2. Although
would be due to the fact that now there are several goals
others.  And the means to achieve them
(code technologies) are also slightly higher.  
                                        
 The following is quite interesting and con-
a constructive letter was sent by Dmitry Te-
Rentyev (DEMON/DPC):  DT: "...I, like everyone else, am concerned about the fate of
ba of all of us beloved Speccy, so I
I am writing to you.  It has long become clear to everyone
that you can’t go far on one tr-dos,
progress is moving forward, but we are standing still
those (we are spektrumists), more precisely, on
There is no progress on the operating systems front.
This is the question that bothers me the most
excites.  Slowly but surely growing
hardware capabilities of our Speccy.
Memory meter and more, kmos clock, sound
cards (General and DMA USC), hardware
ny multicolor and much more.  Yes
only tr-dos with flop guides for 5 and 3.5
inches, the limit of which is 800 kilos, that is
less than 1 megabyte, which you will agree,
not good..."                      
                                        
   DWT: Here Dmitry touched on some very in-
interesting and very controversial topic. Problem
"growth of hardware without growth of software technology"
nology" in my opinion is one of
the most acute.  And this applies not only
Spectrum. Or rather, even less Spectrum
neck degree. After all, he was able to demonstrate
there are very, very many things that just don’t
developing technically. Having in
original screen in your arsenal
256x192, speed 3.SmHz and memory
in 128kb our programmers were able to squeeze
from Spectrumit would seem simply not-
probable things.  As for others
platforms (PC for example), then “they” have growth
"hardware technologies" has always been ahead
growth of programming technologies (hereinafter
TP).  I'm afraid to make a mistake, but in my opinion these
most TPs experience a “reverse process”,
that is, simply put, they degrade. "Ikhnim"
it is easier for manufacturers (and probably de-
more efficiently) increase the clock frequency and pa-
crush rather than lick the program code.
That is, if the “ceiling” “they” had on
over the course of, say, 7-8 years it would be
Pentium-100 with 8 megabytes of RAM and increased
It would be very difficult to calculate these indicators.
difficult and unpromising, then TP is significant
but they would have grown by several years. After all
“You can’t go higher than the roof,” but that’s why
I'd just have to look for some way
optimizations.  As for the Spectrum, then
with us everything is exactly the opposite - in
in terms of TP development, if not one hundred percent,
then certainly more than fifty
cent.  Therefore, it's time to increase
iron.  But the internal organization of Spec-
truma, its schematic solution, and so-
the same features in which he appeared on
the territories of the modern CIS do not allow
seriously and, most importantly, bug-free
increase its technical characteristics.
But nevertheless, memory, sound and some
other characteristics were more successful
or less successfully increase.  However,
the problem has become urgentstandardization.
Spectrum OS did not provide long-range
our "hardware upgrade" and especially in this
such “special” conditions as ours -
only extended memory standards with
ten!  Of which at least one
(Pentagon-1024) impossible to detect,
unless you know what this megabyte is
you have (due to "latch 48"). Conclusion?
A new OS is needed and it has been needed for years
six ago!..                          
                                        
 DT: "...Conclusion: we need a new operating system
great system! And the OS that will be serviced
act like disk drives (FDD, HDD,
CD-ROM) and computer memory, the task
programmers will immediately be simplified, they will not
I'll have to puzzle over what
memory expansion ports on one or another
computer and how to determine how many kilos there are
byte, the OS will provide this information to him
(of course, if you have a driver)..."      
                                        
   DWT: It seems to me that information about
computer must be formulated
(configured) by the user himself
during initial OS initialization (allowed
We hope that this information and drivers will be
flashed either in the OS itself or in the ROM dis-
ke).  It’s just that the programs that are launched don’t have
any questions will arise regarding
about "hardware", and therefore - samples
the standardization lema will beexhausted.    
                                        
 DT: "...The disco problem will be solved immediately
howl of memory, the 1G screw is not worth it now
more than 300 rub.  CD-ROM - listen to music,
and on discs an archive of Spectrum pro-
store grams in TRD images. Some
they will say CD is superfluous, but CD x2, x4,
x8 are also inexpensive, and the interface is all 
is the same - IDE. Now about the file
system.  The file system must be
FAT32 (on a screw, on FAT12 floppy disks), and
tr-dos system should also support
to bother (well, where without it), but for the user
caller it should be transparent, then
there is, he may not know about it, but everything 
should work..."                     
                                        
   DWT: Regarding FAT32 and FAT12. On my
Look, there's no point in using these
structures for Spectrum. He needs
slightly different, calculated if
you can say so in Spectrum "me-
mentality" system. Naturally "upgrade-
putting TR-DOS" is a hopeless matter, but
develop something more suitable
it is quite possible for him in spirit. After all, chi-
learn and “understand” MS-DOS on the Spectrum
it’s still “slow” - there’s a lot of that,
that Spectrum simply does not need. However,
FAT12 should not be simplified - it will
just a mutation. DT: "...On CD-ROMax the file system
not FAT, but some other (according to rumors),
but I'm not sure if someone has something
knows, then please throw it on the soap
(demon_zx@fromru.com).                  
                                        
 However, all these ideas are not mine - they are
the concept of NeOS, maybe someone has heard of it, but...
It seems this project has stalled.                
                                      
 ATTENTION!!!  If this text is read
the authors of this system - please respond -
get in touch or at least send the source codes,
if you do not want this project to continue
reap                                   
                                      
 The moral of this story is this: we need a new one
operating system to Spectrum
lived, and participation in its creation must be
take it from all spektrumists, not in code - yes
idea.   I suggest entering in ZX-Time
separate section for discussing this
question in which it will be honed
OS concept.                           
                                      
 You can also send ideas to my
address: demon_zx@fromru.som.  Yes and no
only ideas on this issue can be expressed
write like that, at least I’ll know that it’s not
I'm the only one left on the Spectrum.     
                                        
 And in Kursk it seems that everyone except me is for-
beat on Spectrum :..-(, if this is not so,
address above."                           
                                        
   DWT: Thanks for the nice letter.      
                                        
 Well, that's probably all for today.
We are looking forward to your letters!                       
                                        
 - - - 

Share your thoughts about the article