PrintLogo

Z-80 Homebrew Computer - Interfacing with a Pentium and GNU/Linux




There are 12 parts to this article:
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 < 9 - 10 - 11 - 12

For details on the getdump and putprog programs, see this article. In this article, I'll detail the software needed to hook the homebrew up to a Pentium 133 PC with a uClibc GIAGD based GNU/Linux system as the OS. This software should compile just fine with GCC/Glibc as well. Note that it is specific to Intel hardware.

Here is the source for getdump.

Here is the binary for getdump.

I mode some minor tweaks from the program in this article. The trickier part is replacing the gwbasic program with something more tolerable. I made binaries that can be run with Perl as system calls:

Here is the binary for out378.

Here is the binary for out37a.

Here is the source for out378.

Here is the source for out37a.

Here is the source for putprog.pl.

Out378:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/io.h>
int main(int argc, char *argv[])
{
unsigned int hextowrite;
ioperm(0x378,1,1);
sscanf(argv[1],"%x",&hextowrite);       
outb(hextowrite,0x378);
return 0;
}

Out37a:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/io.h>
int main(int argc, char *argv[])
{
unsigned int hextowrite;
ioperm(0x37a,1,1);
sscanf(argv[1],"%x",&hextowrite);       
outb(hextowrite,0x37a);
return 0;
}

These are used in putprog.pl:

@progdata=(62,254,8,33,48,24,126,211,1,8,211,0,7, 8,62,255,211
,0,44,125,254,56,202,32,24,195,6,24,0,0,0,0,118,0,24,
0,0,0,0,0,0,0,0,0,0,0,0,0,140,175,163,144,127,191,191,249);
system("./out37a 8");
printf("Waiting?");
$response=<STDIN>;
system("./out37a 8"); 
foreach $curdata (@progdata){
$curdatahex=sprintf("%x",$curdata);
system("./out378 $curdatahex");
&delay;
system("./out37a 0");
&delay;
system("./out37a 8");
}
for ($fill=1;$fill<256;$fill++){
system("./out378 0");
&delay;
system("./out37a 0"); 
&delay;
system("./out37a 8"); 
&delay; 
}
sub delay {
for($i=1;$i<2000;$i++){}
}  

I had to compile Perl for the uClibc/GIAGD system:

Here is the perl binary. Note that this will only work with uClibc systems.

Here is the perl source.



This article comes from Coprolite:
http://coprolite.com/

The URL for this story is:
http://coprolite.com/art9.html

Copyright 1997-2006 Coprolite.com. Read our Terms of Use.