ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Reviving an old luggable computer

<< < (2/2)

Deozaan:
Invalid date, lol.
-mouser (December 18, 2018, 12:29 PM)
--- End quote ---

I guess that Y2K bug really was a doozy. ;D

Gothi[c]:
Here's a bit of an update.

So, I was challenged with software - I just had a copy of DOS 4.0.1 which doesn't really come with much of anything. It did have a copy of gwbasic, so I wrote a crude program to transfer files.
Then wrote some C code to send files:


--- Code: C ---#include <stdio.h>#include <unistd.h>#include <fcntl.h> #define CHAR_STX 2#define CHAR_EOT 3#define CHAR_ACK 6 int bcount=0; void wait_ack(int fd){    while(1)    {        char buf;        int bytes = read(fd, &buf, 1);        if (bytes == -1) continue;        if (buf == CHAR_ACK) break;        printf(" (%d) ", buf);        usleep(1000);    }    bcount++;    printf("%d bytes...\n", bcount);} void usage(){    printf("\n");    printf("Usage: transfer_file <filename>\n");    printf("\n");} int main(int argc, char** argv){     // Parse arguments.    if (argc != 2)    {        usage();        return 1;    }    char* filename = argv[1];     // Open input file.    FILE* file_fd = fopen(filename, "rb");    if (!file_fd)    {        printf("Could not open: %s'n", filename);        return 1;    }     // Open serial port and set options.    int serial_fd = open("/dev/ttyUSB1", O_RDWR | O_NOCTTY);    if (serial_fd == -1)    {        printf("Could not open serial port.");        return 1;    }    fcntl(serial_fd, F_SETFL, FNDELAY);     printf("Streaming from: %s\n", filename);     // Signal read signal.    write(serial_fd, "\002", 1);    wait_ack(serial_fd);     // Stream input file over serial.    char buf;    while(1)    {        size_t bytes = fread(&buf, 1, 1, file_fd);        if (bytes != 1)        {            printf("Got %d bytes, bytes\n",bytes);            break;        }        write(serial_fd, &buf, 1);        wait_ack(serial_fd);    }     // Signal end-of-file and exit.    char eom = CHAR_EOT;    write(serial_fd, &eom, 1);    close(serial_fd);    return 0; }
It's not pretty, and it's pretty slow sending on byte at the time, with the panasonic machine ACK'ing it before the next byte is sent, but it just needed to be good enough to transfer a better program.
I transferred a copy of KERMIT, which has a better way of copying files, and can also act as a serial console / terminal emulator.

Here's the old machine chatting on the donationcoder IRC channel over serial:

Reviving an old luggable computer

mouser:
fun!!!  :up:

mwb1100:
I missed this thread the first time around - great stuff!

Navigation

[0] Message Index

[*] Previous page

Go to full version