View Poll Results: Will you be a community developer?

Voters
88. You may not vote on this poll
  • I will

    36 40.91%
  • I understand how to but won't

    14 15.91%
  • I don't understand how to and won't

    26 29.55%
  • I don't want to and won't

    12 13.64%
+ Reply to Thread
Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 49

Thread: Revan's OS

  1. #21
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    Due to this: Wirelink - Multisend

    I'm probably going to rewrite from the ground up the CPU. It will actually become *more* modular and easier to use, if I'm right in my assumptions, no user will actually need to know how the CPU works anymore . The global variables will be able to pass data along directly and efficiently throughout the computer. This also makes threading easier because I can have every single library looking for a function at the same time as opposed to waiting for replies from each of them.

  2. #22
    Wirererer hzzzln's Avatar
    Join Date
    Dec 2008
    Location
    :noitacoL
    Posts
    151

    Default Re: Revan's OS

    uhm, im not in common with global variables but there will be problems when you want to use 2 seperate OSes, right? you could use a global table and check if there are more than one OSes... well like i said im not that experienced with global variables but i just wanted you to keep the idea of more than one OS in mind while you are rewriting.
    DO YOU HEAR THE VOICES TOO?

  3. #23
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: Revan's OS

    Quote Originally Posted by hzzzln View Post
    uhm, im not in common with global variables but there will be problems when you want to use 2 seperate OSes, right? you could use a global table and check if there are more than one OSes... well like i said im not that experienced with global variables but i just wanted you to keep the idea of more than one OS in mind while you are rewriting.
    As long as each "instance" of the OS generates its own identifier for global vars there is no problem. But then it also has to do that and propagate it to the other modules.

  4. #24
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    No problems with wrong identities. Each computer finds it's own, here's the CPU, and actually, I think it may be done... hahahahhaha, that's short .

    Now to redo the rest of it

    Code:
    OLD REVISION - RELEASED VERSION AVAILABLE FOR DOWNLOAD
    By the way, I *did* document it better this time.


    EDIT: Input:

    This is maybe a tad bigger than before, but I definitely fixed some of the major flaws in it, and once again, it's been better commented.

    Code:
    OLD REVISION - RELEASED VERSION AVAILABLE FOR DOWNLOAD
    Last edited by turck3; 01-22-2009 at 04:58 PM.

  5. #25
    Master of Mars Magos Mechanicus's Avatar
    Join Date
    May 2008
    Posts
    852

    Default Re: Revan's OS

    Remember gSetGroup() doesn't persist; you have to use it every execution in order for it to stick. Not what I would have expected either.
    Last edited by Magos Mechanicus; 01-20-2009 at 03:11 PM.
    I can wire anything directly into anything! I'm the Professor!
    -Professor Hubert Farnsworth

  6. #26
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    Remember gSetGroup() doesn't persist; you have to use it every execution in order for it to stick.
    Ah, didn't know that, thanks for the heads up, that would've really pissed me off

    By the way, new key design features:

    All libraries must implement command -endproc
    1. No library will reply for it, that means it will run for all of them and time out.
    2. It will make certain that *any* running commands are ended as fast as possible. This will end all of those crappy debugging errors I was getting where the mode of the CPU prevented it from getting more input and yet the command that was supposed to run wasn't working...

    Memory
    The OS now supports shared memory.... kind of. Because of global variables, you can name a number by a table, thus if you want to index '1', you might call it "LibNameHereTable1" and share it over the computer. Keep in mind though, name it something obscure, something that another library won't use (unless it explicitly wants to)


    EDIT: The base library (lib)

    Read comments for changes - Once again, a lot more documented than the old version

    Biggest change: No more replies at all. No command execute anything, so none of them *do* anything. This means that they just ignore any input and the CPU will then timeout if another library doesn't find the command it's looking for.

    Code:
    OLD REVISION - RELEASED VERSION AVAILABLE FOR DOWNLOAD



    EDIT

    Mk. I have finished editing the code to work with global variables and I am sitting here in awe, noticing how many inputs and outputs have disappeared off the face of the face of the earth! I have yet to rewrite pong for it, but first things first, right? Basics need to work before I start adding networks and pong. Anyway, I'm off to test it, and then as soon as it's working I need to study for midterms (maybe before it's working)... so there's no guarantee that the updated code will be posted on the main page. If the code is ready, I will make an additional post notifying everyone.

    EDIT

    After some testing I worked out most of the bugs. -print and -cprint work, -endproc works better than ever. I forgot to reimplement cls, but with the new system it'll be a breeze! The major errors are with the screens. The input one doesn't refresh fast enough for users who type fast, and the output screen, while it outputs the data correctly, it doesn't save old data like it used to... both are probably easy fixes. I'll have the new version by the end of tonight, but now... I study science.
    Last edited by turck3; 01-22-2009 at 04:57 PM.

  7. #27
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    Updated code is working fine and has been posted. All old functions are implemented better than before. Developing a module is now 10x easier, no more alterations on the CPU, and the possibilities for direct control over input and output! Have fun!

    Edit: Another Update

    I have modified the CPU to utilize something that I had intended to release last night but wasn't functioning properly. I believe that I have found and corrected the error. The new feature: Previously (if you have tried b11 yet), when you make new computers, the number always increments. If you remove a computer, the other's do not know, and thus the group name claims it's taken, when in fact, it is not. The new system uses pinging between the computers to ensure that the name is *still* taken when the new one is made. If the other computer doesn't respond, it assumes it no longer exists and takes it's name.

    Code:
    OLD REVISION - RELEASED VERSION AVAILABLE FOR DOWNLOAD
    This code has not been checked for bugs, while I don't believe that there are any, if this doesn't work, it *will* mess up the rest of the system. While I don't advise *not* to use this, I suggest that users wait another hour so that I can get back to my normal computer and test this code. It will be released in a new revision as soon as it is working.


    Edit

    Pong is finished, testing now, along with the updated CPU.
    Last edited by turck3; 01-22-2009 at 04:57 PM.

  8. #28
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    Pong is now complete, documentation is available on the first page, the source is also commented well. Black Phoenix, I'm ready to add it to that site now, if you still desire... just tell me how.

  9. #29
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    Oh my.... this was difficult to write... anyway, here's my prototype router:

    Code:
    @name Router
    @inputs Group:string
    @outputs
    @persists Count OpenPort
    
    
    #It's important to recognise that any variable name passed to the router will result in the string *and* numerical data being passed, with the exception of the string being "" or the number being 0
    #It's also important to remember that the data on the network cannot be cleared because we must assume that more than 2 computers are on the network and thus 2 or more can access the same data. That means we don't clear data, so do everyone a favor, don't clutter.
    #It's important to recognise that you cannot send data out to a specific computer - if a module needs to send data only to a set of computers, let it create it's own network, and save the one we were last on, let it do what it has to on it's own network, and restore itself to the old one when done.
    #Not all data will always pass through, if you have enough programs trying to use the same network and enough computers reading from it, it can clog the router by writing to ports that should be open but arn't, that means that it's not unwise to send data *back* to indicate that you *did* receive the values you wanted. Just like a real router, not every packet will make it through, most will, some may not. If you know that you're using lots of computers on the network, set the NetSpeed lower (faster) to help fix this issue.
    #Data that does pass through will always be registered. That means that even data you send *to* the network will come back to you. For this reason, I advise against sending global variables you intend to keep because the data will bounce back into the port, even if you updated it.
    
    #NetOut variables - There are 25 NetOut variables, they reset themselves automatically, but they allow you to tell the network what data you're sending out by the (global) variable's name. When you set the data to send, you also set the NetOut to send it on. You shouldn't need to send 25 pieces of data at once, but if you do, adjust the clock with NetSpeed
    
    if(Group != "") #Has the computer assigned itself a group
    {
        gSetGroup(Group)
        Network = gGetStr("Network") #The network name is set by other computer modules
        NetSpeed = gGetNum("NetSpeed") #Allows modules to set the update rate for internet data, some need more than others
        if(NetSpeed == 0) { NetSpeed = 100, gSetNum("NetSpeed", 100) } #Default value is high to account for the 25 ports, it can be sped up for faster data transfer
        interval((Network != "" ? NetSpeed : 200)) #Run at the normal pace of 200 miliseconds to reduce lag until a speed has been set from within the computer or the network group has been named
        
    
        if(Network != "")
        {
            Count++
            if(Count > 25) { Count = 0 } #Never reads in as 0 because of the above line
    
            #For setting data to the network, we need to tell the network what NetOut to put it on for computers reading from the network. We cannot assign it at random, and it doesn't really matter which port it goes on, but we do need to ensure that it is free.
            #NetOut allocation managed here
            gSetGroup(Network) #Set ourselves to modify the network
    
            NetOutStr = "NetOut", FindOpen = NetOutStr + toChar(Count) #Build a port number
            if(gGetStr(NetOutStr + toChar(OpenPort)) != "" | OpenPort == 0) #If the port we think is open isn't or we don't have one that we think is open, try and find out that is...open
            {
                if(gGetStr(NetOutStr + toChar(Count)) != "") { OpenPort = Count } #If the port of our count variable is open, take it, else, wait for the next time around.
                else { OpenPort = 0 } #Ensure that the value *is* actually 0 so we don't write to it later
            }
    
            #There is no built in clearing of the NetOut ports that are *on the network* because multiple computers can receive the data. Instead there is a NetClrPort global variable to clear ports on the network. If you're sending from one computer to only one other, this can clear it easily, if you're sending to more than one computer, add a variable to keep track of how many computers receive and *use* the data, when the count is high enough, clear it.
            #NetClrPort - port clears handled here
            gSetGroup(Group) #Set to the computer to get the next value
            ClrPort = gGetNum("NetClrPort")
            if(ClrPort != 0)
            {
                gSetNum("NetClrPort", 0) #Ensure that the port is reset for the next value
                gSetGroup(Network) #Set ourselves to modify the network
                ClrPortName = "NetOut", ClrPortName += toChar(ClrPort)
                gSetStr(ClrPortName, "")
            }
    
            #Passing data handled below
            gSetGroup(Network) #Set ourselves to access the network
    
            Test = "NetOut", Test += toChar(Count) #The index to check, NetOut is a global array numbered 1-25 which holds the name of the variable to send, if you need to send more than 25 pieces of data, you're doing something wrong.
            DataName = gGetStr(Test)
            if(DataName != "") #Found incoming data in this index
            {
                StrData = gGetStr(DataName)  #Get the string data at the name given to us
                NumData = gGetNum(DataName) #Get the numerical data associated with the name given
    
                gSetGroup(Group) #Set ourselves to modify the computer's memory
    
                if(StrData != "") #We assume that whatever module gets the data sets it to "" when done with it, thus if it's trying to pass "", it's not necessary to actually pass it
                {
                    gSetStr(DataName, StrData) #Sets the variable with the same name and same data as the on the Network
                }
                if(NumData != 0) #We assume that whatever module gets the data sets it to 0 when done with it, thus if it's trying to pass 0, it's not necessary to actually pass it
                {
                    gSetNum(DataName, NumData) #Sets the variable with the same name and same data as the on the Network
                }
            }
    
            #Clear all data that we just modified on the router
            StrData = ""
            NumData = ""
            Test = ""
            DataName = ""
            #Now we perform the same operations, but this time setting data to the network instead
    
            gSetGroup(Group) #Set ourselves to access the computer
    
            Test = "NetOut", Test += toChar(Count) #The index to check, NetOut is a global array numbered 1-25 which holds the name of the variable to send, if you need to send more than 25 pieces of data, you're doing something wrong.
            DataName = gGetStr(Test)
            if(DataName != "" & !OpenPort != 0) #Found incoming data in this index and the Network's ports arn't clogged
            {
                gSetStr(Test, "") #So that it doesn't read in next loop unless set again - remember this is on the sending computer, so it doesn't make a difference if we clear it, it's not like receiving where all routers hooked up need to get the data.
    
                StrData = gGetStr(DataName)  #Get the string data at the name given to us
                NumData = gGetNum(DataName) #Get the numerical data associated with the name given
    
                gSetGroup(Network) #Set ourselves to modify the network's memory
                gSetNum("NetOut" + toChar(OpenPort), 1) #Say  that the port is written to
    
                if(StrData != "") #We assume that whatever module gets the data sets it to "" when done with it, thus if it's trying to pass "", it's not necessary to actually pass it
                {
                    gSetStr(DataName, StrData) #Sets the variable with the same name and same data as the on the Network
                }
                if(NumData != 0) #We assume that whatever module gets the data sets it to 0 when done with it, thus if it's trying to pass 0, it's not necessary to actually pass it
                {
                    gSetNum(Test, NumData) #Sets the variable with the same name and same data as the on the Network
                }
            }
        }
    }
    It's completely hectic! In short, you need to:
    1. Set the network name
    2. Set a global variable you will not use as an input on the sending computer (because the router will overwrite it when it bounces the data back)
    3. Set one of the 25 NetOut(1-25) global variables to hold the name of the variable you're sending.
    4. Have a receiving module on the other end
    5. Check the variable with the name you set
    6. Clear the port it was sent on in the network

    and that's if you're only dealing with 2 computers! If you use more, you need to send more data *out* from the receiving computers, for two parts, one, to ensure that the data arrived and confirm it by sending data back, and two, to count the number of computers that received the data so that it knows when to clear. That also means you need to know the initial number of computers expecting data and if any of them change networks... yeah, that's gonna be fun.

    Edit:
    Thinking about it, I've come to the conclusion that this is really really complicated, and that while it makes sending data better for larger programs, it actually hinders smaller ones. Thus I will be making another router with another type of internet protocol for sending simple data. The difference will be that you can only send one piece of data per execution, instead of having 25 ports to send and receive on at any time. This will however, involve an entire new way of sending and receiving data that makes it easy to interface and easier to write. The method above will remain valid, but it also remains difficult to use. So you have your ups and downs, the above has 25 ports to send on, the new one has one, the above has packet loss, this will have none, the above is hard to interface, the new one will be easy to interface.... it will be up to you, which to install.

    I'd recommend installing both internet protocols so that modules can decide which to use, some modules may use both.

    Edit to the edit:

    I'm adding a 3rd protocol too. This one will work on the basis of adding a variable to a list of variables to send. Any variable on the list will always be sent when modified, drawbacks, if you modify a lot of data all at once and try and send it, the time to send it all will vary according to the number of values. This should be relatively unnoticeable, but it will be present. I won't write this protocol until I know that the second is working.

    Plans for testing these all:
    I will probably be working with the 2nd protocol first, only because it's easier to manage and write, when I finish with it, I'll work on the third, and lastly, I'll test the first. The first will be the hardest to test because of it's nature.

    Protocol #2
    Code:
    OLD REVISION - RELEASED VERSION AVAILABLE FOR DOWNLOAD
    As promised, with all of the aforementioned flaws and benefits. It provides an easy way to send data by using the "NetSend" global string and to get data using "NetRecv". One of the not mentioned downsides to this is that if you're trying to get data from the network, you must call for it, the previous system always updated data on every system when it was sent; leaving it up to the module to decide what it wanted to act upon.

    As aforementioned, feel free to choose which system you want to use, or even both, but some libraries may not work without a certain protocol being active.


    More ideas that I've had but will probably now turn into their own networking modules
    1. Peer to peer networking - Better for things like pong, that way you can quickly send data from one computer to another, without dealing with the network in between them
    2. FTP - If and when I add actual files to the OS, there will be an FTP protocol designed specifically to handle their transfer
    3. HTTP - There will definitely be websites, I was going to make HTTP it's own module that used normal networking, but then the possibilities of disrupting data transfer emerged; thus I will make their own protocol that is completely self contained. They will run out of the group "Internet" and there will be two forms of HTTP modules. One for reading pages, this will only allow users to get the page data they request, nothing more, and one for writing pages, this will be a completely different module that is independent of any specific computer, while it can be on the same plate, it will not actually connect with the computer.
    Last edited by turck3; 01-22-2009 at 04:57 PM.

  10. #30
    Success: An illusion turck3's Avatar
    Join Date
    Jun 2007
    Location
    USA
    Posts
    1,744
    Blog Entries
    4

    Default Re: Revan's OS

    Networking implemented. Read the front page for details on the commands:
    -connect
    -ping
    -evil

    Modules can now be written to work with the networking, see the Network Adapter for an example. Once again, it is fully commented.

+ Reply to Thread
Page 3 of 5 FirstFirst 12345 LastLast

LinkBacks (?)

  1. 02-08-2010, 07:23 PM

Similar Threads

  1. Revan's Wiremod Tutorials - Now Featuring E2 Guides!
    By turck3 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 470
    Last Post: 12-30-2010, 06:01 PM
  2. Replies: 13
    Last Post: 06-23-2008, 12:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots