Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Forum Connectivity Upgrade Read more... ×


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by payonel

  1. payonel

    More authority over the 'harware'. (OC Developer Request)

    btw, I made a typo (which I'll correct inline), I meant to say that (in regards to memory swapping) we cannot serialize all data types. So for a kernel to really swap memory, it would only be able to swap specific segments of data ... and could not force arbitrary user code to fully swap. It is sadly outside what Lua can do. We kill the the current coroutine that is long running. So you can catch it yourself, in your kernel, without the kernel crashing. This isn't a detail of machine.lua, but rather, how lua hooks work. And yes, I empathize with the challenge of that switch. Strangely I found have found that I enjoy the two contrasting worlds (lua <--> c++).
  2. payonel

    More authority over the 'harware'. (OC Developer Request)

    I appreciate the interest and enthusiasm. I disagree with a few of the points you've made if you would allow me to explain. "almost" as in it isn't. Killing a thread pre-emptively is the only thing you can do in this case and that is not multithread nor cooperative. You can't resume coroutines from the same Lua state either. It isn't lightening fast, debug hooks are actually extremely costly. Also, we cannot persist debug hooks, thus when a machine is unloaded and reloaded in chunks, any state and special hook magic you might make would be lost. We collect garbage when you've yielded 10 times. Also, lua state will collect garbage dynamically You can already do that, see pcall. Or, run untrusted code in a sandboxed coroutine. The coroutine will die if they OOM. We looked into this, unfortunately you cannot arbitrarily serialize all value types in lua. Kernel Security: There is nothing MORE secure about unboxing any part of the sandbox. In fact, you could just run the machine.lua code, again, inside minecraft, and run an OS inside that sandbox. Sandbox inception! You wouldn't have debug hook, but hooks do not increase security, we only use them for stopping long running processes. And you don't need to do that, we do it for you. We are not in favor of making it this easy for uninformed server owners to expose their private server environments to users. Users have brought this up before and we (developers) are in strong agreement about this. Hopefully you're still reading this far, and not just mad at me for shooting down your sincere request, inspired by your obvious passion. I wanted to encourage you to ignore the constraints of the sandbox, and rather, look at what you really can do with developing a custom kernel. There is a lot more power than you might give credit to the system as it is. I whole heartedly agree that the virtual world in OC can be restricting, and at times extremely frustrating. I sympathize. Look at OpenOS. I have spent thousands of hours of my life developing OpenOS. WIthout a question, the single hardest part has been memory optimization and refinement. I'm a C++ developer (irl); I live in a world where I have complete and precise control over memory management (allocation, monitoring, profiling...). The way Lua allocates memory in chunks for its stack makes knowing the true cost of operations and new code actually very difficult to measure. I built an OC emulator primarily to provide a way for me to profile and measure memory usage. But none of this would have been "easier" outside the sandbox.
  3. payonel

    Can I use these in an init script?

    1. OpenOS doesn't add to nor remove from the debug library, what you see in OpenOS is available to all user space programs/custom operating systems 2. The debug library filtering/sandboxing occurs in the "hardware", before your eeprom code is executed, by our machine.lua (which builds the sandbox) 3. OpenOS has no kernel.lua and never has. OpenOS never calls debug.sethook anywhere. The machine.lua I mentioned (which again, runs OUTSIDE the sandbox, running unsandboxed, running lua code unavailable to OpenOS, unavailable to any user code), but this machine.lua used to be called kernel.lua -- renamed December 7th 2014. Yes, it uses debug.sethook, but users (and openos) are inside the sandbox.
  4. payonel

    Can I use these in an init script?

    for k in pairs(debug) do print(k) end traceback getupvalue getlocal getinfo getlocal, btw, is limited, it only returns the first result (the name of the field, not its value)
  5. payonel

    remote shell by payonel, psh

    I've developed a remote shell client and rc daemon called psh (payo-sh, like ssh but without the "secure" part) It's still a work in progress, but at this point should be quite usable for basic operations. You can find it via oppm, just `oppm install psh` On your hosts that should accept psh connections, run the rc daemon: `rc pshd start`. To have pshd running every boot, make sure to enable it: `rc pshd enable` From the client, run `psh -l` or `psh --list` to scan/search for available pshd hosts `psh -f` or `psh --first` to connect to the first host to respond, or `psh -f <address_prefix>` to connect to the first pshd host whose modem address string starts with the address_prefix you specify (this gives a quick short hand mechanism for connecting to remote hosts by just a prefix). No, I don't (yet) have hostname-like support `psh <full_remote_adddress>` saves you from any broadcast/scan calls, and connects directly to the specified host. At this time, psh only works stricly with standard io only, it does not intercept nor fake gpu calls.Most programs will assume you can read and write via the gpu, and psh tells the remote shell that a natural tty (and gpu) is available, thus fooling some programs (such as edit). psh also takes an optional additional argument to run as a command on the remote host (just like ssh does). So `psh -f "" ls` is a fast way to run ls on the remote machine without starting an interactive shell (and close the connection immediately) In the future I'll be adding `pcp` to the same `psh` oppm package, which will support cp calls (inspired by scp), but for now `psh ... "cat file" > file` works reasonably well. Note though at this time stderr is being communicated to psh as stdout, and thus trying to copy a file in this manner may produce a file with a shell error message (such as if a file doesn't exist). Again, in the future, pcp will be the reliable solution for copying files and folders.
  6. payonel

    request is not primary component

    I recommend you read our documentation on components https://ocdoc.cil.li/component:component_access
  7. payonel

    OC causing severe lag

    thanks for testing so much but did you try the flatworld and `/oc_sc` ?
  8. payonel

    OC causing severe lag

    sounds like a massively bad integration with some other mod. try creating a creative flat world, look at a block on the ground a space or two in front of you, and run `/oc_sc` to spawn a computer and start it up -- just to see if things work at all. you can troubleshoot from there
  9. payonel

    filesystem.read is returning 2048 character strings

    local fs = component.proxy(component.list("filesystem")()) local handle = fs.open("init.lua") local buffer = {} repeat local data = fs.read(handle, math.huge) table.insert(buffer, data) until not data fs.close(handle) local entire_contents_of_file = table.concat(buffer) stream handles naturally don't returns ALL of what you ask for, it can take multiple reads. read returns nil when the stream has ended (e.g. eof)
  10. payonel

    Help with wireless redstone

  11. payonel

    Help with wireless redstone

    `setWirelessFrequency` was a method for rednet wireless redstone, which integration was removed in and after 1.11. in 1.12 we only have redstone and bundled redstone also, updating is a great idea a whole lot was fixed, This is a patch release intended to fix a lot of issues
  12. payonel

    What to I need for a custom OS to run?

    @Molinkois correct that these things become complex quickly, but I think it is a LOT of fun things like term.write, print, and io.write call io.stdout:write. (by default) io.stdout is the tty stream, and io.stdout:write is https://github.com/MightyPirates/OpenComputers/blob/master-MC1.7.10/src/main/resources/assets/opencomputers/loot/openos/lib/tty.lua#L76
  13. payonel

    No Bootable Medium Found

    @SpaceBeeGaming thanks for helping a fellow user I also believe 2 of us already pointed that out and the user acknowledged the mistake already (i.e. read the whole comment thread)
  14. payonel

    No Bootable Medium Found

    that is a ComputerCraft disk drive, not the OpenComputers disk drive
  15. payonel

    No Bootable Medium Found

    I need to see how your disk drive is "connected" to this computer
  16. this is fixed in our dev builds for 1.12, btw
  17. payonel

    I'm a noob and i know it

    Here is basically everything you would ever want to know about startup scripts and such: https://ocdoc.cil.li/tutorial:autorun_options For your needs, I would write a script in my home dir that cleared the screen, set the resolution how I wanted it, and wrote the message, and then waited for user input or something to keep it from closing the program and returning to the shell: local term = require("term") local gpu = require("component").gpu term.clear() gpu.setResolution(20, 5) term.setCursor(5, 3) term.write("Hello World") term.read() When you execute this script, it'll probably do something like what you want. To have this script when your machine is booting, just specify this script's filename in your /home/.shrc So Let's say this script was `/home/billboard-message.lua` I would edit `/home/.shrc`, and just write that script path in `echo /home/billboard-message.lua > /home/.shrc`
  18. payonel

    How to implement IPv4 using modem.

    i do want to point out that plan9k is pretty outdated, will be removed from loot disks in a future release (not the next patch, but after)
  19. payonel

    When to use Microcontrollers

    A thing microcontrollers are better at than a normal computer (built with a case) is they can house upgrades and run on very low power. World interaction upgrades, such as the tank controller, require a robot or drone. Computer cases do not have an "upgrade" slot
  20. your comments in the tty changes are quite...passionate why did we have such weird \r handling? because users were copying strange mixtures of part mac, part windows, part linux files where line-endings weren't always complete, or fully copied., The output wasn't what they wanted. I agree that \r should be x=1. I might make that change myself. additionally, yes, \b i should have added I don't have any problem ignoring the charset change code. the version of tty and vt100 you have copied appear to be somewhat old, but i do recall making some vt100 fixes, might even be related to reverse video. In my latest dev builds the vt100 code has been improved (and is slightly faster for some workflows). But if you could point me to what you fixed, I could integrate that to our vt100 code. All in all, i'd be happy to considering merging your changes/fixes to my tty code so that future versions of oc work with your software without users having to update openos (Which will become more of an issue once we release our next update because your modifications to these files are no longer compatible) on another note, i've given considerable work to separate the cursor layer from the tty layer. it's not a true api yet, but close. It would be quite possible to leverage the cursor library code (in latest dev builds of oc with openos) to handle the cursor and proper blinking with your project. I might poke at that one day. ping us on oc if you want to chat about your really cool project here
  21. payonel

    Low level networking

    oc wired and wireless modems have addresses, and when you send a message you either broadcast or send to a specific address. You can think of this as its MAC. lua strings are technically just binary blobs, they can hold any binary data (yes, 0s included)
  22. payonel

    StattenOS - Base control system

    @Elijahlordencould you just remove the / from local file = io.open("/InstallData") to be local file = io.open("InstallData") should work just fine, for both those that think they still need to `cd /` and those that forget/don't know io.open uses relative path from the current working directory
  23. payonel

    gpu.bind() BUG

    This isn't a bug, per se, but you are venturing into unsupported territory of openos For performance reasons and simplicity of code, the core of openos is optimized for the most common workflow, which is 1 screen. There is caching involved in the tty layer of openos to read and write to the same screen and gpu. Some day I'll provide a userspace api for managing multiple screens and multiple windows You'll need to release the keyboard manually See, I just don't support this in openos `require("tty").window.keyboard = nil` 1. This is NOT future proof. When the day comes that I build a multi-screen and multi-window api layer, I am free to change this data structure. 2. Yes this is safe to do (in openos today), the code expects that the kb can be "released" like this 3. I would do this after you switch screens on the gpu
  24. payonel

    control door piston

    local component = require("component") local term = require("term") local text = require("text") local r = component.redstone ---- config section local password = {["1234"] = true, ["foobar"] = true} local delay = 5 --time the door stays open local side = 5 --side of the door, test this ----- local wrong = false while true do term.clear() if wrong then print("Password was wrong, try again") else print("Please enter the password") end wrong = false local input = text.trim(term.read({pwchar='*'}) or "") if passwords[input] then r.setOutput(side, 15) -- check if this is the correct function os.sleep(delay) r.setOutput(side, 0) -- same here else wrong = true end end
  25. payonel

    Refined Storage API - getItem

    I read what RS devs had to say about the issue, and the problem you are running into is that you are trying to make an exact match, which requires you to specify all the tags of an item. You can't omit some you don't care about. I recommend you do a more general search for items, select the one you care about, and then reuse the search result for future exact searches.

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.