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

Leadlined-Kernel: A Mostly Experimental Kernel

Started by KillaVanilla, 01 November 2013 - 06:24 PM
KillaVanilla #1
Posted 01 November 2013 - 07:24 PM
LeadLined-Kernel (aka LeadLined-OS) is a system that is designed to do what an actual OS kernel does: Do stuff for the programmer.

It's heavy on the internals, with several different kernel modules extending the various APIs that you would find in a "vanilla" system.

Four of these kernel modules make up the majority of this functionality:
Spoiler
  • FSOverride - Short for filesystem override; its most significant features are support for symbolic links and union points, as well as providing support for special file systems and user-based permissions (in conjunction with UserAuth).
  • ParallelRunner - LeadLined-Kernel's multitasking manager. In addition to handling program execution, this module also provides facilities for inter-process communication, from I/O piping to semaphores to Plan 9's rendezvous() syscall. Also (attempts) to provide per-process environment sandboxing.
  • Periscope - Handles peripherals and the drivers that interface with them. Also provides the infrastructure necessary to maintain the /dev/ file system. Theoretically also supports virtual peripherals, though this is not tested.
  • UserAuth - Handles user authentication and secret-keeping. Also provides a way to add more methods of authentiating to the computer.

There is also a default shell, simply called "/bin/shell" that should be used to access LeadLined-Kernel's functionality. It includes a number of programs and functions "built-in" (for some odd reason).

The kernel should run most CraftOS programs without problems. If a particular program that you wrote for CraftOS doesn't work in LeadLined-Kernel, then post it here and I'll try to track down the cause, and possibly see if I can fix it. However, keep in mind that adding functionality is of a higher priority than maintaining compatibility.

If there are any applications that you would like to see for LeadLined-Kernel, please leave a message and get to it ASAP.

Github Repository (Tatantyler/LeadLined-OS)

Installer (Pastebin Code: 38a56FiF)
Edited on 05 January 2014 - 05:04 PM
sens #2
Posted 01 November 2013 - 08:05 PM
Looking forward to seeing the IPC in action, I've found that capability is missing from many of the others.

I'm curious, though - what is a "virtual peripheral"?
LDShadowLord #3
Posted 01 November 2013 - 08:12 PM
Bug report:
Could not concatenate string and nil. I encounter the error whenever I try to log in.Image showing error. I CANNOT get round this error, as such it is physically impossible to do anything on the computer after logging in.

EDIT: Updated conditions of error after further testing.

EDIT2:
Bug Report 2:
After logging in it prints a table to the screen. Cutting across the GUI. Image showing bug.
KillaVanilla #4
Posted 01 November 2013 - 09:38 PM
Bug report:
Could not concatenate string and nil. I encounter the error whenever I try to log in.Image showing error. I CANNOT get round this error, as such it is physically impossible to do anything on the computer after logging in.

EDIT: Updated conditions of error after further testing.

EDIT2:
Bug Report 2:
After logging in it prints a table to the screen. Cutting across the GUI. Image showing bug.

Bug report 1: Is there a line number or such reported? note to self: look at images, they can help you.
Found what causes this bug; apparently, os.computerLabel() can return nil.

Bug report 2: I've actually seen that bug myself. I can't find it. At all.
Found it! Turns out, it was in sys/apis/GUIFunctions, of all things…
You should reinstall.
MudkipTheEpic #5
Posted 01 November 2013 - 09:42 PM
You hooked me at fsOverride…

Any APIs for terminal/monitor mirroring/extra features?

This looks pretty cool. The forums need more dev utility "OSes."
KillaVanilla #6
Posted 01 November 2013 - 09:57 PM
Looking forward to seeing the IPC in action, I've found that capability is missing from many of the others.

I'm curious, though - what is a "virtual peripheral"?
I'm actually working on another form of IPC right now; input/output stream redirection.

I'm looking for ideas for applications that could take advantage of the kernel's functionality.

"Virtual peripherals" are supposed to be peripherals that call API functions or other code instead of calling Java code.
For example, you could have a virtual modem that transmits messages over a "higher-level" network instead of transmitting messages directly. This is what the crf_bridge driver is supposed to do, once it actually works.

You hooked me at fsOverride…

Any APIs for terminal/monitor mirroring/extra features?

This looks pretty cool. The forums need more dev utility "OSes."

Not yet. There was a system in the works to allow for a sort of screen multiplexing; you'll find it as "unused/screenHandler". I scrapped it because it simply didn't work and I wanted a mostly-working release ready.
Wobbo #7
Posted 02 November 2013 - 05:43 AM
This is looking good! I am interested in seeing where you are going to take this.
IO redirection is something I wanted in an OS, are you going to make it work like UNIX pipes? So multiple commands in one line? Or API calls?

I did find some bugs however. Whenever I log in on a Advanced computer, the windows for logging in don't line up. This is not really a bug, but it does look weird.

Secondly, whenever I try to see what is in sys/filePerm, I get a bin/shell:526: attempt to get length of nil
I can cd into /sys/filePerm however. I should note that I am not logged in as root.
When I do log in as root, it just works.

When I am in the directory sys and want to look at apis(for example) I get a Not a directory error. When I type ls /sys/apis, it does work.

Also, if you try to shutdown the computer using exit, it just hangs.

But it looks really good. I will follow this OS.
KillaVanilla #8
Posted 02 November 2013 - 10:14 AM
This is looking good! I am interested in seeing where you are going to take this.
IO redirection is something I wanted in an OS, are you going to make it work like UNIX pipes? So multiple commands in one line? Or API calls?

I did find some bugs however. Whenever I log in on a Advanced computer, the windows for logging in don't line up. This is not really a bug, but it does look weird.

Secondly, whenever I try to see what is in sys/filePerm, I get a bin/shell:526: attempt to get length of nil
I can cd into /sys/filePerm however. I should note that I am not logged in as root.
When I do log in as root, it just works.

When I am in the directory sys and want to look at apis(for example) I get a Not a directory error. When I type ls /sys/apis, it does work.

Also, if you try to shutdown the computer using exit, it just hangs.

But it looks really good. I will follow this OS.
I/O redirection will work like UNIX pipes.

About using exit: the "exit" function actually just causes the /bin/shell program to exit, it doesn't actually shutdown the computer; this will be changed.
I will look into the other bugs; they're mostly issues with the fs function overrides. Some of them are actually not supposed to be bugs; attempting to look into another user's directory without the read permission for that directory will return what appears to be an empty directory. The fact that the functions return nil instead of an empty table or an error is a bug.
Wobbo #9
Posted 02 November 2013 - 10:40 AM
This is looking good! I am interested in seeing where you are going to take this.
IO redirection is something I wanted in an OS, are you going to make it work like UNIX pipes? So multiple commands in one line? Or API calls?

I did find some bugs however. Whenever I log in on a Advanced computer, the windows for logging in don't line up. This is not really a bug, but it does look weird.

Secondly, whenever I try to see what is in sys/filePerm, I get a bin/shell:526: attempt to get length of nil
I can cd into /sys/filePerm however. I should note that I am not logged in as root.
When I do log in as root, it just works.

When I am in the directory sys and want to look at apis(for example) I get a Not a directory error. When I type ls /sys/apis, it does work.

Also, if you try to shutdown the computer using exit, it just hangs.

But it looks really good. I will follow this OS.
I/O redirection will work like UNIX pipes.

About using exit: the "exit" function actually just causes the /bin/shell program to exit, it doesn't actually shutdown the computer; this will be changed.
I will look into the other bugs; they're mostly issues with the fs function overrides. Some of them are actually not supposed to be bugs; attempting to look into another user's directory without the read permission for that directory will return what appears to be an empty directory. The fact that the functions return nil instead of an empty table or an error is a bug.

Neat. How are you going to redirect the IO? just overwriting read/write to read from/write to files? Or do you have a better approach?

I already guessed it had something to do with permissions. Instead of looking like an empty directory, it might be better to give a warning. Darwin(OS X) gives a Permission Denied error when you try to look into roots home directory for example.
KillaVanilla #10
Posted 02 November 2013 - 11:00 AM
Neat. How are you going to redirect the IO? just overwriting read/write to read from/write to files? Or do you have a better approach?

I already guessed it had something to do with permissions. Instead of looking like an empty directory, it might be better to give a warning. Darwin(OS X) gives a Permission Denied error when you try to look into roots home directory for example.
As for IO redirection: Yeah, we override read() and write(). Right now the supported output/input devices are: "term"/"key" (terminal and keyboard), "file" (guess), "func" (function, like an API call or such), and "pipe".
For the permissions "bugs": I'm changing the functionality to do that as we speak.
lieudusty #11
Posted 02 November 2013 - 12:44 PM
Looks great! :)/>
Wobbo #12
Posted 03 November 2013 - 04:21 AM
Will you also implement io.popen when the redirection works? Then we could have a more complete io API and with the pipes it should be possible.

And how will the function get its input? Using read/write or with its function call or something?

I do ask a lot of questions, but that is because I am hyped to see an OS with actually IO redirection. I have been looking for this, to the point where I was planning my own OS.
Dave-ee Jones #13
Posted 03 November 2013 - 05:02 AM
You hooked me at fsOverride…

Indeed.
KillaVanilla #14
Posted 03 November 2013 - 11:53 AM
Will you also implement io.popen when the redirection works? Then we could have a more complete io API and with the pipes it should be possible.

And how will the function get its input? Using read/write or with its function call or something?

I do ask a lot of questions, but that is because I am hyped to see an OS with actually IO redirection. I have been looking for this, to the point where I was planning my own OS.
For io.popen(): Sure. I'm implementing it right now.

As for your other question: programs/functions will receive input via the read() function, which will return a string as always.

io.popen might take a bit to implement. I'm going to have to extend functionality in parallelRunner and fsOverride.
LDShadowLord #15
Posted 03 November 2013 - 06:37 PM
Error Report:
list causes an error in parallel runner. Bad argument: string expected, got nil. Image of error.

Errory Edit. This happened when I tried to use the command "?" Exact same error on the same line.
KillaVanilla #16
Posted 04 November 2013 - 08:41 PM
Error Report:
list causes an error in parallel runner. Bad argument: string expected, got nil. Image of error.

Errory Edit. This happened when I tried to use the command "?" Exact same error on the same line.

Oops. The latest update kinda broke the shell. In short, I'm trying to implement command chaining in bin/shell. I really need to find a way to indicate the latest release and its commit, don't I…
LDShadowLord #17
Posted 06 November 2013 - 06:18 PM
Suggestion: Add an "update" command on the login screen. Not something which forces an update, in case of bugs, but just a button which you can press which initiates an update. Just a suggestion, might come in handy if this is always going to be bleeding edge.
KillaVanilla #18
Posted 06 November 2013 - 08:04 PM
Suggestion: Add an "update" command on the login screen. Not something which forces an update, in case of bugs, but just a button which you can press which initiates an update. Just a suggestion, might come in handy if this is always going to be bleeding edge.

Heh. Good idea.
Then again, maybe I can do something involving branches (perhaps a "release"/"wip" branch could be used?)
Regardless, I'm just going to rewrite shell's line parsing code; the last mechanism didn't really work.
Edited on 06 November 2013 - 09:23 PM
KillaVanilla #19
Posted 21 November 2013 - 09:37 PM
Hello again (and sorry for the double-post)!

I've been hard at work writing in new features for the kernel since my last post here.

I've written in:
  • Command piping in /bin/shell
  • More forms of IPC (a rendezvous() call, semaphores)
  • Per-process environment sandboxing
  • Symbolic links
  • Improved filesystem drivers (loopFS and ramFS)
  • And probably a few other things that I forgot to mention in the commit logs
Anyways, is there anything else anyone would like to see in the kernel?
Or are there any user applications anyone would like me to write for this kernel?
TheOddByte #20
Posted 22 November 2013 - 09:59 AM
Uhmm.. I'm just getting this error all the time D:
Wobbo #21
Posted 22 November 2013 - 11:24 AM
I am getting a different error when I boot.


Fatal error: init:280: Could not load API: init 88:[string "sys/svcs/async_crypto"]:111: '}' expected (to close '{' at line 106)

I get this error after I installed it on a newly placed computer.
KillaVanilla #22
Posted 22 November 2013 - 04:27 PM
I ask for feature requests and I get bug reports. That's okay… anyways:

Uhmm.. I'm just getting this error all the time D:
That's probably because the updater (you are using the latest version, right?) doesn't fully clear out files that have beendeleted or moved between updates. sys/apis/localAreaNetwork got moved to /bin/crf/localAreaNetwork.
Boot using a startup disk and delete the offending file.

I am getting a different error when I boot.


Fatal error: init:280: Could not load API: init 88:[string "sys/svcs/async_crypto"]:111: '}' expected (to close '{' at line 106)

I get this error after I installed it on a newly placed computer.
This is because I made an incomplete commit; this was a problem earlier on too. I'm going to try and update the installer/updater to use a special "release" branch (containing the latest working commit).
Wobbo #23
Posted 22 November 2013 - 04:33 PM
It boots now, but I noticed a problem. It only asks for a root password after you have pressed a key.

And after you have entered the password for the normal account for the second time, he comes up with an error:

Fatal error: sys/svcs/userAuth:212: attempt to call nil
KillaVanilla #24
Posted 22 November 2013 - 04:55 PM
It boots now, but I noticed a problem. It only asks for a root password after you have pressed a key.

And after you have entered the password for the normal account for the second time, he comes up with an error:

Fatal error: sys/svcs/userAuth:212: attempt to call nil
Wait. I thought that I had fixed that…

Well, the pause before account setup was due to some debugging code that I forgot to remove.
The error was because I renamed a function without renaming calls to it. The code involved hasn't been touched in very long.
TheOddByte #25
Posted 23 November 2013 - 02:22 PM
Hate to say this but, I am getting another error :(/>
KillaVanilla #26
Posted 23 November 2013 - 02:27 PM
Hate to say this but, I am getting another error :(/>

You should probably update LeadLined-OS.
LDShadowLord #27
Posted 24 November 2013 - 11:44 AM
Poor Killa. Getting nothing but bug reports :P/> A suggestion of mine is to put an "un-install" function in the updater that wipes every file(or every leadlinedOS file, if you want to write them all out?) from the computer except for the updater. After than, you can do a fresh install on an empty computer. This might make new updates and such a lot easier to manage.
Edited on 24 November 2013 - 10:45 AM
KillaVanilla #28
Posted 25 November 2013 - 08:40 PM
Poor Killa. Getting nothing but bug reports :P/> A suggestion of mine is to put an "un-install" function in the updater that wipes every file(or every leadlinedOS file, if you want to write them all out?) from the computer except for the updater. After than, you can do a fresh install on an empty computer. This might make new updates and such a lot easier to manage.
Admittedly, it is beta software. I don't mind, anyways. It gives me something to do.

Yeah, an uninstaller feature would be helpful for the end-users.
I'm actually working on a more robust recovery/updater feature right now, too.

Wiping out (almost) every LeadLined-OS file is really just three delete calls: one for "sys", one for "init", and one for "startup". That does leave a few folders behind though, such as home folders and the "bin/" folder. It also leaves behind the installer.
Edited on 25 November 2013 - 08:07 PM
Wobbo #29
Posted 26 November 2013 - 01:47 PM
I got the system working now, and when I try to open /docs/api_documentation.txt using edit, I get a No permissions stored for user error. I can open the file when I log in as root.
KillaVanilla #30
Posted 26 November 2013 - 04:17 PM
I got the system working now, and when I try to open /docs/api_documentation.txt using edit, I get a No permissions stored for user error. I can open the file when I log in as root.

I'm working on updating/overhauling permissions.
LDShadowLord #31
Posted 30 November 2013 - 08:49 AM
I think leaving behind the installer is fine, as long as the updater always grabs the newest version, and you can always make some kind of system so that when it un-installs it asks "Do you want to delete your own files/preferences?" and if yes then it wipes everything including the bin and home folder.
KillaVanilla #32
Posted 30 November 2013 - 09:26 PM
I think leaving behind the installer is fine, as long as the updater always grabs the newest version, and you can always make some kind of system so that when it un-installs it asks "Do you want to delete your own files/preferences?" and if yes then it wipes everything including the bin and home folder.
I'll get to that sooner or later.

In any case, does anyone have any ideas for applications they want to see here?
KillaVanilla #33
Posted 01 January 2014 - 01:48 AM
A new year, a new bump. (Also a new double-post, but I hope nobody minds.)

Anyways, I've still been working on LeadLined-OS for the past month or so. The commits are there, if anyone actually bothers looking at the Github repo.
In any case, I can just about sum up the major changes below:
  • There's a new printer driver. Right now, all it does is provide a neat interface for accessing the printer's functionality via the /dev/ filesystem. Print spooling is planned.
  • The /dev/ filesystem was reworked behind the hood, mainly to support the above.
  • Multi-monitor support works. This was really easy to implement; all I had to do was give each process its own redirect stack and call the "top-level" term.redirect before running processes. Network terminals are planned, but keep getting put off for some reason.
  • fsOverride now attempts to convert CRLF line endings to LF line endings when writing to files. No guarantees that this works, though.
As I said above: Does anyone have any ideas for applications? I need something else to do with LeadLined-OS.
oeed #34
Posted 08 January 2014 - 11:19 PM
This actually looks quite good. I really like the file system's symbolic links, permissions etc.
oneru #35
Posted 21 May 2014 - 12:31 AM
This looks really interesting. If you still want ideas, I have a wishlist of sorts.

A scroll back buffer would be amazing. Shift + page up/ page down and shift + arrow up /arrow down to scroll up and down.

Redirection on the command line. So run a command followed by > to output to a file, and the pipe symbol "|" to push output into another command.

Gnu screen like functionality, so Ctrl + a, c to create another shell session, and Ctrl + a, n to switch sessions.

Copy and paste functionality, similar to GNU's screen.

An editor with a few creature comforts, like the ability to delete lines, or cut and paste, etc.