Page 1 of 1

Porting Linux kernel on X16 - is it feasible?

Posted: Wed May 25, 2022 9:12 am
by xanthrou

So, we already have an UNIX-like OS for the X16 named Fuzix. 

Seems like a stupid question, but I wonder if it's possible to port the Linux kernel to the Commander X16 and would it be feasible to do so? 

 


Porting Linux kernel on X16 - is it feasible?

Posted: Wed May 25, 2022 5:02 pm
by SlithyMatt

Short answer: maybe and not really.

Long answer:

Linux doesn't really add a benefit to a platform like the X16. There's no need to have multi-threaded access to devices, and the overhead of dealing with all that would eat up all your CPU cycles, as Linux is intended for machines with a lot more resources. A better option is one of the following:

1. An OS made for 8-bit microcomputers like OS/9 on the old Tandy CoCo, or some of these newer inventions. Multi-processing at an appropriate scale.

2. Maybe by "Linux" you mean "bash" -- and you could have a CLI similar to bash and even include the ability to run simple bash scripts. BASIC is not the best CLI for general computing, which is why most business machines at the time opted for something like CP/M and later MS-DOS. You could definitely make the X16 more like a productivity machine and run a Unix-like shell that could then call up the BASIC interpreter when you want to do some in-place programming, and it could just as easily call up a different interpreter, like Forth or Logo or even a really simplified version of Python. But then you exit or restart and be back to the command shell, and you can deal with the file system on the SD card as you would if it were inserted into a Linux machine. You could also run applications with command line arguments, which would make things like compilers much easier to do. But do you need the Linux kernel itself to do any of this? Absolutely not. You just need a very simple DOS that a bash-like shell can hook into.


Porting Linux kernel on X16 - is it feasible?

Posted: Wed May 25, 2022 6:48 pm
by kelli217

The actual Linux kernel? I think if you stripped it down to the core, sure you can probably fit the basic task scheduler and core API in the 2MB memory space of an X16. Whether or not it would be able to do anything useful is anyone's guess. And at 8MHz it would run like a pitch drop experiment.

There are other multitasking systems that are more suitable for the speed and the memory space available. Lunix, GeckOS, Contiki, picoOS...


Porting Linux kernel on X16 - is it feasible?

Posted: Wed May 25, 2022 6:55 pm
by rje

I've thought about porting a light, PETSCII-friendly version of AWK into a "X16 Shell"-like thing.

 


Porting Linux kernel on X16 - is it feasible?

Posted: Wed May 25, 2022 9:09 pm
by TomXP411

tl;dr: no. GeckOS is as close as you're likely to get. 

Long version:

No. Modern Linux (or more correctly, modern POSIX) is far too complex to run on an 8-bit CPU like the 6502.

Even the first version of Linux was designed for 386/486 PCs and uses the native multitasking features of those CPUs. So porting Linux itself in any meaningful sense is simply impossible. 

However, Linux is a clone of the UNIX operating system, developed by AT&T. If you extend that question to "can you port UNIX to the 6502", everyone will point at GeckOS. While GeckOS is not UNIX, either, it is designed to be as much like UNIX as you are likely to get on an 8-bit computer. 

https://en.wikipedia.org/wiki/GeckOS

So the question becomes: can you port GeckOS to the Commander X16? Absolutely. One of of the bright points of the X16's design is the decision to stick with the Commodore style KERNAL, which allows software to be fairly easily ported between Commodore-like systems. Well designed software can even be ported to non-Commodore platforms, like BBC Micro, Atari, or Apple, by modifying the I/O routines to fit the BIOS of the platform in question. 

 


Porting Linux kernel on X16 - is it feasible?

Posted: Thu May 26, 2022 1:14 pm
by Ralphy

There is also A2osX, which is a pre-emptive multitasking and multi-user "unix-like" system for the enhanced 128K Apple //e and 2gs using ProDOS.

https://github.com/A2osX/A2osX/blob/master/.Docs/User Guide.md

Here are a few screenshots.

https://github.com/A2osX/A2osX/blob/master/.Docs/Screen Shots.md

A2osX supports telnet, http and remote serial connections too.

It's amazing what's possible with a 65c02 cpu.