Jump to content


KillaVanilla's Content

There have been 12 items by KillaVanilla (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#216123 Standalone CC OSes.

Posted by KillaVanilla on 02 May 2015 - 11:07 PM in General

 Dr. Poof, on 09 December 2014 - 01:34 PM, said:

Too underdeveloped for that too, the codebase is a mess.

I remember at least getting basic IDE harddrive and keyboard input working.
But yeah, the codebase was a complete mess. I literally learned code organization and formatting skills as I went.
I'll probably rewrite the codebase entirely.

Anyways, to anyone who wants to try: it's really not that difficult. The low-level (assembly) stuff you pretty much get out of the way immediately, and from there you can just write in C or C++.
Running luac inside of the kernel really wasn't that difficult: just port over newlib into kernel space, then drop the lua source code into your codebase.
luac is meant to be used as a library, so it's not really too difficult to do or use. The only problem was that I think the self-written memory manager the OS used as not very efficient, so when I tried running something that wasn't
a simple "hello world" program, the whole OS choked, froze, and died. But fixing that would be simple: just write another one that's better. Or get an existing one that works well.



#201944 EnderAPI - An API For the People, By the People

Posted by KillaVanilla on 01 January 2015 - 12:36 AM in APIs and Utilities

View PostSuicidalSTDz, on 31 December 2014 - 07:12 PM, said:

View PostAnavrins, on 31 December 2014 - 07:12 AM, said:

About the crypto api, specifically the AES part, I tried testing it against the official FIPS test vectors and they did not pass.
After some research, it looks like the key_schedule part is not properly implemented.
https://dl.dropboxus...37842828/cc.png
I'll speak to KillaVanilla about fixing that. It's not exactly my cup of tea.

View PostAnavrins, on 31 December 2014 - 07:12 AM, said:

About the crypto api, specifically the AES part, I tried testing it against the official FIPS test vectors and they did not pass.
After some research, it looks like the key_schedule part is not properly implemented.
https://dl.dropboxus...37842828/cc.png

I'm looking into it, don't worry.



#201432 [Kernel] kKernel - A complete base for OSes v0.2

Posted by KillaVanilla on 24 December 2014 - 09:25 AM in Operating Systems

This looks like an interesting project. I look forward to seeing what comes of it.



#201000 EnderAPI - An API For the People, By the People

Posted by KillaVanilla on 19 December 2014 - 06:37 PM in APIs and Utilities

So I've just sent you all a pull request. I hope you consider it.



#199546 Idea Exchange

Posted by KillaVanilla on 28 November 2014 - 11:40 AM in General

 incinirate, on 25 November 2014 - 05:22 AM, said:

 TheOddByte, on 12 November 2014 - 09:34 PM, said:

Some kind of "state restore" if you know what I mean, but that description is kinda vague so I guess I'll have to give a better one.
So if you've ever used an emulator you've might have noticed that there's something called gamestate which you can load and save, now I'm not sure if it's possible or not but I feel like it would be useful on servers. So basically it would be most useful on turtles, because don't you hate it when you've set a turtle to build something big and the server restarts? well that's why it would be useful, so when the server has restarted and you start your turtle/computer again it would restore from where you last were.
Woah, that was heavy.
I would like to take this on, but the only thing is, local variables.
I mean, the rest, phhh peice of cake, but how to restore local variables to programs... hmm...

One (relatively) easy and fast way to do this would be to dynamically rewrite variable definitions (and function parameters) to make use of a "hidden table" or something.
Something that would transform
function a( c )
	local b = 13 + c
	return b + c
end

into

function a( c )
	hiddenTable.c = c
	hiddenTable.b = 13 + hiddenTable.c
	return hiddenTable.b + hiddenTable.c
end

though you would have to perform some sort of lexical or syntactical analysis to account for aliasing, scopes, etc.

You would also have to add bits to functions to replicate the call stack (which would on its own provide a handy way to keep track of locals)



#199543 Logistics Network -- Turtle Item Movement API (Rendezvous, Search, Etc.)

Posted by KillaVanilla on 28 November 2014 - 11:11 AM in APIs and Utilities

Hello all once more.

I've been out for quite a while, but I've recently discovered that turtles can now identify blocks and items on their own.
This lead to a neat idea I've been wanting to try out, but I had to make a few subcomponents first.

This is a "Logistics API"; if you're wondering about the name: I was kind of inspired by the Logistics Pipes mod.

Anyways, this API provides facilities for the following:
  • Persistent location (spatial and facing)
  • Automatic GPS
  • Item Tracking ("turtle X at position (x,y,z) has items Y, Z, and A")
  • Item Transfer
  • Task Scheduling / Planning ("move to (x,y,z), stay there for a few seconds, then go to (a,b,c) and rendezvous with turtle Y to get item Z....")
  • Data Networking (the API uses floodfill networking internally)
The API is centered around a list of tasks the turtle will do at some point in time.
These tasks can be anything from simple waiting to a "rendezvous" (item transfer transaction).

Functions:
  • bootstrap() -- Initialize the API (get position, initialize modems, etc.). Call this before doing anything else with the API.
  • set_rendezvous( id, op_type, vec, item, count) -- Schedule an item transfer with a turtle. op_type must be either "get" or "put"-- "get" will cause the other turtle to put items into the calling turtle, while "put" does the opposite. Vec is a vector (using the Vector API) to a place to perform the rendezvous; this area should be clear, and the area directly above this vector should also be clear. Item and Count compose the list of items to transfer. Each element of one list corresponds to the same-indexed element in the other. Entries in Item should be names returned by turtle.identify or turtle.getItemDetail. For example,
    set_rendezvous( 9, "put", vector.new( 55, 12, 15 ), { "minecraft:stone", "minecraft:sign" }, {1, 2} )
    
    would cause the calling turtle to move to (55, 12, 15) and place a Stone Block and a Sign in turtle 9 (os.computerID())'s inventory.
  • schedule_move_to( vec, time_spent) -- Schedule a move to the specified vector, and a subsequent wait.
  • wait_move_to( vec, time_spent ) -- As above, but then wait for the move to actually take place.
  • schedule_static_rendezvous( vec, op, container, slot , count) -- Schedule an item transfer with a "static" container (a chest, etc.). Op and Count are as with set_rendezvous(). Container is the name of the type of block to interface with, for example, "minecraft:chest". Slot is a list of slots to utilize when performing the request. Count can be an empty table; in this case, each slot will be completely emptied or filled, according to the operation. For example,
    schedule_static_rendezvous( vector.new(55, 66, 22), "get", "minecraft:chest", {1, 15}, {23, 56} )
    
    would cause the calling turtle to move to (55, 66, 22), and from an adjacent chest, retrieve 23 items to place in slot 1, and retrieve another 56 items to place into slot 15.
  • get_current_pos() -- get a vector representing the turtle's current (x,y,z) coordinates.
  • network_search( items, types, counts ) -- Scan the network for turtles with the specified items. As with set_rendezvous() and schedule_static_rendezvous(), all three parameters should correspond to one another. Items is a list of items to search for, Types is a list of the type of item to search for (for now only the "item" type has been tested) and counts is a list of the minimum number of items to return when searching. For example,
    network_search( {"minecraft:stone"}, {"item"}, {32} )
    
    would search for all networked turtles that have at least 32 stone blocks somewhere in their inventories.
  • unit_query( id ) -- Get information on a turtle.
  • push_moves() -- Wakes up the move handler. Use this after scheduling moves (such as with set_rendezvous())
Return Value Formats:
This function uses objects heavily inside.
Two functions so far return objects:
  • network_search() -- Returns a list of response objects of the format:
    { id = sender.id, resource = { <list of matched items> }, types={ <list of matched types for resource> }, count = { <list of counts of matched items> } }
    
  • unit_query() -- Returns a list of response objects of the format:
    {
    id = <sender-id>
    inv= <sender-inventory>,
    unit_info=<unit-info-list>
    position=<unit-position>
    facing=<unit-facing>
    n_tasks=<unit-task-list-length>
    }
    
Here's one example program:
-- this simple example searches for stone blocks on the network,
-- performs a rendezvous with any turtles that have stone blocks,
-- and then puts the first two slots of the turtle's inventory in a chest.
local r = logistical_network.network_search( {"minecraft:stone"}, {"item"}, {0} ) -- look for turtles with stone blocks
local rVec = vector.new( 203, 60, -283 ) -- location to rendezvous at
local cVec = vector.new( 197, 56, -276 ) -- location of a empty space adjacent to a chest
for i=1, #r do
	logistical_network.set_rendezvous( r[i].id, "get", rVec, {"minecraft:stone"}, {r[i].count[1]} ) -- schedule a rendezvous at rVec
end
local last_id = logistical_network.schedule_static_rendezvous( cVec, "put", "minecraft:chest", {1,2}, {} ) -- put the items into the chest
logistical_network.push_moves() -- now go actually do everything

Get it here.
(pastebin code: yJAA43zd)

--

Yeah, this documentation is pretty sloppy, isn't it?
Well, to be frank, I think it's because this API's still kind of a work in progress. It works-- more or less, however.

There's still a few issues to work out, though:
  • The rendezvous system is very sensitive to GPS trilateration errors. Any way of minimizing or eliminating this error automatically or semi-automatically would be greatly appreciated. I was looking into multilateration, but I can't figure out how to get that to work.
  • If tasks are spatially clustered (close together), then they sometimes get to the task site too early, which poses problems for rendezvouses (since they can time out).
  • I need to find a better way to route around obstructions that turtles should break (other turtles, computers, etc.). Right now the turtles just patiently wait for the obstruction to go away... which may never happen or might not happen fast enough.
There are also a few more things I'm working on or will be working on soon:
  • Rendezvous Chaining: Basically, bucket-brigade-style delivery of items from turtle A to turtle B over long distances. Turtles pass an item down a chain of other turtles, eventually arriving at a destination turtle. For example, turtle A rendezvouses with turtle X, who passes it on to Y, and so on and so on, until turtle N passes it on to the destination turtle B. The benefit of doing this as opposed to direct delivery is that it requires less travel time of each turtle, freeing them up for other requests sooner.
  • Crafting support: this would allow for the network to make items that are requested. Would require a hand-compiled list of recipes, though this shouldn't be too difficult.
  • Building support: It would be nice to have a swarm of building turtles that can automatically distribute building resources amongst themselves. Or a swarm that can mine and then transfer the resources to a building site immediately.
  • Refueling support: for whenever a networked turtle runs out of fuel (or to bootstrap newly-created turtles)
  • Better "Static Node" support: Probably will involve "beacon" computers that respond to network requests like turtles, but don't move. These would be used to advertise chests, furnaces, and other stationary inventories.
What I'm planning on making with all this:
  • Von Neumann Turtle Swarm: A self-replicating swarm of turtles that can make other turtles to add to the swarm. Would require mining and crafting support, as well as minimal building support.



#184399 [WIP] "Omamori" - A hobbyist OS project aka "I put luac in kernel space"

Posted by KillaVanilla on 17 June 2014 - 05:53 PM in General

 Sxw, on 15 June 2014 - 05:41 AM, said:

Theres a guide about writing OS's for the raspberry pi in assembly. Goes pretty in depth for a beginners guide. (Images, text, interrupts)
http://www.cl.cam.ac...i/tutorials/os/
This does seem very interesting, but where does it start talking about interrupts?
Also, I'm also looking specifically about how paging works on an ARM.

 Lua.is.the.best, on 09 June 2014 - 05:34 AM, said:

Written in C++, eh?
Could whip up some math .h files here!
All your doing is using cin to input numbers..
Then use operators to do stuff!
I actually have integrated a C standard library into my kernel, but for various reasons I don't use it very often (or at all) in the code I've written.
Also, this OS doesn't actually have standard input (or file streams, for that matter) implemented yet. The only way to get input is to call into the keyboard driver itself.



#182263 [WIP] "Omamori" - A hobbyist OS project aka "I put luac in kernel space"

Posted by KillaVanilla on 04 June 2014 - 10:31 PM in General

I could try porting this to ARM, if I had an emulator for it.
(Well, I do have a raspberry pi in the drawer, so...)

It shouldn't be too hard, though I'd have to rewrite parts all of the memory management and allocation system, as well as interrupt handling.
I think that I have the time (whoo summer break) and the dedication for this.
Edit: Porting this to ARM seems surprisingly easy (most of the code I've written is platform-independent C++), but debugging kinda looks like a pain..

Does anyone have experience writing assembly for ARM11?
I'd appreciate the assistance.



#182185 [WIP] "Omamori" - A hobbyist OS project aka "I put luac in kernel space"

Posted by KillaVanilla on 04 June 2014 - 04:21 PM in General

View Postamtra5, on 04 June 2014 - 08:37 AM, said:

Any way for an option to use lua 5.1? (You know where this is going :P)

This would be really, really easy: just replace the files in "src/lib/lua" with the source code for lua 5.1.
You might need to change things around in "src/boot/x86/main.cpp", but that's trivial.



#182108 [WIP] "Omamori" - A hobbyist OS project aka "I put luac in kernel space"

Posted by KillaVanilla on 04 June 2014 - 02:56 AM in General

View Postlieudusty, on 04 June 2014 - 01:13 AM, said:

Why were you writing your own parser and lexer in the first place when you had the option to used luac?

I didn't know / realize that I could use luac.
Writing the parser and lexer was a fun exercise, though.



#182094 [WIP] "Omamori" - A hobbyist OS project aka "I put luac in kernel space"

Posted by KillaVanilla on 04 June 2014 - 12:51 AM in General

I've been working on this over the past month.
I've decided to scrap the parser and lexer I had and just integrate the main luac code into my kernel.

Right now, it's working great. Still can't load programs from disk (no hard drive drivers yet, and my PCI driver crashes the kernel when it tries to detect stuff) but at least code execution's working.
Posted Image

The program running here is a simple one-liner:
writeout("hello from lua version ",_VERSION,"!") return 0xC0DE

Where "writeout()" is a function that's basically just "print()". (It bypasses the standard library and prints using the VGA driver's functions directly, though).



#176471 [WIP] "Omamori" - A hobbyist OS project aka "I put luac in kernel space"

Posted by KillaVanilla on 03 May 2014 - 06:36 PM in General

View Postlieudusty, on 03 May 2014 - 02:20 PM, said:

Amazing project!

Is it going to execute Lua code by compiling it into bytecode that will be run in a Lua VM or will it somehow get converted into native machine code?
I'm planning on compiling the Lua code to native machine code, though anything could be subject to change at this point.