Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
0 answers
63 views
How to enable the second serial port on old vm AT&T SVR4?
Usually one serial port is sufficient to control via minicom the old SVR4 on Qemu (I know is a very old system, is unsafe, etc..). I have set those two ports on configuration of vm serial type="pty"> But on start, only one port is enabled find /dev/ -name *tty* -print /dev/systty /dev/tty00 /dev/tty...
Usually one serial port is sufficient to control via minicom the old SVR4 on Qemu (I know is a very old system, is unsafe, etc..). I have set those two ports on configuration of vm serial type="pty"> But on start, only one port is enabled find /dev/ -name *tty* -print /dev/systty /dev/tty00 /dev/tty /dev/tty00s /dev/tty00h So I try to rebuild the kernel. On SVR4 to rebuild the kernel first I make the changes in the file /etc/conf/sdevice.d/asy asy Y 1 7 1 4 3f8 3ff 0 0 asy Y 1 7 1 3 2f8 2ff 0 0 the syntax is simple: asy is the driver Y enable it, 1 7 1 I don't know, 3 is the interrupt (on all my system irq 3 is used by the second serial port, 4 by the first). 3f8-3ff and 2f8-2ff are the port interval, 0 0 I don't know Then I rebuild the kernel with idbuild. After reboot, same situation. If I edit the file /etc/conf/node.d/asy asy tty00 c 0 asy term/00 c 0 asy tty00s c 0 asy tty00h c 128 asy term/00s c 0 asy term/00h c 128 asy tty01 c 1 asy term/01 c 1 asy tty01s c 1 asy tty01h c 128 asy term/01s c 1 asy term/01h c 128 and recreate the nodes idmknod -s I have this strange situation ls -ld /dev/tty* crw-rw-rw- 1 bin bin 16, 0 Dec 25 19:31 /dev/tty crw--w---- 1 myuser tty 3, 0 Mar 27 05:20 /dev/tty00 crw-rw-rw- 1 root root 3,128 Mar 27 04:26 /dev/tty00h crw-rw-rw- 1 root root 3, 0 Mar 27 04:26 /dev/tty00s crw--w---- 1 root root 3, 0 Mar 27 05:20 /dev/tty01 crw-rw-rw- 1 root root 3,128 Mar 27 04:26 /dev/tty01h crw-rw-rw- 1 root root 3, 0 Mar 27 04:26 /dev/tty01s All files use the major number 3. Why the 4 is complete ignored? What I miss? Probably a bug in the kernel or what else? On all my system the two serials are recognized, modern (Linux) and old (Sco Unix). I see with SVR4 that it cannot see any serial port (except the first) on qemu but also on 86box and bochs.
elbarna (13690 rep)
Mar 27, 2023, 03:24 AM • Last activity: Mar 27, 2023, 03:50 AM
0 votes
0 answers
30 views
Proper (working) way to return an int pointer through STREAMS?
I had been doing some work with an old SVR4 box with serial i/o when I found that the driver for the serial card did not support TIOCMGET through an ioctl call (e.g. ioctl(fd, TIOCMGET, &arg);). Having the source for the driver, and looking at it - it didn't seem too hard to add an answer to the cal...
I had been doing some work with an old SVR4 box with serial i/o when I found that the driver for the serial card did not support TIOCMGET through an ioctl call (e.g. ioctl(fd, TIOCMGET, &arg);). Having the source for the driver, and looking at it - it didn't seem too hard to add an answer to the call. However, I've run into a bit of a snag in that what I am doing doesn't seem to work. Looking at the driver, it has the following code to service TCGETS: case TCGETS: { /* immediate parm retrieve */ register struct termios *cb; if (mp->b_cont) /* Bad user supplied parameter */ freemsg(mp->b_cont); if (!(bp1 = allocb(sizeof(struct termios), BPRI_MED))) { putbq(q, mp); bufcall(sizeof(struct termios), BPRI_MED, getoblk, (long)tp); return; } mp->b_cont = bp1; cb = (struct termios *)mp->b_cont->b_rptr; cb->c_iflag = tp->t_iflag; cb->c_oflag = tp->t_oflag; cb->c_cflag = tp->t_cflag; mp->b_cont->b_wptr += sizeof(struct termios); mp->b_datap->db_type = M_IOCACK; iocbp->ioc_count = sizeof(struct termios); putnext(RD(q), mp); break; } My thought was simply to copy this code and rather than return a termios structure, just return the int. As such, my code is similar: case TIOCMGET: { /* immediate parm retrieve */ register int *cb; if (mp->b_cont) /* Bad user supplied parameter */ freemsg(mp->b_cont); if (!(bp1 = allocb(sizeof(int), BPRI_MED))) { putbq(q, mp); bufcall(sizeof(int), BPRI_MED, getoblk, (long)tp); return; } mp->b_cont = bp1; cb = (int *)mp->b_cont->b_rptr; /* my original attempt to get some bits */ *cb = (ql->carrier * TIOCM_CAR | ql->rts * TIOCM_RTS | (ql->lp->command & 1) * TIOCM_DTR) /* Tried this to debug: *cb = 0; Doesn't seem to change the variable I pass in */ /* Tried this, compiles fine, *(int *)mp->b_cont->b_rptr = 0; but I get an improper argument passed error while running */ /* qreply(q, mp); not in my code, was a note to try it */ mp->b_cont->b_wptr += sizeof(int); mp->b_datap->db_type = M_IOCACK; iocbp->ioc_count = sizeof(int); putnext(RD(q), mp); break; } Making the call as shown previously, ioctl(fd, TIOCMGET, &arg), the arg value does not seem to get changed. I've tried a couple different attempts to return a value of 0 in case the problem was in my bit assignment code. However, I've not had any luck. I did write a program to make sure that TCGETS works as it should - and it does. So I'm not sure where I'm going wrong - probably something incredibly stupid and right in front of me. Hopefully that it is SVR4 and STREAMS isn't so arcane to put an answer out of reach. Thanks to all who look and try to help. Mack
mackbw (1 rep)
Aug 30, 2019, 08:48 PM • Last activity: Sep 9, 2019, 08:39 PM
-1 votes
1 answers
69 views
A question for old unix gurus or simply older SVR4 users: backup output
On SYSVR4(AT&T 2.1) i want to make a backup full of /dev/root i did this bkreg -a varfull -o /:/dev/root -c demand -m ffile -d disk -t mytb1 varfull is tag,dev/root is my fs wich i want to backup,-m ffile mean complete and -t is tag,-d is the backup device group after this i did backup -i -v -t mytb...
On SYSVR4(AT&T 2.1) i want to make a backup full of /dev/root i did this bkreg -a varfull -o /:/dev/root -c demand -m ffile -d disk -t mytb1 varfull is tag,dev/root is my fs wich i want to backup,-m ffile mean complete and -t is tag,-d is the backup device group after this i did backup -i -v -t mytb1 -c demand Works ok but..where is the output? Thanks
elbarna (13690 rep)
Jul 25, 2015, 09:45 PM • Last activity: Dec 23, 2015, 07:19 PM
1 votes
1 answers
1533 views
KSH on old unix systemV: search history
I have set a good ksh environement on old unix PATH=$PATH:/usr/lib/acct:/usr/sbin:/sbin:/usr/ucb export PATH EDITOR=vi FCEDIT=vi export EDITOR export FCEDIT HOSTNAME=`uname -n` HISTSIZE=500 LOGNAME=myname TERM=386AT PS1="\$LOGNAME@\$HOSTNAME:\$PWD\$ " set -o emacs stty 38400 intr ^C kill ^U tabs ixo...
I have set a good ksh environement on old unix PATH=$PATH:/usr/lib/acct:/usr/sbin:/sbin:/usr/ucb export PATH EDITOR=vi FCEDIT=vi export EDITOR export FCEDIT HOSTNAME=uname -n HISTSIZE=500 LOGNAME=myname TERM=386AT PS1="\$LOGNAME@\$HOSTNAME:\$PWD\$ " set -o emacs stty 38400 intr ^C kill ^U tabs ixon ixoff ixany setcolor white black alias type="whence -v" alias __A=echo "\020" # up arrow = ^p = back a command alias __B=echo "\016" # down arrow = ^n = down a command alias __C=echo "\006" # right arrow = ^f = forward a character alias __D=echo "\002" # left arrow = ^b = back a charactoe alias __H=echo "\001" # home = ^a = start of line alias __Y=echo "\005" # end = ^e = end of line With this i have search history with arrows,etc,my question is: is possible to make an alias for ctrl+r search history?Old ksh support search history? I'm on unix svr4 ATT
elbarna (13690 rep)
Apr 24, 2015, 12:43 PM • Last activity: Apr 24, 2015, 11:34 PM
Showing page 1 of 4 total questions