Author Topic: Compat8x  (Read 4609 times)

0 Members and 1 Guest are viewing this topic.

Offline qazz42

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1130
  • Rating: +30/-12
  • hiiiiiiiii
    • View Profile
Compat8x
« on: January 02, 2011, 02:55:07 pm »
Crosspost from cemetech by Sircmpwn

Quote
Hello,
I'm announcing the first project for KnightOS. When it's done, I'll get started on Compat8x. Like Wine for Linux, Compat8x will be a compatibility layer allowing TIOS programs to run under KnightOS. I will support PartesOS as well when it's released, and the reverse (KOS on TIOS) could also be possible. How it works is this (for TIOS on KOS):
The program is copied to RAM twice. Compat8x looks through the first copy for CALL, JP, and LD. I'll talk about that in a moment. It needs to know if a given address lies within the program, and that can be calculated like so:
TIOS programs run from $9D95
If a program is $200 bytes, all addresses between $9D95 and $9F95 are internal.
Compat8x will set aside RAM that will mock SafeRAM from TIOS. When it encounters a load, if it is external, it changes the address to the corresponding mocked SafeRAM. If it's internal, it changes to the second copy in RAM.
Compat8x will also keep a jump table that leads to the KnightOS equivalent routines to commonly used bcalls. All external cals/jps/bcalls/bjumps are changed to their corrponding values in the jump table.

I know it wouldn't be perfect, but it could allow few programs to run.

apparently SirC could not make it to post here because there is no copy-paste feature on his phone  :w00t:
« Last Edit: January 02, 2011, 02:58:31 pm by qazz42 »

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Compat8x
« Reply #1 on: January 02, 2011, 06:05:12 pm »
Well, that's amazing.  I'm working on my own secret project about this... *evil laugh*

Good luck Sir.  The copying twice things would probably be bad for huge programs.  I bet you could get around that in some way.

SirCmpwn

  • Guest
Re: Compat8x
« Reply #2 on: January 02, 2011, 06:20:10 pm »
Well, KOS will have double the executable RAM available, so even large programs will probably run.  Plus, execution can start as early as $8000, which gives an extra $1D95 bytes for programs.  So the only size issue is with programs that execute up to $C000 and have huge data sections.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Compat8x
« Reply #3 on: January 02, 2011, 06:23:46 pm »
I am utterly ignorant of the finer nature of Assembly mechanisms and terminology, and because I cannot tell from context, I'll ask a noobish question:
Will Compat8x handle TI-Basic programs or Assembly programs? (or both?)
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Compat8x
« Reply #4 on: January 02, 2011, 06:27:34 pm »
I am utterly ignorant of the finer nature of Assembly mechanisms and terminology, and because I cannot tell from context, I'll ask a noobish question:
Will Compat8x handle TI-Basic programs or Assembly programs? (or both?)
Assembly programs only, I'm afraid.

EDIT: apparently, I might be wrong. See next post.
« Last Edit: January 02, 2011, 06:33:09 pm by graphmastur »

SirCmpwn

  • Guest
Re: Compat8x
« Reply #5 on: January 02, 2011, 06:28:28 pm »
TI-Basic will be supported, though.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Compat8x
« Reply #6 on: January 02, 2011, 06:33:25 pm »
TI-Basic will be supported, though.
What do you mean? I thought you were only talking about assembly with compat8x.  Are you saying KOS will support basic?

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Compat8x
« Reply #7 on: January 02, 2011, 06:44:21 pm »
crosspost:
Quote from: calcdude84se
I implied elsewhere, I think, that I will be writing a similar program using the double-copy idea.
SirCmpwn, another idea: for what is probably a good number of programs, they can be divided into code and data sections. We could compile a table of where the split(s) are located for common programs, and having this knowledge would make it possible to need only one copy.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Compat8x
« Reply #8 on: January 02, 2011, 06:58:57 pm »
Sounds awesome! Can't wait for the release of KnightOS.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





SirCmpwn

  • Guest
Re: Compat8x
« Reply #9 on: January 02, 2011, 07:06:57 pm »
calcdude, that would be very size inefficient, it would be better to manually port existing programs and release a new version.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Compat8x
« Reply #10 on: January 02, 2011, 07:09:43 pm »
Perhaps it would be better to port them, but could you explain how that would be inefficient with respect to size? I'm not exactly sure how; the table wouldn't be anything extremely large. ???
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Compat8x
« Reply #11 on: January 02, 2011, 07:16:16 pm »
Well, there are a lot of duplicate program names out there (Phoenix, for example) so a simple and size efficient check wouldn't work well.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Compat8x
« Reply #12 on: January 02, 2011, 07:19:57 pm »
Checking size or doing a simple checksum wouldn't be too bad, but I see your point.
Perhaps a possibility for manual input, at least as an option?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Compat8x
« Reply #13 on: January 02, 2011, 07:27:42 pm »
Probably a computer side manual converter would be best.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Compat8x
« Reply #14 on: January 02, 2011, 07:28:53 pm »
Hm, sounds good. A database could be kept there and programs could be converted either way easily.
Good luck on this! :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.