8BIT OPERATING SYSTEM FOR ZX-SPECTRUM
Object File Creator and Doors \AQUA Kernel Builder
Having experience of a writing kernalej under predydushchii versions Doors, sooner or later you face a problem when you wish to change or add any site of a code. It can be a mistake or improvement of already existing procedures is simple. While the volume of source codes is not great - all simply, is remarkable:) But costs to it vyrosti till such sizes what to not be located in 1 bank of the editor, at once skrost compilations falls in some times: (and to wait because of changed bajta a heap of time somehow it is not so pleasant even if to compile in a TURBO-mode. But it is a floor of a trouble, at increase in a code, it is much more difficult to catch mistakes in the certain module: (Owing to simply huge variety of clones spekruma, and as otsutvija standardizations of iron (ports, etc. nuances), it pulled aside universality of a kernel: (All is good! But for long-term experience of programming (c 1987) I have come to conclusion, that the more universally you staraeshsja to make prorammu, the more it and the more difficultly in it to find all in volume mistakes which grow directly proportionally to the size of universality: (What to do? pochitav clever books, I have come to conclusion, that clever djadki for a long time have ceased zanimatsja nonsense (microsoft not vschet) and peresobirajut kernal for everyone konkrktno the taken machine. First it reduces it (kernalja) volume, due to emission of not used modules (not at nevertheless identical iron), and secondly the kernel gathers at chetom features of each machine that gives result - stable work of system as a whole. But here rises again small problemka: (in the same UNIX'a the kernel is written on C and perekompiliruetsja very long time: (Having scratched "turnip":) I have decided to simplify a little assembly of a kernel and to collect it not from sortsov, and from in advance otkompilirovannyh modules. First it reduces time of assembly of the kernel, and secondly if something is necessary for changing in any module perekompilirovat will be necessary only it.
Now that concerning to programs. Proceeding from experience razraboki kernalej, it has been decided to not depart from the standard system of a call of procedures. First there is a tablet of jumps (JP addr) with addresses on procedures, and then procedures. Kernal it is compiled under *C000 address, for the further opportunity of its accommodation in "bank". It is a little having modified idea, finally compilation of a kernel, we have approximately such here a picture:
| The description |
| A call of procedure of initialization kernalja, it and zaglushka for a casual call. |
| The version kernaja in ASCII a format |
sabversija kernalja in ASCII a format (0-release, 1-beta, 2-alpha)
A call of procedure 2...
A call of procedure NN...
Probably certainly it is not perfect heading for kernalja:) but while its structure is those, and if it it is required (at a stage of testing of system) that quite probably it and to change.
As the collector kernalja does not know memories (address) in what area this or that module will get (depends on dynamically varying size at compilation) it was necessary to make somehow these modules relotsiruemymi, differently independent of area of memory where they will get. For creation of such modules program OBJECT FILE CREATOR also has been written. For that what to create the final module (*.OBJ) it would be necessary to compile your procedure under different addresses, in the first case it should raspologatsja from *C101 address, in the second case from *C000 address. Restriction on the size of one module of 32 sectors or 4 KB! If all is true also mistakes is not present, having analysed a code and having made sootvetsvubshchie tables (thanks for it Shaitan \SOK \Inferno), the program will suggest to fill to you some information (Project name, Author name, version, build status: release / beta / alpha, date of creation). This information is necessary for prevention of mess with versions of modules and opportunities of contact to the person who has written this module. After end of all manipulations on a disk the file with expansion *.OBJ Is kept
So we have on a disk a quantity of files with expansion *.obj. For that what to collect them in uniform kernal, it would be necessary that they are registered in kofiguratsionnom a file builder.cfg. Here an example of a file:
; Generated by breeze/fishbone crew
; with help AC Editor
; 17.10.2003 - start
; 25.11.2003 - cont
; 09.05.2004-final (?)
; use; for comment string!
; wywod teksta na ekran bez nadpish ' scroll? ' (0-bez, 1-wywod)
This line ukazyvet on, whether will be a delay (expectation of pressing of a key) at a conclusion of the text to the screen
; wywodit na ekran nadpis ' warning! beta componet adding... '
This line ukazyvet on, whether will be the prevention that in kernal dobovljaetsja aaoa-components Is deduced
; koll-vo zarezerirovannyh tochek vhoda dlya jp addr (255 max)
Without this line the kernel even will not gather, as it specifies how many to reserve places under the table of jumps (JP XXXX)
; versiya kernala (for example)
; ver 1.00
These figures are registered in a kernel of system specifying on the version kernalja
; publish version (0-release, 1-beta, 2-alpha)
These figures are registered in a kernel of system specifying on sabversiju kernalja
; spisok failov dlya kompilacii
Further the list of connected modules of a kernel Follows
obj Starz!! .obj
obj Starz!! .obj
obj Starz!! .obj
; konec lista
; zarezervirovannaya metka! ne stirat '!
On it the configuration file comes to an end.
After successful compilation, on a disk the file with expansion *.SYS will be written down is and there will be a kernel of system. Now it can be loaded into any bank of memory, since *C000 address and to cause sootvetsvubshchie procedures.
On it perhaps also we shall finish, if there will be any questions or wishes, write - feedback - it is always open:)