Jump to content

Porting Linux kernel on X16 - is it feasible?

Recommended Posts

Posted (edited)

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? 


Edited by xanthrou
Link to comment
Share on other sites

  • xanthrou changed the title to Porting Linux kernel on X16 - is it feasible?
Posted (edited)

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.

Edited by SlithyMatt
  • Like 1
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • Super Administrators

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. 


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. 


  • Like 4
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

Please review our Terms of Use