Thanks a LOT if you can take some time to read this LONG post.And you may need to refer to my previous post titled "My OS Design(To Be Continued)".
Brendan wrote:
So first of all,thank you for providing that post for me.I proberbly missed it.My idea just came in the same way as Candy's,but still different and has something more beyond it.For example,my algorithm seems to be more optimized(please take some time to read it again).What is more will be deSCribed below.Hi,
Hmm - so far it sounds very similar to a post made about 2 weeks ago by Candy...
I guess the next question is, why not implement it as a library to save yourself the trouble of writing an OS?
But both Brendan and carbonBased think that my idea just sounds like something that is closely related to a language or a libary or something rather than an OS core.
Here I'm telling you something more specific on this idea in my OS core.(Do refer to my first post to look up some defined concepts.)url
Overview
My OS is a multitasking and macrokernel one with all programs/procedures existing in either of the 2 type:the System Console(SC) &its related tasks and the Idx(Index).
the SC & the Idx
The SC and the Idx plays a similar role as the thread does in other OSes--They're both the form in which a program/procedure exist during runtime.But in my OS,the Idx is only for user-level program/procedure while the SC is for the OS core(and there's only one SC exists while thousands of Idx are allowed to exist at the same time).Generally speaking,the SC is just like a runtime environment for the Idxes(just like the JRE,but there's a multitasking mechanism between the SC and the Idxes and the Idxes are completely compiled),thus it's just the relation between the DCD and the variables.The SC tries to keep all the Idxes in it live(newest).
the 2 Types of Idxes
2 types of Idxes are defined in my OS core:the Calculation Idx(Idx[Calc.]) and the Input/Output Idx(Idx[I/O]).One type of Idx can ONLY do what its type of Idx can do.(In other words,its type can never be changed during runtime.)
the Idx[Calc.]
This type of Idx mainly consists of these sections below(it's legal if an Idx[Calc.] doesn't have a serial code or a temp data section):
-An external value
-A temp data section(for its internal use)
-A serial code(used to calculate its value as an expression does)
This type of Idx is just the implementation of the variable(both the SV and the DV) mentioned in my first post.The serial code is right its "expression" while the external value is just its "value".The serial code may want to involve some other Idx[Calc.]'s value for its calculation.This can be done by calling a specific system interrupt(the only interrupt this type of Idx can call),and the interrupt will let the requested Idx[Calc.] update its value(if necessary,for some occasions it dosen't need updating) and return what the calling Idx[Calc.] requests in its temp data section.If this Idx[Calc.] has finished its calculation,it's ready to update the external value,etc.Similar things will keep happening in the entire period of a set of Idxes'(both types) execution.(A set of Idxes is known as a Idx Unit,see its definition below.)
the Idx[I/O]
According to its name,you may guess it's usage--it's used to exchange data between the Idxes' values in the RAM and I/O devices.Because of the limitation of my OS drivers,it can only communicate with these three types of I/O devices:the keyboard,the video system and the virtual storage(when it's for the I/O use,it can ONLY be an INPUT device,this will be explained later).Every Idx[I/O] can ONLY be one of the 3 types.
For the output-only Idx[I/O],it can ONLY call the system interrupts related to the video system to display what it would like on the SCreen.It has:
-A temp data section(for internal use)
-A serial code(to organise what to output)
For the input-only Idx[I/O],it can only operate the keyboard and the virtual storage for input.
To input BINARY data from the keyboard or the virtual storage using a system interrupt,the following will be done by the calling Idx[I/O]:
1.Decide what to input(if you want to know more about this,please contact me).
2.Decide where to put the input BINARY data.This can be done by providing an unallocated Idx[Calc.] name,and the input BINARY will be the external value of the referred Idx[Calc.],and this Idx[Calc.] has neither a temp data section nor a serial code.In this way other Idxes can access the input data in a uniform way.
Things come similarly if an input-only Idx[I/O] wants to put NEW Idxes into the SC during runtime,directly from the virtual storage.If the related system call is called and executed,ALL the sections of the Idx with referred unallocated name will be filled with ALL the sections of the Idx which is input,a little like to input BINARY data.Then the filled Idx will work normally as other existing Idxes do.
What is the Idx Unit(IU)
The IU is a set of Idxes needed in a certain computation task.It will be read into the SC from the virtual storage(file system) when a computation task is launched.Every Idx in the IU can save its all sections which is in its last-updated state.
NOTE:My current OS is only expected to be a runtime environment for the Idxes,so it isn't able to modify(e.g.,creating new Idx,deleting Idx,etc.) the existing Idxes.
the Idxes' Writing-Back
In fact,according to the concepts introduced above,every Idx can only write ITSELF and can only READ others.When a task is terminated or an Idx is no longer used,the Idx can call a system interrupt to save its sections before being terminate itself.
Why name it Idx
This is mainly for how an Idx is named.Their names are just like the Internet's domain name and is just a REFERENCE to a certain Idx[Calc.].For instance,we have an Idx[Calc.] named "singers",then we can create another one named "singers.the_beatles" referring to the subject of a certain Idx[Calc.] having something to do with the Beatles or "singers.john_denver" related to something else.Still we can have a 3rd one named "singers.the_beatles.hey_jude" pointing to an Idx[Calc.] related to the song Hey Jude.
However,it's not only a TREE,because we can have another Idx[Calc.] named "hey_jude.author" to refer to the one about the Beatles.In this way ONE Idx[Calc.] can be referred in more than one name,according to the RELATIONSHIP of the application.
This naming method can avoid the naming space conflict somehow and easy to understand.However,it's beyond only a protocol.It is part of the syntax to request values for mass data accessing.For example,"purchases.(?.purpose==gift).price" will return the prices of the purchases which are bought as a gift,so you don't need to pass an absolute name as a parameter.
How do you think this kind of core architecture?
Can you comment on this and give some advice?