Wednesday, November 18, 2015
The Psychotherapy of Racter might be possible
I may have spoken too soon.
Today I came across a reference to vm86(2)
,
a Linux-only system call
(which is okay because I'm running Linux)
for the x86 32-bit architecture
(which is okay because I'm running the x86 32-bit architecture).
It can run x86 code in 16-bit mode
(which is okay because the version of Racter I have is x86 16-bit code)
and while I don't have MS-DOS
(which is okay because who runs that any more?)
I can probably fake enough of it to get Racter running.
The tricky part of this was to figure out how to set up and successfully call vm86()
.
And like most things related to this project,
there's not a lot of documentation on what I'm trying to do.
I finally got a test program working,
so I know in theory I can do what I want to do
(and it says something that using an obscure non-portable system call and writing my own half-baked version of MS-DOS system calls is the easiest approach,
but I don't think I want to know what that something is).
I had to dust off my copy of The MS-DOS Encyclopedia to read in and properly load an MS-DOS executable into memory (which I think I got right—the relocation records appear to be simple but the devil is always in the details) And Racter did make a valid MS-DOS system call, and better yet, it was one I was expecting Racter to make.
So it looks promising.
I also found what claims to be a faithful implementation of the original Eliza program which requires rewriting my Eliza implementation but that's okay since it seems to be a bit more fleshed out than the version I used.
So it may be that a second attempt at this is warranted. We shall see.