Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Izaya

skex-BIOS

Recommended Posts

As drones have recently been released (ie latest dev build), it became apparent that there needed to be an OS that is even more embedded than MiniOS. Even more embedded than MicrOS. This has been done.

I present to you:

skex-BIOS

skex-BIOS is a port of my not-very-popular line editor skex (ShadowKat Editor eXpanded, the sequel to sked) to fit into an EEPROM and be accessible over a network. skex-BIOS uses some code Sangar posted for controlling robots, mainly the I/O and client program for OpenOS, but with far more functionality: on the remote end, you have a full line editor that can execute code from the buffer, the ability to re-flash the EEPROM for updates or permenant deployment of a program, and on the client-side, you have a non-blocking remote terminal that allows you to have multiple lines of text coming across your link.

Note: In this state there is no security at all on the link, so someone could easily hijack your drone or microcontroller. Plan accordingly, especially change the port used.

Anyway, you can find skex-BIOS at my site: https://git.shadowkat.net/izaya/skex-BIOS

Old link: http://web.archive.org/web/20150317135050/http://shadowkat.tk/projects/skex-BIOS/

Link to post
Share on other sites

I like it! It took me a little while to figure out how to commit line changes and enter some working code but all in all this is fantastic!

I think ill write something similar but a bit more easy to use. Maybe just a proper client will do. Also adding a little more help on how to use all the functionality with some examples would be very helpful. Thanks for this :)

 

I made a small change to the client to fix a bug aswell.

local component = require("component")
local event = require("event")
local modem = component.modem
local listen = function(evt,_,_,_,_,...) print(...) end -- here.
-- helps when restarting the client to prevent event listener duplicates
event.listen("modem_message",listen) -- and here.
modem.open(2412)
while true do
  local cmd=io.read()
  if not cmd then return end
  modem.broadcast(2412, cmd)
  if cmd == "q" then break end -- here  too
end
event.ignore("modem_message",listen) 
Link to post
Share on other sites

I noticed v 1.1. I really like the event functions you implemented. I've come upon a bug in skex.

1.insert code into buffer from client

2.execute the buffer

3.clear the buffer

4.re-enter insert mode and enter a line into buffer.

5.crash- dont know why...

 

Thanks for skex. I'm learning a lot from your stuff :P

Link to post
Share on other sites

I noticed v 1.1. I really like the event functions you implemented. I've come upon a bug in skex.

1.insert code into buffer from client

2.execute the buffer

3.clear the buffer

4.re-enter insert mode and enter a line into buffer.

5.crash- dont know why...

 

Thanks for skex. I'm learning a lot from your stuff :P

Well, v0.1.2 is out.

The bug you mentioned is probably accidentally fixed.

I changed the buffer and line number to be global rather than local, in order to support read and write to/from the EEPROM and to/from the buffer. There's snippets for abusing this feature on the project page.

I'm really happy I could help you, not often someone tells you thanks for something. :D

Oh yeah, I incorporated your changes to the client program, too. There will be improvements to it soon, but I'd like to make the EEPROM-resident capible of supporting identification of some kind. Anyway, enjoy.

Link to post
Share on other sites

First off, Love how compact this bios is, I've spent the last three days trying to reduce the event API into something a microcontroller can implement, and this does it wonderfully!  however, a few notable issues I've found:

 

Hello!

Thanks for the BIOS. For me, it has a problem:

I have a drone with skex.

I connect to it, using client.lua, then disconnect with ctrl-alt-c. If I do it this way, all the output from my drone would be doubled for every next client.

Tested it little bit:

http://i.imgur.com/QwZjd8n.png

:)

 

 

The reason this happening is actually In the client. The client calls event.listen to register a handler and when you quit the program like that then the program doesn't finish executing and thus can't unregister the handler.

 

This is still a valid issue in skexBIOS 0.1.2 with client 1.0:  while the client listens for a 'quit' message from the microcontroller... this message is never sent, the microcontroller's method of shutting off is to simply brick itself

local run = true
[...]
while run do
  local cmdt = splitonspace(read())
  if cmdt[1] == 'q' then
    run = false
  elseif
  [...]
  end
end


Nothing occurs after the microcontroller shuts down, nothing is sent back to the client letting it know to stop the listener or close the modem port.

 

I'm also surprised the files aren't up on a dedicated pastebin or github for the current version, since even though we can download from the homepage. most people are likely to submit to pastebin in order to import them into their minecraft world anyway.

 

There are a few other adjustments that could be made to the programs, especially client side, so definitely looking forward to the next version (if i don't make my own before then :P )

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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