This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KeeganDeathman's profile picture

Standalone CC OSes.

Started by KeeganDeathman, 15 September 2014 - 05:12 AM
KeeganDeathman #1
Posted 15 September 2014 - 07:12 AM
Hey guys,
The OSes on here are amazing.
But what if you were able to run those OSes outside of MC or CCEmu and other emulators.
Like, from your bootstrap.
I want to start a project to bring the best CC Operating Systems to a point of operating with the BIOS directly. This isn't simply having your GRUB launch your .lua file.
Problems:
  1. Getting the bootloader to recognize the OS as an OS
  2. APIs, all OSes here rely on CC's internal APIs, these dont exist inside normal lua
  3. Lua can't make files on its own, only my calling on the OS
Answers:
  1. Same as all OSes. Bootstrap.
  2. Bring the APIs with the OS
  3. Add some code from other langauges, most likely assembly, for functions Lua relies on to do things.
I'm thinking oeed's OneOS, but if your thinking something else post it in the comments.
If you'd like in, post in the comments.

I'm not saying these qaulify for your sole OS, but running alongside windows/linux/OSX.
oeed #2
Posted 15 September 2014 - 08:44 AM
Nice idea, but in terms of problems, I'd say there are a lot more bigger problems than just the ones listed. You have to basically write the entire IO, user input, etc system. You also need to get Lua working at such a low level. Not say it's not possible, but it's certainly quite challenging!

I'm not sure if you'd need to write it in assembly, hopefully not, but it's reaaaaaally not fun. I tried doing a bit on my Raspberry Pi, and well, it kinda looks like this…

mov r2,#0x3F0000
wait1$:
sub r2,#1
cmp r2,#0
bne wait1$
That turned on an LED IIRC.

It varies of course, and some architectures are easier than others. Basically, it's gona be quite a challenge. I'd love to see OneOS as a real OS though.
Edited on 15 September 2014 - 06:45 AM
TurtleHunter #3
Posted 15 September 2014 - 03:03 PM
On this project, the last thing is making a lua intepreter. It could be worked from this
KeeganDeathman #4
Posted 15 September 2014 - 11:32 PM
Yes, I understand we'd have to make up the whole backbone. But, yeah, not assembly. I know java, some C++ and C(going off the ones listed in TInkernut's video). Java already has a file system, if this works directly with the hard drive and ROM, or if it calls the OS, well.
KeeganDeathman #5
Posted 16 September 2014 - 06:57 AM
I've researched it here's what we'd need to do.
1.Use to add a small backbone to allow for bootstrap and support of the JVM.
2. Implement the JVM
3.Setup the appropriate jars to work right(I can think of computercraft, and most likely lwjgl, as CC may depend on it.)
4. Implement the OS. This would need to be modified from the CC-alone version. It need to call different functions than CC's for reboot and shutdown, to actually reboot and shutdown. As well as network access.

Also, anything we feel we'd need in the OS as essentials but can't be done with java, could be done with the JVM. launch some JFrame powered browsers.
Also, it would therotically be able to run the minecraft.
Saldor010 #6
Posted 16 September 2014 - 02:38 PM
I've researched it here's what we'd need to do.
1.Use to add a small backbone to allow for bootstrap and support of the JVM.
2. Implement the JVM
3.Setup the appropriate jars to work right(I can think of computercraft, and most likely lwjgl, as CC may depend on it.)
4. Implement the OS. This would need to be modified from the CC-alone version. It need to call different functions than CC's for reboot and shutdown, to actually reboot and shutdown. As well as network access.

Also, anything we feel we'd need in the OS as essentials but can't be done with java, could be done with the JVM. launch some JFrame powered browsers.
Also, it would therotically be able to run the minecraft.

How long do you think it would take?
TurtleHunter #7
Posted 16 September 2014 - 11:29 PM
I've researched it here's what we'd need to do.
1.Use to add a small backbone to allow for bootstrap and support of the JVM.
2. Implement the JVM
3.Setup the appropriate jars to work right(I can think of computercraft, and most likely lwjgl, as CC may depend on it.)
4. Implement the OS. This would need to be modified from the CC-alone version. It need to call different functions than CC's for reboot and shutdown, to actually reboot and shutdown. As well as network access.

Also, anything we feel we'd need in the OS as essentials but can't be done with java, could be done with the JVM. launch some JFrame powered browsers.
Also, it would therotically be able to run the minecraft.
Do you know how complicated is to put a vm in a real machine, specially java. Lua can be worked around using C.
oeed #8
Posted 17 September 2014 - 12:16 AM
To be quite honest, what I'd do is just customise a GUI Linux distro that just runs a Java CC emulator. It'd be waaay easier, although not as genuine as you probably want.
TurtleHunter #9
Posted 17 September 2014 - 04:14 AM
To be quite honest, what I'd do is just customise a GUI Linux distro that just runs a Java CC emulator. It'd be waaay easier, although not as genuine as you probably want.
If you want this aproach, you can use this book, to make a custom linux distro, this is the way i would go, imagine that if you write it from scratch you have to rewrite every library that c uses to use your asm code
Edited on 17 September 2014 - 02:21 AM
KeeganDeathman #10
Posted 17 September 2014 - 06:40 AM
I've researched it here's what we'd need to do.
1.Use to add a small backbone to allow for bootstrap and support of the JVM.
2. Implement the JVM
3.Setup the appropriate jars to work right(I can think of computercraft, and most likely lwjgl, as CC may depend on it.)
4. Implement the OS. This would need to be modified from the CC-alone version. It need to call different functions than CC's for reboot and shutdown, to actually reboot and shutdown. As well as network access.

Also, anything we feel we'd need in the OS as essentials but can't be done with java, could be done with the JVM. launch some JFrame powered browsers.
Also, it would therotically be able to run the minecraft.
Do you know how complicated is to put a vm in a real machine, specially java. Lua can be worked around using C.
What? Do you know what a JVM is?

To be quite honest, what I'd do is just customise a GUI Linux distro that just runs a Java CC emulator. It'd be waaay easier, although not as genuine as you probably want.
I was thinking a linux based OS too.
It would provide backbone, bootstrap, and we could definitely get the JVM running.
ElvishJerricco #11
Posted 17 September 2014 - 10:59 AM
2. Implement the JVM

I don't think you quite understand what you're getting yourself into here. That one line alone is such an enormous task. JVML-JIT has been in the works (admittedly, off and on) for months and months and we only just now got exceptions working. And this is with an existing system backing it, in a language that makes it much easier to implement than C. The JVM isn't something you can just implement on a whim. Many of the things you hope the pre-existing libraries will do depend on native code. It won't handle file IO for you, you'll have to implement hard disk read-write, then file IO, then hook that into the natives used by the Java libraries, all in C.

There's just so much to do here, it would take a proper team a very long time to get from 0 to there.
TurtleHunter #12
Posted 17 September 2014 - 11:47 AM
I've researched it here's what we'd need to do.
1.Use to add a small backbone to allow for bootstrap and support of the JVM.
2. Implement the JVM
3.Setup the appropriate jars to work right(I can think of computercraft, and most likely lwjgl, as CC may depend on it.)
4. Implement the OS. This would need to be modified from the CC-alone version. It need to call different functions than CC's for reboot and shutdown, to actually reboot and shutdown. As well as network access.

Also, anything we feel we'd need in the OS as essentials but can't be done with java, could be done with the JVM. launch some JFrame powered browsers.
Also, it would therotically be able to run the minecraft.
Do you know how complicated is to put a vm in a real machine, specially java. Lua can be worked around using C.
What? Do you know what a JVM is?

JVM = Java Virtual Machine, its runs in top of some c code, like luas, so they run a vm.
LDDestroier #13
Posted 20 October 2014 - 08:40 PM
I agree, just port a good computercraft emulator for Arch linux, get a CraftOS terminal font, then make it run the emulator at startup. Maybe you could use what a normal computer would see as internet as rednet, but only on LAN. For example, if you had two CraftOS computers (CrarchOS?), and they were connected together on the local area network, then the two CraftOS computers could see each other as connected with rednet. Then, two PCs in the same house could play a rednet game (like tron) or use a chatroom, or both, with LyqydOS/OneOS.
jaredallard #14
Posted 02 December 2014 - 04:33 AM
Easy, Compile your own linux kernel. Write a kernel module to allow lua to hook-into the kernel, write end wrappers for lua too mimic CC, then embed lua in the C module, then have it launch lua programs via the kernel module, and you have the easiest most native method of interfacing with the computer itself. Really easy as Lua is designed for C embeding.
tenshae #15
Posted 03 December 2014 - 06:46 AM
Easy, Compile your own linux kernel. Write a kernel module to allow lua to hook-into the kernel, write end wrappers for lua too mimic CC, then embed lua in the C module, then have it launch lua programs via the kernel module, and you have the easiest most native method of interfacing with the computer itself. Really easy as Lua is designed for C embeding.

Kernel programming is WAY different than dancing around in userland, making an angel in a bed of flowers; because that bed of flowers is held up by a big steel framework: kernel space. When you're having to meticulously crawl around on it like monkey bars, you can't just plop a box (Lua) on a cozy bed of flowers.

Crazy analogies aside, you'd need to rewrite Lua at least a little bit for it to work in kernel space.
FUNCTION MAN! #16
Posted 03 December 2014 - 10:53 AM
-snip-

Kernel programming is WAY different than dancing around in userland, making an angel in a bed of flowers; because that bed of flowers is held up by a big steel framework: kernel space. When you're having to meticulously crawl around on it like monkey bars, you can't just plop a box (Lua) on a cozy bed of flowers.

Crazy analogies aside, you'd need to rewrite Lua at least a little bit for it to work in kernel space.

Actually. The 'cozy bed of flowers' the Linux kernel provides is enough to plop the box upon it. What I mean is, the Linux kernel has a sufficiently-developed standard library to drop Lua on it, and it'll work like a charm.
TurtleHunter #17
Posted 03 December 2014 - 02:11 PM
Omamori anyone?
jaredallard #18
Posted 03 December 2014 - 06:34 PM

Actually. The 'cozy bed of flowers' the Linux kernel provides is enough to plop the box upon it. What I mean is, the Linux kernel has a sufficiently-developed standard library to drop Lua on it, and it'll work like a charm.

Exactly.
FUNCTION MAN! #19
Posted 04 December 2014 - 11:36 AM
Omamori anyone?

Too under-developed, does not provide hard disk drivers, nor input, as far as I know.
TurtleHunter #20
Posted 04 December 2014 - 05:16 PM
Omamori anyone?

Too under-developed, does not provide hard disk drivers, nor input, as far as I know.
Fork it, implement them and do a pull request.
Engineer #21
Posted 05 December 2014 - 10:07 AM
I almost would say that it is pointless to port a CC OS to a real life OS. You'd only be limited to what you can do on a computer, because I assume this OS is going to work on both CC and a computer. I'd rather choose something like a big company's OS then a small OS which probably has way less functionality.

What Im getting on is the fact that it is a huge task to even run native lua code and on top of that the OS which is published out here. I am also scared that the security of such an OS is very bad.
All that said, I do not want to hold back to you making such an OS, it is really a challenge
oeed #22
Posted 05 December 2014 - 10:47 AM
I almost would say that it is pointless to port a CC OS to a real life OS. You'd only be limited to what you can do on a computer, because I assume this OS is going to work on both CC and a computer. I'd rather choose something like a big company's OS then a small OS which probably has way less functionality.

What Im getting on is the fact that it is a huge task to even run native lua code and on top of that the OS which is published out here. I am also scared that the security of such an OS is very bad.
All that said, I do not want to hold back to you making such an OS, it is really a challenge

Yea, I'd have to agree.

Running something like OneOS would certainly be very cool, I'm not doubting that. But ComputerCraft just has so many limitations such as the tiny colour palette and massive pixels/character based.
FUNCTION MAN! #23
Posted 09 December 2014 - 01:34 PM

Too underdeveloped for that too, the codebase is a mess.
TurtleHunter #24
Posted 09 December 2014 - 03:14 PM

Too underdeveloped for that too, the codebase is a mess.
Then start your own…
syfygirl #25
Posted 09 December 2014 - 03:40 PM
Hey guys,
The OSes on here are amazing.
But what if you were able to run those OSes outside of MC or CCEmu and other emulators.
Like, from your bootstrap.
I want to start a project to bring the best CC Operating Systems to a point of operating with the BIOS directly. This isn't simply having your GRUB launch your .lua file.
Problems:
  1. Getting the bootloader to recognize the OS as an OS
  2. APIs, all OSes here rely on CC's internal APIs, these dont exist inside normal lua
  3. Lua can't make files on its own, only my calling on the OS
Answers:
  1. Same as all OSes. Bootstrap.
  2. Bring the APIs with the OS
  3. Add some code from other langauges, most likely assembly, for functions Lua relies on to do things.
I'm thinking oeed's OneOS, but if your thinking something else post it in the comments.
If you'd like in, post in the comments.

I'm not saying these qaulify for your sole OS, but running alongside windows/linux/OSX.

why not make a linux distro, with a cc emulator always running ? i can help iv'e used linux for almost two years
Edited on 09 December 2014 - 02:42 PM
KeeganDeathman #26
Posted 10 April 2015 - 04:47 AM
Hey guys,
The OSes on here are amazing.
But what if you were able to run those OSes outside of MC or CCEmu and other emulators.
Like, from your bootstrap.
I want to start a project to bring the best CC Operating Systems to a point of operating with the BIOS directly. This isn't simply having your GRUB launch your .lua file.
Problems:
  1. Getting the bootloader to recognize the OS as an OS
  2. APIs, all OSes here rely on CC's internal APIs, these dont exist inside normal lua
  3. Lua can't make files on its own, only my calling on the OS
Answers:
  1. Same as all OSes. Bootstrap.
  2. Bring the APIs with the OS
  3. Add some code from other langauges, most likely assembly, for functions Lua relies on to do things.
I'm thinking oeed's OneOS, but if your thinking something else post it in the comments.
If you'd like in, post in the comments.

I'm not saying these qaulify for your sole OS, but running alongside windows/linux/OSX.

why not make a linux distro, with a cc emulator always running ? i can help iv'e used linux for almost two years

I'm back! We already unofficially decided in this. We also decided it would have to be a dual-boot. Another project. Yay
DannySMc #27
Posted 13 April 2015 - 12:31 PM
This is possible, Considering Lua compiles cleanly as C… You could easily implement it into C then use C to make the low-level code.
KillaVanilla #28
Posted 03 May 2015 - 12:07 AM
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.
Anfred #29
Posted 11 June 2015 - 07:18 PM
Hi,
What if a stand alone Craft OS could run on a tiny, cheap computer? I think you could take this concept one step further, by making an OS that can be used to program open source electronics, and run on single board computers.

I am fascinated by open source electronics. I found out about computercraft from trying to create tetris on an Arduino. I realized that Craft OS and Lua, are great places to start game programming. The Lua apps found in this forum, are the best beginner examples of code anywhere on the web! I think computercraft doesn't fully realize what has been happening here: minecraft has accidentally spawned the best way for beginners to learn computer programming, hands down.

I have been following open source hardware for a long time. Just 2 years ago, there were many less options out there, with Arudino and Raspberry PI being the the front-runners for making robots. Now, many cheap development boards have wifi; Recently, a $9 computer made a big splash on kickstarter! That's right, for $9 you get a linux capable board, with wifi and bluetooth! It also comes with a composite out for direct connection to a TV or monitor. Now if you were to add a 5" car LCD, battery, and a bluetooth keyboard, you would be well on tour way to building an real-world Craft OS Computer! And it could all be done for under $50. That will be impossible until 2016 though. In the meantime, you could instead, develop the distro for a RPI A+ board; which at $21, it is currently the worlds cheapest, modern, computer.

This project would get a whole lot of attention, if it was compatible with the "maker movement". It could send lua scripts to a development board, or to any computer running the Linux-Craft OS. Already, many wifi boards are using wifi as the main way to receive new programs, instead of a USB serial port. This would get attention from many websites, especially Hackaday.com. I can really see this being the best educational computer ever made. Current educational computers use Scratch, or Basic, as their teaching tools. Linux-Craft OS would be a much better way to learn game/robot programming in middle school, or at home.

Here are some things this OS really needs:
Linux Distro that boots into Craft OS: raspbian linux can be configured to boot into an app. and here is another useful link
Upscaled CraftOS screen to fit fullscreen resolution: We don't want a screen inside of a screen, no one does.
Integrated Lua Language Compliler (used by CC Community)
Integrated Processing/C Language Compiler (used by Arduino Community)
Wifi and Bluetooth APIs for Craft OS

I would like to help in any way possible. I would be more than happy to test a Linux-Craft Distro on my Raspberry PI computer if you ever need a tester. Thanks for reading!
Creator #30
Posted 11 June 2015 - 09:14 PM
Hi,
What if a stand alone Craft OS could run on a tiny, cheap computer? I think you could take this concept one step further, by making an OS that can be used to program open source electronics, and run on single board computers.

I am fascinated by open source electronics. I found out about computercraft from trying to create tetris on an Arduino. I realized that Craft OS and Lua, are great places to start game programming. The Lua apps found in this forum, are the best beginner examples of code anywhere on the web! I think computercraft doesn't fully realize what has been happening here: minecraft has accidentally spawned the best way for beginners to learn computer programming, hands down.

I have been following open source hardware for a long time. Just 2 years ago, there were many less options out there, with Arudino and Raspberry PI being the the front-runners for making robots. Now, many cheap development boards have wifi; Recently, a $9 computer made a big splash on kickstarter! That's right, for $9 you get a linux capable board, with wifi and bluetooth! It also comes with a composite out for direct connection to a TV or monitor. Now if you were to add a 5" car LCD, battery, and a bluetooth keyboard, you would be well on tour way to building an real-world Craft OS Computer! And it could all be done for under $50. That will be impossible until 2016 though. In the meantime, you could instead, develop the distro for a RPI A+ board; which at $21, it is currently the worlds cheapest, modern, computer.

This project would get a whole lot of attention, if it was compatible with the "maker movement". It could send lua scripts to a development board, or to any computer running the Linux-Craft OS. Already, many wifi boards are using wifi as the main way to receive new programs, instead of a USB serial port. This would get attention from many websites, especially Hackaday.com. I can really see this being the best educational computer ever made. Current educational computers use Scratch, or Basic, as their teaching tools. Linux-Craft OS would be a much better way to learn game/robot programming in middle school, or at home.

Here are some things this OS really needs:
Linux Distro that boots into Craft OS: raspbian linux can be configured to boot into an app. and here is another useful link
Upscaled CraftOS screen to fit fullscreen resolution: We don't want a screen inside of a screen, no one does.
Integrated Lua Language Compliler (used by CC Community)
Integrated Processing/C Language Compiler (used by Arduino Community)
Wifi and Bluetooth APIs for Craft OS

I would like to help in any way possible. I would be more than happy to test a Linux-Craft Distro on my Raspberry PI computer if you ever need a tester. Thanks for reading!

This post made me feel so proud. And I was so proud of the community and Dan.

You get a special gift a 1:1 = posts:upvotes ratio.
DannySMc #31
Posted 11 June 2015 - 10:44 PM
- snip -

If I am uncorrected the idea for to teach younger kids to program? Well with the educational version? Both my parents are head teachers and they use the mod to teach kids to program…
Anfred #32
Posted 12 June 2015 - 02:09 AM
2 great reponses in only a few hours! And yes, Dan should be pround. I forgot to thank him in that long post - so thanks Dan! And thanks to everyone who has contributed to make CraftOS what it is.

Yes, a linux distro would be almost the same as what we currently have. Although, it would be it's own machine, proud and independent. It would mean that CC is a true platform, instead an add-on mod, to be taken seriously as an OS. The sky would be the limit! Linux fans would hop on board, and the community would grow.

Also, I have a 3D printer, if anyone would like to build a real world portable "linux-craft-top" please let me know. I can print a case for it.
Edited on 12 June 2015 - 01:55 PM
KeeganDeathman #33
Posted 20 June 2015 - 06:31 AM
Look what I started.
Looks like it time to learn how to make a Linux distro
syfygirl #34
Posted 21 June 2015 - 01:09 PM
Look what I started.
Looks like it time to learn how to make a Linux distro

You could use Ubuntu base as Ubuntu has great compatibility with most hardware.
ardera #35
Posted 21 June 2015 - 09:09 PM
You could use Ubuntu base as Ubuntu has great compatibility with most hardware.
nah, ubuntu isn't that lightweight. 700mb OS for a CraftOS shell?
raspbian would be better
Creator #36
Posted 21 June 2015 - 09:47 PM
Here is what we need:
- Memory management
- HDD/SSD drivers
- monitor drivers
- compatability with real peripherals
- lua to machine code compiler
FUNCTION MAN! #37
Posted 21 June 2015 - 10:16 PM
You could use Ubuntu base as Ubuntu has great compatibility with most hardware.
nah, ubuntu isn't that lightweight. 700mb OS for a CraftOS shell?
raspbian would be better

Dud.
Arch Linux.
70mb for the archiso.
Alice #38
Posted 22 June 2015 - 03:10 AM
Install Arch Linux with just the 'base' packages. That'll provide you with -nothing- except for a package manager. Not even Wi-Fi support. Good luck running wpa_supplicant (I kinda forgot about that for this install x3)
KeeganDeathman #39
Posted 22 June 2015 - 03:25 AM
I was gonna use Ubuntu since I'm putting it on my computer, but follow Linux from scratch.
Saves on size.
I'll make a github if I can
クデル #40
Posted 22 June 2015 - 03:32 AM
You could use Ubuntu base as Ubuntu has great compatibility with most hardware.
nah, ubuntu isn't that lightweight. 700mb OS for a CraftOS shell?
raspbian would be better

Isn't raspbian specific to Raspberry Pi's / ARM processors?
jerimo #41
Posted 22 June 2015 - 04:25 AM
Tiny core is about 15mb just saying
Alice #42
Posted 22 June 2015 - 04:50 AM
True, but I'd rather use something if it were based off of Arch instead of an OS that's so small it's 15 MB. Something about having Arch being larger but still compact and bare when starting.
jerimo #43
Posted 22 June 2015 - 02:40 PM
True, but I'd rather use something if it were based off of Arch instead of an OS that's so small it's 15 MB. Something about having Arch being larger but still compact and bare when starting.
Likely a good idea, arch was made to be small enough to be able to bring life back into the good old.machines you got with Windows 93 preinstalled and the such. Still quite powerful though considering
ardera #44
Posted 22 June 2015 - 05:39 PM
Running something like OneOS would certainly be very cool, I'm not doubting that. But ComputerCraft just has so many limitations such as the tiny colour palette and massive pixels/character based.
That's right, although this version may be only used for educational uses.
Maybe we shouldn't make it compatible with ComputerCraft. What I mean is, that maybe the idea of a system using Lua instead of C(++) is better than using ComputerCraft with it's limitations instead of C(++). This system wouldn't be compatible with CC then, but it would enable stuff like a full RGB color palette, better http, pixels (bigger than the pixels the display features, not only because of performance), a native GUI library (coded in C, because it'd be slow in Lua)
LDDestroier #45
Posted 22 June 2015 - 06:16 PM
An idea for rednet/modem implementation is to automatically seek for other CraftOS-Linux running machines, and have rednet/modem messages run over wifi/bluetooth. Hell, it could use actual gps servers for a sort of fake coordinate system rather than longitude/latitude.
FUNCTION MAN! #46
Posted 23 June 2015 - 01:12 AM
Install Arch Linux with just the 'base' packages. That'll provide you with -nothing- except for a package manager. Not even Wi-Fi support. Good luck running wpa_supplicant (I kinda forgot about that for this install x3)

Alissa, plis. base and base-devel.
plis.
p l i s.
Alice #47
Posted 23 June 2015 - 06:18 AM
Install Arch Linux with just the 'base' packages. That'll provide you with -nothing- except for a package manager. Not even Wi-Fi support. Good luck running wpa_supplicant (I kinda forgot about that for this install x3)

Alissa, plis. base and base-devel.
plis.
p l i s.

Nah.
クデル #48
Posted 23 June 2015 - 08:12 AM
An idea for rednet/modem implementation is to automatically seek for other CraftOS-Linux running machines, and have rednet/modem messages run over wifi/bluetooth. Hell, it could use actual gps servers for a sort of fake coordinate system rather than longitude/latitude.

Sending messages to other machines over the same network, or even the networking converting IP address to WAN and LAN ID's would be awesome.
Alice #49
Posted 23 June 2015 - 10:50 AM
An idea for rednet/modem implementation is to automatically seek for other CraftOS-Linux running machines, and have rednet/modem messages run over wifi/bluetooth. Hell, it could use actual gps servers for a sort of fake coordinate system rather than longitude/latitude.

Sending messages to other machines over the same network, or even the networking converting IP address to WAN and LAN ID's would be awesome.
Lua by default uses integers (LuaJ doesn't. Uses floats. What a shame). An integer is a 4-byte sequence of bits, which also happens to be the same size as an IPv6 address. This means that in raw Lua, we could have computer networks using IPv4/v6 local addresses that go up to the maximum size of an integer. This could actually work.
ardera #50
Posted 23 June 2015 - 03:58 PM
Lua by default uses integers (LuaJ doesn't. Uses floats. What a shame). An integer is a 4-byte sequence of bits, which also happens to be the same size as an IPv6 address. This means that in raw Lua, we could have computer networks using IPv4/v6 local addresses that go up to the maximum size of an integer. This could actually work.
IPv6 adresses are bigger than 4 bytes. IPv4 adresses are exactly 4 bytes: the maximal adress is: 255.255.255.255 (notice 255 is the max value of one byte)
But that doesn't matter as you can also use IPv4/6 adresses without 4/8byte sized integers.
Also LuaJ uses 8byte sized doubles, using a 52bit mantissa -> even more storage possible than with Lua's integers (32bits). With a smart system, you can get the full 64bits of information out of a double.
Edited on 23 June 2015 - 02:23 PM
Alice #51
Posted 23 June 2015 - 08:47 PM
Lua by default uses integers (LuaJ doesn't. Uses floats. What a shame). An integer is a 4-byte sequence of bits, which also happens to be the same size as an IPv6 address. This means that in raw Lua, we could have computer networks using IPv4/v6 local addresses that go up to the maximum size of an integer. This could actually work.
IPv6 adresses are bigger than 4 bytes. IPv4 adresses are exactly 4 bytes: the maximal adress is: 255.255.255.255 (notice 255 is the max value of one byte)
But that doesn't matter as you can also use IPv4/6 adresses without 4/8byte sized integers.
Also LuaJ uses 8byte sized doubles, using a 52bit mantissa -> even more storage possible than with Lua's integers (32bits). With a smart system, you can get the full 64bits of information out of a double.

I suppose that's true, Google has this glorious technique of thinking me typing "IPv6" meant "IPv4." Anyways, we'd have to modify Lua to use doubles instead of integers. Probably not too hard?
ardera #52
Posted 23 June 2015 - 09:27 PM
I suppose that's true, Google has this glorious technique of thinking me typing "IPv6" meant "IPv4." Anyways, we'd have to modify Lua to use doubles instead of integers. Probably not too hard?
Theres no need to do that, the size of a number has nothing really to do with which IP version you can use. It just doesn't care.
Alice #53
Posted 23 June 2015 - 09:34 PM
So, off of the topic of networking, what I believe would also be a neat idea, is that if we could implement this all via pollable file descriptors. Most actual desktop environments redraw to the screen tens of times per second, and that's gonna really be a CPU waster IMO. With pollable file descriptors on a system and a neat backend library, we can have this set up much more efficiently. (also, a DE would totally ruin the CC feel?!?)
Creator #54
Posted 23 June 2015 - 09:36 PM
So, off of the topic of networking, what I believe would also be a neat idea, is that if we could implement this all via pollable file descriptors. Most actual desktop environments redraw to the screen tens of times per second, and that's gonna really be a CPU waster IMO. With pollable file descriptors on a system and a neat backend library, we can have this set up much more efficiently. (also, a DE would totally ruin the CC feel?!?)

Why dod they draw the screen so often? Can't they wait for events?

Do other programming languages work with events? Because I really like Lua for this.
FUNCTION MAN! #55
Posted 23 June 2015 - 10:28 PM
Lua does not work with events. Only CC lua does.

And no, they can't wait for events.
Because an "event" in a working linux system is like, hundreds of times per second.

Lua by default uses integers (LuaJ doesn't. Uses floats. What a shame). An integer is a 4-byte sequence of bits, which also happens to be the same size as an IPv6 address. This means that in raw Lua, we could have computer networks using IPv4/v6 local addresses that go up to the maximum size of an integer. This could actually work.
IPv6 adresses are bigger than 4 bytes. IPv4 adresses are exactly 4 bytes: the maximal adress is: 255.255.255.255 (notice 255 is the max value of one byte)
But that doesn't matter as you can also use IPv4/6 adresses without 4/8byte sized integers.
Also LuaJ uses 8byte sized doubles, using a 52bit mantissa -> even more storage possible than with Lua's integers (32bits). With a smart system, you can get the full 64bits of information out of a double.

I suppose that's true, Google has this glorious technique of thinking me typing "IPv6" meant "IPv4." Anyways, we'd have to modify Lua to use doubles instead of integers. Probably not too hard?

Nope. Not hard at all.
ardera #56
Posted 23 June 2015 - 10:38 PM
In my opinion, we should just build an application that emulates ComputerCraft but implements some lower level stuff like TCP connections, allows to draw pixels, etc,
and modify raspbian/archlinux/ubuntu (whatever you want) to boot in this application. It's way to complicated to make a new linux distro.
Edited on 23 June 2015 - 08:38 PM
Alice #57
Posted 24 June 2015 - 12:42 AM
"allows to draw pixels" is kinda stretching a bit too far.
Also, we can make packages for the distro. Arch has the AUR, so we can make a PKGBUILD from that.
Which also means we would need a Git repo to use. Would I set this up later or would you like to get started on this?

Oh, another note, I planned on implementing the API in a library called 'cqueues', it works great with file-descriptor based events and I've actually been thinking about making a CC wrapper for quite a while now! ^_^/>
This also means: SOCKETS AND MULTITHREADING WHOOO
Edited on 23 June 2015 - 10:44 PM
oeed #58
Posted 24 June 2015 - 12:49 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..
Alice #59
Posted 24 June 2015 - 12:55 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..

And what would we use to draw pixels on a screen?
If we're doing this in a terminal application, terminals don't support drawing of custom characters.
We would have to almost make an X server type thing for it.
FUNCTION MAN! #60
Posted 24 June 2015 - 01:14 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..

And what would we use to draw pixels on a screen?
If we're doing this in a terminal application, terminals don't support drawing of custom characters.
We would have to almost make an X server type thing for it.
Meh.
Not _too_ hard.
Alice #61
Posted 24 June 2015 - 01:16 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..

And what would we use to draw pixels on a screen?
If we're doing this in a terminal application, terminals don't support drawing of custom characters.
We would have to almost make an X server type thing for it.
Meh.
Not _too_ hard.
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.
FUNCTION MAN! #62
Posted 24 June 2015 - 01:19 AM
In my opinion, we should just build an application that emulates ComputerCraft but implements some lower level stuff like TCP connections, allows to draw pixels, etc,
and modify raspbian/archlinux/ubuntu (whatever you want) to boot in this application. It's way to complicated to make a new linux distro.

It's just a matter of writing a couple Makefiles.
Alice #63
Posted 24 June 2015 - 01:20 AM
In my opinion, we should just build an application that emulates ComputerCraft but implements some lower level stuff like TCP connections, allows to draw pixels, etc,
and modify raspbian/archlinux/ubuntu (whatever you want) to boot in this application. It's way to complicated to make a new linux distro.

It's just a matter of writing a couple Makefiles.
PKGBUILDs too.
Arch, m8.
FUNCTION MAN! #64
Posted 24 June 2015 - 01:21 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..

And what would we use to draw pixels on a screen?
If we're doing this in a terminal application, terminals don't support drawing of custom characters.
We would have to almost make an X server type thing for it.
Meh.
Not _too_ hard.
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.

The code itself is not complicated. The problem, really, is allocating time for it. I'll have about a month of free time from July the 6th to the 31st (I think). So I'll start then.

In my opinion, we should just build an application that emulates ComputerCraft but implements some lower level stuff like TCP connections, allows to draw pixels, etc,
and modify raspbian/archlinux/ubuntu (whatever you want) to boot in this application. It's way to complicated to make a new linux distro.

It's just a matter of writing a couple Makefiles.
PKGBUILDs too.
Arch, m8.
m8 good luck getting pkgbuilds in LFS

I meant to quote this: "It's way to complicated to make a new linux distro."

Plus, m8, makefiles are way better.

EDIT: Give me a name for this project and I'll go ahead and make a GH repo
Edited on 23 June 2015 - 11:22 PM
Alice #65
Posted 24 June 2015 - 01:24 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..

And what would we use to draw pixels on a screen?
If we're doing this in a terminal application, terminals don't support drawing of custom characters.
We would have to almost make an X server type thing for it.
Meh.
Not _too_ hard.
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.

The code itself is not complicated. The problem, really, is allocating time for it. I'll have about a month of free time from July the 6th to the 31st (I think). So I'll start then.

In my opinion, we should just build an application that emulates ComputerCraft but implements some lower level stuff like TCP connections, allows to draw pixels, etc,
and modify raspbian/archlinux/ubuntu (whatever you want) to boot in this application. It's way to complicated to make a new linux distro.

It's just a matter of writing a couple Makefiles.
PKGBUILDs too.
Arch, m8.
m8 good luck getting pkgbuilds in LFS

I meant to quote this: "It's way to complicated to make a new linux distro."

Plus, m8, makefiles are way better.

EDIT: Give me a name for this project and I'll go ahead and make a GH repo
I think not. I'd rather do it my own way. Honestly? Linux from Scratch? No.
I'm gonna set up a new GitHub repo once I got the VM set up, then I'll post my repo. You can do whatever you feel like.

This was to make "Standalone CC OSes." Not OSes programmed off of ComputerCraft code.
Edited on 23 June 2015 - 11:29 PM
FUNCTION MAN! #66
Posted 24 June 2015 - 01:30 AM
"allows to draw pixels" is kinda stretching a bit too far.

Given that ComputerCraft will be getting that feature, I don't see why not..

And what would we use to draw pixels on a screen?
If we're doing this in a terminal application, terminals don't support drawing of custom characters.
We would have to almost make an X server type thing for it.
Meh.
Not _too_ hard.
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.

The code itself is not complicated. The problem, really, is allocating time for it. I'll have about a month of free time from July the 6th to the 31st (I think). So I'll start then.

In my opinion, we should just build an application that emulates ComputerCraft but implements some lower level stuff like TCP connections, allows to draw pixels, etc,
and modify raspbian/archlinux/ubuntu (whatever you want) to boot in this application. It's way to complicated to make a new linux distro.

It's just a matter of writing a couple Makefiles.
PKGBUILDs too.
Arch, m8.
m8 good luck getting pkgbuilds in LFS

I meant to quote this: "It's way to complicated to make a new linux distro."

Plus, m8, makefiles are way better.

EDIT: Give me a name for this project and I'll go ahead and make a GH repo
I think not. I'd rather do it my own way. Honestly? Linux from Scratch? No.
I'm gonna set up a new GitHub repo once I got the VM set up, then I'll post my repo. You can do whatever you feel like.

Why are you even making a linux distro and not something that's innovative?

-snip-
This was to make "Standalone CC OSes." Not OSes programmed off of ComputerCraft code.


u wot m8? I can read the title. I can understand it. I'm not proposing OSes programmed off of computercraft code, whatever the F that means
Edited on 23 June 2015 - 11:29 PM
oeed #67
Posted 24 June 2015 - 01:40 AM
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.

Chill.

Time will tell of course, but there's no use it making an emulator of ComputerCraft in any form if it doesn't accurately simulate ComputerCraft. So having full pixels is basically a must if it does get added, which seems increasingly likely.
Edited on 23 June 2015 - 11:42 PM
FUNCTION MAN! #68
Posted 24 June 2015 - 02:01 AM
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.

Chill.

Time will tell of course, but there's no use it making an emulator of ComputerCraft in any form if it doesn't accurately simulate ComputerCraft. So having full pixels is basically a must if it does get added, which seems increasingly likely.

I'm planning to implement this in a freestanding, non-linux operating system. It'll be hard, sure, but once I get drivers for things (I plan to make this for the raspi, so the hardware is pretty standard), implementing Lua and the CC libraries (including pixel rendering) will be MUCH easier.
Bomb Bloke #69
Posted 24 June 2015 - 02:05 AM
So having full pixels is basically a must if it does get added, which seems increasingly unlikely.

Fixed that for you. :)/>
Alice #70
Posted 24 June 2015 - 02:17 AM
Oh really now? Then why don't you go ahead and draft something up.
I'll get to work on setting up a VM for testing and writing code. You have one week, if it's not too hard.

Chill.

Time will tell of course, but there's no use it making an emulator of ComputerCraft in any form if it doesn't accurately simulate ComputerCraft. So having full pixels is basically a must if it does get added, which seems increasingly likely.

I'm planning to implement this in a freestanding, non-linux operating system. It'll be hard, sure, but once I get drivers for things (I plan to make this for the raspi, so the hardware is pretty standard), implementing Lua and the CC libraries (including pixel rendering) will be MUCH easier.
Who said it had to be OS specific?
The PKGBUILD is simply a script to build it from source.
This is going to be a POSIX / ncurses compatible port that I am writing for Lua ComputerCraft.
ardera #71
Posted 24 June 2015 - 05:11 AM
Multithreading would be nice, although Lua is not made for it
love2d lets you make other threads, but only lets you receive/send values (not references!) from/to them.
oeed #72
Posted 24 June 2015 - 06:52 AM
I plan to make this for the raspi, so the hardware is pretty standard

That's quite a good idea really. It'd probably make it a whole lot easier to develop, and I'd imagine lots of people here have one. Heck, if you don't they're only thirtyish dollars.
Edited on 24 June 2015 - 04:53 AM
FUNCTION MAN! #73
Posted 24 June 2015 - 03:37 PM
Exactly! The raspi is an ARM computer with easy to program hardware.

Plus, with GPIO, we can get a redstone equivalent.
Alice #74
Posted 24 June 2015 - 07:42 PM
but… why not just make a program to run ComputerCraft in a terminal, then allow for an optional Raspberry Pi interface?
FUNCTION MAN! #75
Posted 24 June 2015 - 09:23 PM
but… why not just make a program to run ComputerCraft in a terminal, then allow for an optional Raspberry Pi interface?

Because running in a terminal excludes the ability to have pixel rendering
oeed #76
Posted 24 June 2015 - 10:51 PM
but… why not just make a program to run ComputerCraft in a terminal, then allow for an optional Raspberry Pi interface?

Because running in a terminal excludes the ability to have pixel rendering

Which means it won't use the CC font.

Also, although I could very well be wrong, possibly not mouse interaction.
Anfred #77
Posted 25 June 2015 - 08:00 PM
I you have a raspberry pi, try this!
Making a custom Raspbian Distro is easier than you may think. Installing Love2D and changing the RPI config file to run cclite emulator at startup is the only addition to this tutorial, in order to run craftOS at boot. You may also want to change the cclite config file to run full screen. Here is the full tutorial in just a few paragraphs:

the New Out Of the Box Software, or NOOBS is the Raspberry Pi’s official installer. It has simplified and standardised the procedure for installing a distro on the Raspberry Pi. While the main purpose of NOOBS is to simplify the installation of an operating system on to the Pi, the tool can also be used to create a custom distro.
To get started, grab the NOOBS installer from the website and install any of the supported distributions that you want to customise. We’d advise you to use the Raspbian distribution, which is also recommended by the NOOBS installer.


After you’ve installed Raspbian, boot the distro and make whatever changes you want. You can change the default wallpaper and also switch themes by running the obconf command from the command line, and you can install additional themes with:
sudo apt-get install openbox-themes


You can also install and remove apps either directly via apt-get or by first installing the graphicalSynaptic package manager.
You can copy over any files into this Raspbian installation. NOOBS lets you create a 512MB partition that you can use to store files. Or, you can use the
raspi-config
command to expand the root partition to fill the SD card. Also make sure you set up the distro to work with your network hardware straight out of the box. So for example, you can configure the wireless adapter to connect to your Wi-Fi access point and access network services such as the directory server, or change the default browser page to point to your intranet landing page.

When you’re done setting up the distro, it’s time to package it into an archive. Change to the root directory with cd / and enter the following command:
sudo tar -cvpf root.tar /bin /boot /cdrom /dev /etc /home /initrd.img /initrd.img.old /lib /lib64 /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old –exclude=proc/* –exclude=sys/* –exclude=dev/pts/*
This command can take up to half an hour to complete depending on the number of changes you’ve made to Raspbian.
When it’s done, you’ll have a file called root.tar in the root directory. Similarly now roll up the boot files. First, move into the boot directory with
cd /boot
and then create the archive with the
tar -cvpf boot.tar
command. This will not take much time, and when it’s done you’ll have a file called boot.tar in theboot directory.
NOOBS requires compressed versions of these files. But the Raspberry Pi doesn’t have the resources to squeeze these files. So you’ll have to move them out to a regular desktop PC where you can compress them with the xz -9 -e boot.tar and xz -9 -e root.tar commands. This will replace the files with their compressed versions, namely boot.tar.xz and root.tar.xz.


Now format the SD card and extract a fresh copy of NOOBS into it. Use the file manager to navigate to the os directory under the newly extracted files. This directory further contains a number of directories, each of which containing the files for a supported distro including Arch, Pidora, Raspbian and others. Since our custom distro is based on Raspbian, we can remove all the other directories from under the os folder. Rename the Raspbian folder to the name for your custom distribution.
Head inside this folder and open the file named os.json in a text editor. In the file, replace the text beside the name and description fields from that of the original Raspbian distribution to your custom one. Also, make sure you remove the file named flavours.json. You can also optionally change the artwork of the distribution.


Finally, remove the existing root.tar.xz and boot.tar.xz files from under this folder and replace them with the ones you’ve just created. That’s it! Now boot the Pi with this card. The NOOBS menu will now list your unique, customised Linux distro.
Edited on 25 June 2015 - 06:06 PM
KeeganDeathman #78
Posted 26 June 2015 - 07:25 AM
Hey guys I am currently working on an LFS for this.
My stepdad suggested MicroCraft Portals, a play on Minecraft and Microsoft Windows, ha ha.
It seems this thread spawned three OSes.
I was planning on making it run the advanced computer CraftOS by default, and then you can just pastebin in your favorite OS.
?
Anfred #79
Posted 28 June 2015 - 06:15 PM
Great! Please keep us posted on the progress. Are you building for x86 PCs or raspberry pi -ARM?
I still think a CCOS would be a great tool for STEM teachers and beginner coders.
クデル #80
Posted 29 June 2015 - 12:59 AM
I you have a raspberry pi, try this!
Making a custom Raspbian Distro is easier than you may think. Installing Love2D and changing the RPI config file to run cclite emulator at startup is the only addition to this tutorial, in order to run craftOS at boot. You may also want to change the cclite config file to run full screen. Here is the full tutorial in just a few paragraphs:

the New Out Of the Box Software, or NOOBS is the Raspberry Pi’s official installer. It has simplified and standardised the procedure for installing a distro on the Raspberry Pi. While the main purpose of NOOBS is to simplify the installation of an operating system on to the Pi, the tool can also be used to create a custom distro.
To get started, grab the NOOBS installer from the website and install any of the supported distributions that you want to customise. We’d advise you to use the Raspbian distribution, which is also recommended by the NOOBS installer.


After you’ve installed Raspbian, boot the distro and make whatever changes you want. You can change the default wallpaper and also switch themes by running the obconf command from the command line, and you can install additional themes with:
sudo apt-get install openbox-themes


You can also install and remove apps either directly via apt-get or by first installing the graphicalSynaptic package manager.
You can copy over any files into this Raspbian installation. NOOBS lets you create a 512MB partition that you can use to store files. Or, you can use the
raspi-config
command to expand the root partition to fill the SD card. Also make sure you set up the distro to work with your network hardware straight out of the box. So for example, you can configure the wireless adapter to connect to your Wi-Fi access point and access network services such as the directory server, or change the default browser page to point to your intranet landing page.

When you’re done setting up the distro, it’s time to package it into an archive. Change to the root directory with cd / and enter the following command:
sudo tar -cvpf root.tar /bin /boot /cdrom /dev /etc /home /initrd.img /initrd.img.old /lib /lib64 /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old –exclude=proc/* –exclude=sys/* –exclude=dev/pts/*
This command can take up to half an hour to complete depending on the number of changes you’ve made to Raspbian.
When it’s done, you’ll have a file called root.tar in the root directory. Similarly now roll up the boot files. First, move into the boot directory with
cd /boot
and then create the archive with the
tar -cvpf boot.tar
command. This will not take much time, and when it’s done you’ll have a file called boot.tar in theboot directory.
NOOBS requires compressed versions of these files. But the Raspberry Pi doesn’t have the resources to squeeze these files. So you’ll have to move them out to a regular desktop PC where you can compress them with the xz -9 -e boot.tar and xz -9 -e root.tar commands. This will replace the files with their compressed versions, namely boot.tar.xz and root.tar.xz.


Now format the SD card and extract a fresh copy of NOOBS into it. Use the file manager to navigate to the os directory under the newly extracted files. This directory further contains a number of directories, each of which containing the files for a supported distro including Arch, Pidora, Raspbian and others. Since our custom distro is based on Raspbian, we can remove all the other directories from under the os folder. Rename the Raspbian folder to the name for your custom distribution.
Head inside this folder and open the file named os.json in a text editor. In the file, replace the text beside the name and description fields from that of the original Raspbian distribution to your custom one. Also, make sure you remove the file named flavours.json. You can also optionally change the artwork of the distribution.


Finally, remove the existing root.tar.xz and boot.tar.xz files from under this folder and replace them with the ones you’ve just created. That’s it! Now boot the Pi with this card. The NOOBS menu will now list your unique, customised Linux distro.

Will video allocation cause lag? I only have 16mb allocated iirc.
Anfred #81
Posted 29 June 2015 - 06:48 AM
I have a RASPBERRY PI running raspbian at 1080p with slight lag. Not too sure, but 64mb would be better than 16, if possible.
KeeganDeathman #82
Posted 29 June 2015 - 07:22 AM
Great! Please keep us posted on the progress. Are you building for x86 PCs or raspberry pi -ARM?
I still think a CCOS would be a great tool for STEM teachers and beginner coders.
Will do! Setting up temp tools currently, so no real need for a github yet I do believe.
I feel the same way about the STEM, and I am not too sure on pi but it should work on both 32 and 64 bit pcs.