MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 430 forks source link

Connect all Servers to a RAID but only one to a Terminal Server #2493

Closed Leurak closed 7 years ago

Leurak commented 7 years ago

My idea is to connect up multiple servers to the same RAID, while still allowing only one of them to connect with a remote console. The current problem with this is, that both run at the same connection. Because multiple servers can't connect to a single remote console and the OS runs from the RAID, I can't simply solve this problem without having a way to have multiple dedicated connections for the RAID and the Terminal Server.

My first idea would be to implement something like a Component Card, which allows a seperate connection in a Rack to solve this problem. Just like multiple network cards allow multiple wirings. Or just give each Component Bus a seperate connection. Another (simpler) solution would be simply having a Terminal Server Card, which allows the server itself to function as a Terminal Server.

purplemonday commented 7 years ago

ive toyed with this be4 and we need no cards or crap. just some love to the openos. or do it yourself. main function your looking for is component.gpu.bind

be4 i go explain how you can work around this i like to add.

there other ways to aproce this. like network file transfers, network relays do stop components connecting prolly lowering the costs of component buses etc. nother methode would be use of coroutines so you could multitask it all in one computer.

the way you had it in mind you prolly endup rewriting openos. when a computer boots it will connect to the first device it found. they call it the primary.. its random everytime if you had multiple monitors when you power on a second it will start writing to the same set etc adisionaly both computers will use the same keyboard, i expect thats what your going about. you can afcourse force it to a default key and have multiple terminals however you can chance this behaviour doing some editing in the os. the file you prolly wanna look at is /lib/tools/boot.lua at about line 25 of this file: screen = address say you made this screen = nil then this computer wouldn't attempt to connect to a terminal at all. it would asume there is no monitor youll still have to deal with that manny --not-actualy shared-- devices both computers need to run, but from that point you could call a gpu.bind to hookup to the terminal.

however how you give commands to a computer that hasnt have anny gui, doing this create a chicken and the egg problem. you could make a modem even listen todo exsactly that.. call a gpu bind .. listen events stay running after you executed them, they execute a callback function opencomputers also refers it as running-in driver mode. say something like this, kept it realy simple and there might be typo's

modem.open(999) event.listen("modemmessage", function(,,port,,message) if port == 999 then component.cpu.bind(message) end)

home/> lua

function () modem.send ("targetcomputerkey",999,component.gpu.address) component.bind(nil,true0)) poef blackscreen but when you start typing it should be all fine. the realization i got after doing it this way.. that much code on that manny machiens isnt effecient. coroutines solved alot to achieve some sort of multitasking i whas looking for in the first place. sharing infomation in globals i didnt needit to network i have to add coroutines isnt true multitasking, and all the api's like threading pipes etc are totaly diffrent then documented.. its not easy to grasp how you supose to run an entire base on opencomputers. with that said. popen seems to work in executing multiple scripts at once and event.timer also allows for some tricks that keep running while your in the prompt.

have a read here: http://ocdoc.cil.li/component:gpu?s[]=gpu

payonel commented 7 years ago

This is out of the scope of what openos plans to do. There is good value in these types of terminal services that manage resources for multiple users, but we don't plan to add more to openos for this feature, and this can be done in user applications building management layers for these resources.