kerravon86@yahoo.com.au [hercules-os380]
2018-09-12 14:05:49 UTC
Today I managed to get keyboardhit() to
work under PDOS/386 which has allowed
me to get the below comms program to
work, which allows me to chat to whoever
connects to my system. I need to hit enter
twice to send my messages because
PDPCLIB doesn't seem to honor the
no-buffering call.
Anyway, if anyone would like to chat
with me, you just need to go:
telnet kerravon.mooo.com 80
I only have port 80 forwarded at the
moment, so that's why the normal 23
isn't being used.
I don't know whether QEMU honors the
DTR signal so that I can test to see
if there is a connection, and also
terminate the connection.
So the below application is running
under PDOS/386 which is running under
qemu. Bochs doesn't allow me to have
different people connecting to me
(serially).
This is the beginning of basic communications
and I would hope that people will be able to
connect to my system using MVS/380 instead
of Unix/Windows telnet.
Note that if you type "B" (plus you may need
to hit enter) you will get a response from the
system if I am not around to answer.
In due course I hope this rudimentary
communication will change into a system
that can exchange messages. I'm still not
sure if we want Fidonet or UUCP or maybe
the mailer can handle both.
BFN. Paul.
/*********************************************************************/
/* */
/* This Program Written By Paul Edwards. */
/* Released to the public domain. */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* pdpser - serial comms */
/* */
/*********************************************************************/
#include <stdio.h>
#include <pos.h>
#define PORT 0x3f8
static void init(void);
static int ser_putc(int c);
static void ser_puts(char *s);
static int ser_getc(void);
int main(void)
{
int c;
setbuf(stdin, NULL);
init();
ser_puts("Welcome to pdpser\n");
while (1)
{
c = ser_getc();
if (c != EOF)
{
ser_putc(c);
if (c == 'B')
{
ser_puts("You typed B!\n");
}
}
else if (PosKeyboardHit())
{
c = getchar();
ser_putc(c);
}
else
{
PosYield();
}
}
return (0);
}
static void init(void)
{
outp(PORT + 3, 0x03); /* 8 N 1 */
}
static int ser_putc(int c)
{
while ((inp(PORT + 5) & 0x20) == 0)
{
PosYield();
}
outp(PORT, c);
putchar(c);
fflush(stdout);
return (c);
}
static void ser_puts(char *s)
{
while (*s != '\0')
{
ser_putc(*s);
s++;
}
return;
}
static int ser_getc(void)
{
int c;
if ((inp(PORT + 5) & 0x01) == 0)
{
return (EOF);
}
c = inp(PORT);
return (c);
}
work under PDOS/386 which has allowed
me to get the below comms program to
work, which allows me to chat to whoever
connects to my system. I need to hit enter
twice to send my messages because
PDPCLIB doesn't seem to honor the
no-buffering call.
Anyway, if anyone would like to chat
with me, you just need to go:
telnet kerravon.mooo.com 80
I only have port 80 forwarded at the
moment, so that's why the normal 23
isn't being used.
I don't know whether QEMU honors the
DTR signal so that I can test to see
if there is a connection, and also
terminate the connection.
So the below application is running
under PDOS/386 which is running under
qemu. Bochs doesn't allow me to have
different people connecting to me
(serially).
This is the beginning of basic communications
and I would hope that people will be able to
connect to my system using MVS/380 instead
of Unix/Windows telnet.
Note that if you type "B" (plus you may need
to hit enter) you will get a response from the
system if I am not around to answer.
In due course I hope this rudimentary
communication will change into a system
that can exchange messages. I'm still not
sure if we want Fidonet or UUCP or maybe
the mailer can handle both.
BFN. Paul.
/*********************************************************************/
/* */
/* This Program Written By Paul Edwards. */
/* Released to the public domain. */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* pdpser - serial comms */
/* */
/*********************************************************************/
#include <stdio.h>
#include <pos.h>
#define PORT 0x3f8
static void init(void);
static int ser_putc(int c);
static void ser_puts(char *s);
static int ser_getc(void);
int main(void)
{
int c;
setbuf(stdin, NULL);
init();
ser_puts("Welcome to pdpser\n");
while (1)
{
c = ser_getc();
if (c != EOF)
{
ser_putc(c);
if (c == 'B')
{
ser_puts("You typed B!\n");
}
}
else if (PosKeyboardHit())
{
c = getchar();
ser_putc(c);
}
else
{
PosYield();
}
}
return (0);
}
static void init(void)
{
outp(PORT + 3, 0x03); /* 8 N 1 */
}
static int ser_putc(int c)
{
while ((inp(PORT + 5) & 0x20) == 0)
{
PosYield();
}
outp(PORT, c);
putchar(c);
fflush(stdout);
return (c);
}
static void ser_puts(char *s)
{
while (*s != '\0')
{
ser_putc(*s);
s++;
}
return;
}
static int ser_getc(void)
{
int c;
if ((inp(PORT + 5) & 0x01) == 0)
{
return (EOF);
}
c = inp(PORT);
return (c);
}