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

cMinix (inode-block-filesystem)

Started by Piorjade, 04 February 2017 - 10:41 PM
Piorjade #1
Posted 04 February 2017 - 11:41 PM
cMinix filesystem - inodes and blocks


What this is about:
SpoilerThis is actually forked from the cVM experimental branch as it actually worked quite well in the VMs
so I thought I might just try to make it as an extra project :)/>

This still uses the VM system so this program creates and runs virtual "hard drives" (files) and then you can use them to initiate the filesystem.
It works quite well as it is but there are problems I currently don't know how they occur…


Problems:
Spoiler
  • I tried using CraftOS and cLinux in 2 different ways:
    • CraftOS:
      • set up the filesystem, return to CraftOS; problem:
        • it returns and doesn't read keyboard input, leaving a blinking cursor.
        • after a short time it prints out an error telling you that CC couldn't resume bios.lua and then the computer crashes
    • cLinux:
      • set up the filesystem, copy the whole cLinux from a real folder completely over to the virtual hard drive, boot the virtual startup (GRUB) file; problem:
        • the startup seems to completely work, it loads the APIs up and prompts you to the login screen. logging in DOES work but after that it doesn't read keyboard input and leaves you a blinking cursor. nothing seemed to happen after that

If you find a fix for any of these problems, please tell me.
If you need help switching between those two methods (returning to craftos, booting virtual clinux), ask me

FYI, I made a "cmd" function in the code, which reads input and has the "ls" command, which actually DOES work. (it's a while loop)

Code:
GitHub

To download:
Download the zip from GitHub, it's not worth to make a pastebin as it's not "usable" for "normal" users. (except if you just want to make a new os from scratch with this filesystem.)

INFO:
As it's using a "virtual harddrive", you practically CANNOT use an external editor to do stuff. (Well you CAN, but it's so retarded to do so as the files are serialized and you would have to manage the inodes and blocks manually, which isn't that easy over time)

INFO 2:
Yeah inserting a bios 'n stuff from cVM is still implemented, didn't have the time to delete these.
You can insert a bios, but it's useless.
I'm still thinking if I should implement that as a kinda "invisible startup file" tho….
Edited on 10 February 2017 - 06:39 AM
Piorjade #2
Posted 10 February 2017 - 07:40 AM
Looks like I forgot to link the GitHub page…

*facepalm*
Piorjade #3
Posted 10 February 2017 - 10:49 AM
MAJOR UPDATE:
  • Fixed some bugs
  • Removed unused lines
  • Fixed cLinux:
    • The cause for getting stuck was shell.complete, which was used in the read function in the commandline
    • I disabled the completion so now it basically works
    • But when I tested luaide:
      • it got stuck after entering a path for a new file and after a while prints out a Java VM error, leading to having the whole CC computer being frozen (CCEmuRedux; luaide was the only program I tested (I also tested rm, mkdir, cd but they don't count :P/>) )
  • This basically means I currently have no clue how to return to CraftOS and also I would have to copy the whole rom folder in the HD, which I tried and it crashed
  • There are 2 new options for the program:
    • edit the file at the very top:
      • debug = enables debug messages (e.g. prints out every call of _fs.findInode)
      • Debug also copies every file from /cLinux/ over to the HD!!
      • customOS = instead of running /startup, located in the HD, it runs the cmd function located down below
(this program needs a minimally edited version of the commandline for cLinux, which has completion disabled)
NOTE:
The testhd file has cLinux preinstalled, so you may try it out
Edited on 10 February 2017 - 09:54 AM