## LöveOS

JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

### LöveOS

I was sitting down one day, and thought to myself, "What if I put a computer, in my game? Then I could be on the computer, while I was on the computer!".
With that thought in mind I began development on LöveOS.

Here is an image of it. http://i.imgur.com/8JKJ4Ry.png

The repository is located here. https://github.com/jessehorne/loveos
It comes with a main.lua file, but if you read the README, you will know how to use it without it. I will attach a .love file for those of you who just wish to see it in action.
What is LoveOS?
LoveOS is a Simulated Terminal created by Jesse Horne with LÖVE. The goal was to create something, that anyone could add to their own LÖVE program, to give them something to interact with their game, or just for fun, that simulated a computer terminal. If you are familiar with computercraft, then this should be pretty easy to understand.
All it can do now, is basic interaction with files. I've implemented the cd, mkdir, ls, and rm commands. Those are standard UNIX commands, so you can google what each of them does. You can also run the scripts as well. Some documentation of that is on the repos wiki page on github.

But yes, I hope to have some basic programs in there, to give it a more OS feel. Things like, ssh, git, text editor like vim, etc.
Anyone is welcome to contribute, or discuss future development of this project. Just stop by ##jesseh on Freenode. That is where I am, always.
Thanks all!
Note* This is not meant to be a standalone program. It is meant to be an addition to any love game.

Code: Select all

clear  -- Used for clearing the console
touch  -- Used for creating files with no content
mkdir  -- Used for creating directories
help  -- Help feature, shows available commands
ls   -- Lists the current directory
run  -- Runs a Lua script (all lua scripts much use the libloveos library)
rm  -- Removes a file/directory
cd   -- Used for changing directories
Last edited by JesseH on Wed Apr 16, 2014 5:31 pm, edited 4 times in total.

Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

### Re: LöveOS

Very nice! Cant wait for future updates! Very impressive
"In those quiet moments, you come into my mind" - Liam Reilly

T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

### Re: LöveOS

I've been thinking about doing something like this several time. Mostly because my crappy netbook lags no matter what OS it runs, but all LÖVE games runs really smoothly

EDIT: Oh, it's just a CLI. Then Ctrl + Alt + F1 is a better solution for my netbook

Jasoco
Inner party member
Posts: 3620
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

### Re: LöveOS

I put a computer in my game engine that runs its own computer simulation.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: LöveOS

That's pretty neat, but why does it export 23 globals? To wit:
1. loveos
2. loveos_cmd_num
3. loveos_screen_width
4. loveos_screen_height
5. loveos_start_x
6. loveos_start_y
7. loveos_font
8. loveos_dir
9. loveos_cursor_default
10. loveos_font_w
11. loveos_font_h
12. loveos_cursor_x
13. loveos_cursor_y
14. loveos_cursor_orig
15. loveos_cursor
16. loveos_backlog_max
17. loveos_upper
18. loveos_is_letter
19. cd
20. mkdir
21. ls
22. rm
23. help
Why not put the first batch in the loveos table and why not pass the latter few as arguments to loveos:add_function?

JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

### Re: LöveOS

Robin wrote:That's pretty neat, but why does it export 23 globals? To wit:
1. loveos
2. loveos_cmd_num
3. loveos_screen_width
4. loveos_screen_height
5. loveos_start_x
6. loveos_start_y
7. loveos_font
8. loveos_dir
9. loveos_cursor_default
10. loveos_font_w
11. loveos_font_h
12. loveos_cursor_x
13. loveos_cursor_y
14. loveos_cursor_orig
15. loveos_cursor
16. loveos_backlog_max
17. loveos_upper
18. loveos_is_letter
19. cd
20. mkdir
21. ls
22. rm
23. help
Why not put the first batch in the loveos table and why not pass the latter few as arguments to loveos:add_function?
I put this code out pretty quickly, but yeah I'm working on it. Thanks for the advice.

qaisjp
Party member
Posts: 489
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

### Re: LöveOS

Don't mean to spoil the party but.. what comes with this. I don't want to come off as an asshole but it's nothing .. really special to be honest.
it's just a CLI that does nothing...
Lua is not an acronym.

JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

### Re: LöveOS

Well I am just letting the community know what I am working on. Right now it does come with some things, you will just have to read the readme, and wiki on the repos github page.
I just implemented the ability to run lua scripts in it. The scripts use the input/ouput library in loveos/libs called libloveos. Look through that file to see what you can do with it.

rlaitila
Prole
Posts: 9
Joined: Sat Jun 08, 2013 5:33 am

### Re: LöveOS

qaisjp: " I don't want to come off as an asshole but it's nothing"

Then don't say things that come off as asshole-ish and instead provide either a helpful or insightful comment or say nothing at all. The point is that someone is being creative and more importantly, is sharing their work for better or worse. Whether it does anything useful at this time is irrelevant.

Anyway,

JesseH I hope you move forward with your project until it has a bit more functionality or until you are bored with it The though of a simple pseudo-computer/os library for games would be awesome! Especially as a way to quickly implement a dropdown console or whatever. Keep it up

I've thought about a project like this from time to time and I would say if this were to become something real, some hard thought would need to be had about trying ot create a "kernel" of sorts that you can use to abstract common computer functions and to attach fake systems such as input/output devices and filesystems etc. It would have to be modular enough that other people could build and "plugin" additional code which would extend the core software functionality.

For the sake of an operating system within a scripting lanuage, maybe it would be important to build a kernel that can do a few basic tasks to see how the project goes, say:

- Maintain a core program loop. Either in its own dedicated thread, or managed by the main love thread through callbacks.
- Write a file stream to an in-memory filesystem
- Read a file stream from an in-memory filesystem
- Execute an in-memory file and run its source (lua) somehow safely.

It doesn't need to be extravagant. All of this could be done in a love thread by itself, and this would be our "kernel". You would issue system calls to the kernel through the built in thread messaging system, and it would return responses the same way. The kernel handles all filesystem and execution tasks, and modules that people build only need to know how to handle the kernels input/output message formats.

Once you can do that easily, then you build your CLI and other related programs to make things easier on the end-user. Just some thoughts. Anyway, keep it up!

JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

### Re: LöveOS

T-Bone wrote:I've been thinking about doing something like this several time. Mostly because my crappy netbook lags no matter what OS it runs, but all LÖVE games runs really smoothly

EDIT: Oh, it's just a CLI. Then Ctrl + Alt + F1 is a better solution for my netbook
I think being able to boot the love games directly would be very cool! I could totally see myself buying a R-Pi just for love games.

### Who is online

Users browsing this forum: Google [Bot] and 2 guests