Reverse Engineered KERNAL?

rje

New Member
Nov 6, 2019
26
11
3
After re-reading the MEGA 65 blog entry on their open-source ROMs, I'm wondering if perhaps a X16 KERNAL would be easier to implement than a "standard" Commodore KERNAL?

I also read through a long Lemon 64 thread about legality and new ROMs, and realized the main problem with a C64 KERNAL replacement (for instance) is because demos would call into KERNAL routines, rather than using the proper jump table.

This problem does not exist for the X16, because it has not been finalized.

Therefore, a custom KERNAL which yet implements the Commodore KERNAL appears to be quite doable. And although my assembly language experience is minimal, it seems to me that 6.5k is not really a lot of assembly to write. Call it somewhere around 3,000 instructions, for around 33 subroutines, so isn't that about 100 instructions each?

Since it doesn't have to be instruction-exact to the C64, then that "should be easy". (I put that in quotes because nothing worth doing is truly easy).

Thoughts??
 
May 22, 2019
592
300
63
There's no point in doing so, if you don't replace the BASIC ROM as well.

KERNAL isn't that hard to replace with a (mostly) compatible replacement. By the time he's done, Michael will have replaced a huge chunk of the kernel with new code, anyway. The BASIC ROM is a little more challenging, because it would mean building a new interpreter from scratch. You can do one without the other, but it seems pointless to try if you're not going to do both. So the question really is... is someone willing to write a new BASIC+kernel from scratch?

The team's current approach is to license the Commodore 64 ROMs from Cloanto, then modify them to fit the Commander's needs. I'm sure they feel this will save enough time and effort to be worth the licensing cost. I trust that David is making the choice that makes sense for him.
 
  • Like
Reactions: BruceMcF

BruceMcF

Active Member
May 19, 2019
205
63
28
Precisely. Doing a "clean room" clone of MS Basic V2 that meets their design target of executing vanilla VIC20/C64 Basic programs is challenging just from the perspective of getting volunteers who can (1) establish that they have the 6502 programming chops to succeed and (2) establish that they have never seen the MSBasic V2 source code ... and that's before the work on coding the Basic has started.
 

rje

New Member
Nov 6, 2019
26
11
3
Create your own Version of Microsoft BASIC for 6502
....of course, I just found this (https://www.pagetable.com/?p=46) written by no other than Michael Steil.

The problem of course is that he probably knows MSBasic.

I've never looked at either the Kernal or BASIC, but do I have the chops? I certainly lack the experience, so the answer is probably "no". I've written a few blocks' worth back in 1985, and then only sprite and joystick stuff.


I suppose it's possible to find a version of MSBasic which is now public domain, if one exists, and build in the Commodore bits? E.G. does Cloanto own KIM BASIC, because the KIM was MOS which was acquired by CBM?
 
Last edited:

BruceMcF

Active Member
May 19, 2019
205
63
28
I suppose it's possible to find a version of MSBasic which is now public domain, if one exists, and build in the Commodore bits? E.G. does Cloanto own KIM BASIC, because the KIM was MOS which was acquired by CBM?
Microsoft will own the rights to all of the other ones ... Commodore was the only open-ended license that they granted, back when they were desperate for money.

Copyright is not like trademark ... you can't lose it because you don't defend it. You can be using any of the various dis-assemblies widely available on the web for years, and then if Microsoft's IP department is bored one day they can swoop in and shut you down.

Now, strictly speaking it was only for Commodore computers, but it's probably straightforward enough to set things up as a shell where Cloanto is legally making the computer and production is outsourced to the CX16 group.
 

rje

New Member
Nov 6, 2019
26
11
3
I can see why the MEGA65 is going with open-source BASIC and Kernal. If I were an experienced assembly language programmer.... alas.

For now, I'll go back to doodling around with cc65.
 
  • Like
Reactions: Jestin

PowerfulBadBoy

New Member
Jul 17, 2019
26
12
3
Maybe at some point we could use a modified version of the MEGA65 kernal?

I thought the whole idea was to re-write the kernal completely as
  1. There were A LOT of changes needed
  2. Cloanto basically ignored all of David's inquiries about licencing the C64 kernal
as documented in the first "dream computer" video.
 

BruceMcF

Active Member
May 19, 2019
205
63
28
Maybe at some point we could use a modified version of the MEGA65 kernal?

I thought the whole idea was to re-write the kernal completely as
  1. There were A LOT of changes needed
  2. Cloanto basically ignored all of David's inquiries about licencing the C64 kernal
as documented in the first "dream computer" video.
Sometime after that they got a response for Cloanto, so they went for extend and modify. Nothing is set in stone at this point.
 

Aramis

New Member
Jan 29, 2020
11
4
3
I suppose it's possible to find a version of MSBasic which is now public domain, if one exists, […]
Doubtful... US Copyright Laws won't put MS Basic out of copyright until 2050.
Even licensing a derivative (like CBM Basic V2) can wind up reverting code back to M$...

it's 95 years for 1964-1977 released with notice. (See https://copyright.cornell.edu/publicdomain). Which all versions of Microsoft Basic are. The patents, if any, however... probably expired.

The closest is reimplementations of MS Basic from scratch, and there are many, in various states of disarray. QuickBasic and QBasic reimplementations are more widely at useful states, so if you really want a viable basic...
 

BruceMcF

Active Member
May 19, 2019
205
63
28
The closest is reimplementations of MS Basic from scratch, and there are many, in various states of disarray. QuickBasic and QBasic reimplementations are more widely at useful states, so if you really want a viable basic...
Indeed, if there had been a reimplementation in a ready-for-prime-time state or close to it, that might have been the original starting point.
 

rje

New Member
Nov 6, 2019
26
11
3
The closest is reimplementations of MS Basic from scratch, and there are many, in various states of disarray.
And in fact, Bruce has pointed me to Paul Scott Robson's several BASIC reimplementations for both the MEGA65 and the X16. I suspect he has useful insights.
 

BruceMcF

Active Member
May 19, 2019
205
63
28
And in fact, Bruce has pointed me to Paul Scott Robson's several BASIC reimplementations for both the MEGA65 and the X16. I suspect he has useful insights.
On FB, he says that MS Basic-ish project, basic-65 is not a working Basic, it's just the start of one. Mostly just a set of floating point routines.

On the other hand, the integer Basic65 would need a set of floating point routines and a floating point parser loop to fall into if floating point values are encountered ... so it might be that the combination of the two are a floating point parser loop away from being a candidate.

But we've found out when we are starting school here in China ... it will be the 24th of February, all online. Since I have two new preps, it's not likely I'd be in a position to dig into that until July ... and that's only if I can get my Camel Forth port running in the next couple of weeks. I'm going to get stuck back into my Camel Forth this weekend.
 
Last edited:

rje

New Member
Nov 6, 2019
26
11
3
On FB, he says that MS Basic-ish project, basic-65 is not a working Basic, it's just the start of one. Mostly just a set of floating point routines.

On the other hand, the integer Basic65 would need a set of floating point routines and a floating point parser loop to fall into if floating point values are encountered ... so it might be that the combination of the two are a floating point parser loop away from being a candidate.
I'll check those projects out... literally and figuratively...
 
  • Like
Reactions: BruceMcF