Re: [Simh] {Spam?} transferring files to and from v6 unix running in pdp11 emulator

2015-12-10 Thread Clem cole
Ah yes. -i   That's the ticket. Refresh the brain cache.  

Glad you figured it out. As I said if you run a cmp between that binary and one 
of the ones available in the wild I think you will find them to be the same.  

Clem

Sent from my iPhone

> On Dec 10, 2015, at 1:10 AM, Will Senn  wrote:
> 
> 
> 
>> On 12/9/15 10:01 PM, Clem cole wrote:
>> It should not be a 411 code. It should be a standard 407.  11/34 and 11/60s 
>> are so called 40 class systems. I used v6tar with them just fine.
>> 
>> Sent from my iPhone
>> 
>>> On Dec 9, 2015, at 10:40 PM, Will Senn  wrote:
>>> 
>>> use its v6tar on v6. It appears to require split I+D,
> Clem,
> 
> Thanks for persisting. I figured it out - on Keith Bostic's v7, using the 
> default makefile for v6tar:
> make v6tar
> cc -O -c tar.c
> cc -c -O /usr/src/libc/v6/access.c
> cc -c -O /usr/src/libc/v6/chown.c
> cc -c -O /usr/src/libc/v6/execl.c
> cc -c -O /usr/src/libc/v6/ftime.c
> cc -c -O /usr/src/libc/v6/gtty.c
> cc -c -O /usr/src/libc/v6/lseek.c
> cc -c -O /usr/src/libc/v6/stat.c
> cc -c -O /usr/src/libc/v6/syscall.s
> cc -c -O /usr/src/libc/v6/time.s
> cc -i -s -O *.o -o v6tar
> # dd if=v6tar bs=128 count=1|od
> 000 000411 037100 004224 027466 00 00 00 01
> ...
> man cc says -i and -s are passed through to linker, so man ld says -i creates 
> separate I+D and -s strips symbol table. I compiled the binary without these 
> (I thought I would keep the symbol table as an excercise) using:
> cc -O *.o -o v6tar
> 
> The resulting binary is 407, yay!:
> dd if=v6tar bs=128 count=1|od
> 000 000407 037040 004224 027466 020744 00 00 01
> ...
> 
> I copied it over to v6, lo and behold, it works on a PDP11/40 without 
> separate I+D!
> 
> Thanks,
> 
> Will
> 
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] {Spam?} transferring files to and from v6 unix running in pdp11 emulator

2015-12-09 Thread Clem cole
It should not be a 411 code. It should be a standard 407.  11/34 and 11/60s are 
so called 40 class systems. I used v6tar with them just fine. 

Sent from my iPhone

> On Dec 9, 2015, at 10:40 PM, Will Senn  wrote:
> 
> use its v6tar on v6. It appears to require split I+D,
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] {Spam?} transferring files to and from v6 unix running in pdp11 emulator

2015-12-09 Thread Will Senn


On 11/20/15 1:22 PM, Anders Magnusson wrote:

Den 2015-11-20 kl. 20:12, skrev Will Senn:



On 11/20/15 10:51 AM, Anders Magnusson wrote:

Den 2015-11-20 kl. 17:35, skrev Will Senn:

Hi,

I have searched and searched and have not found a satisfactory 
answer to this question:


How can I efficiently copy files from my host system to unix 
version 6 running in the pdp11 emulator and from unix 6 to my host 
system?

I usually do this by just tar'ing to/from a disk file, something like:

on pdp11: tar cf /dev/rxp0c myfiles
on host: tar xf simh-disk-file

Works both ways :-)

-- Ragge

Hi,

This sounded promising, but as it turns out there appear to be 2 
problems... 1. v6 doesn't have tar, and 2. it looks like v6 doesn't 
have rx device support (floppies). Are you using v6 with tweaks, or 
v7, or some other variant of unix?

Hm, it was some time ago, but I think it was tar.  Otherwise try cpio?
You do not have to use floppies.  rxp is the raw device for rp disks 
(avoids caching).  Just work against that file.


To close the loop on this, I have been able to follow the closing advice 
in "Setting up Unix - Seventh Edition" and use its v6tar on v6. It 
appears to require split I+D, so I had to "upgrade" from the 11/40 to an 
11/45 or 11/70 (both work). It requires the the kernel be recompiled 
with separate I+D support with m45.s and such, but pretty 
straightforward. I haven't done a lot of copying yet, but at least I am 
able to share between v6 and v7. I have also worked out a couple of 
different ways to move files to and from the host that involve the disk 
or tape. I wrote a perl script to read a SimH tape into its constituent 
files that works ok as a way to transfer files as well (clunkier than 
tar and such, but it was a good learning exercise).


Thanks,

Will

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] {Spam?} transferring files to and from v6 unix running in pdp11 emulator

2015-11-20 Thread Anders Magnusson

Den 2015-11-20 kl. 17:35, skrev Will Senn:

Hi,

I have searched and searched and have not found a satisfactory answer 
to this question:


How can I efficiently copy files from my host system to unix version 6 
running in the pdp11 emulator and from unix 6 to my host system?

I usually do this by just tar'ing to/from a disk file, something like:

on pdp11: tar cf /dev/rxp0c myfiles
on host: tar xf simh-disk-file

Works both ways :-)

-- Ragge


Most answers are shallow (copy/paste in terminal), or oriented toward 
RTS or another environment than unix. So, I thought I would articulate 
some of the ideas that I have tried and then ask some relevant 
questions in the hopes that the someone will shed some light on the 
problem, if not provide the answers.


My system is one of:
Debian 8 running on Intel Core 2 Quad Processor
FreeBSD 10.2 running on same
Macbook Pro running on Intel i7
Various Linuxes running in Virtualbox 5.x

Here are the methods I have found that work, sort of...

Unix on PDP11 SimH to Host:
1. cat file and copy and paste from terminal
This only works for pure text files and is not ideal

2. setup lpt in simh attached to printer.txt and cat file > /dev/lp0
This only works for textual output, but includes form feed characters 
and has formatting applied on its way to printer.txt


3. attach a blank tape tm0 to simh and dd if=myfile of=/dev/rmt0, then 
on the host deblock the tape and dd if=tapefile of=myfile
This seems to work, but I'm not sure it's ok to do this. It doesn't 
appear to work as well in the other direction.


Host to Unix v6 on PDP11 SimH:
1. copy a file into the copy buffer on the host and in the unix 
terminal window, paste the text.
Wow, this is tricky. It seems like you can only paste a few lines at a 
time. It does strange things if your text contains special characters 
like #, @, (, and so forth, which makes it pretty annoying as 
practically every file of interest is c source or something. However, 
with patience this does sort of work, but it's just for text files.


2. use Wolfgang's enblock - enblock < myfile > myfile.enb and then 
attach to tm0 in simh and dd if=/dev/rmt0 of=myfile
This is problematic, resulting in read errors and when diff'ed against 
files on the simh unix instance, produces errors about incomplete 
lines.  I am fairly sure that there is a good reason why it sort of 
works, but not fully. i.e. The resulting file is 99% ok.


Ideally, I would be able to tar up some files and convert the tar to a 
storage format that unix v6 could then access and untar. One problem 
is that v6 doesn't have tar. So, maybe ar could be used, or tp, or 
whatever other command is available on v6. Regardless, the underlying 
issue is that a file needs to be converted to a storage format that 
unix v6 can handle. This leads to the questions.


* I don't have a deep knowledge of storage formats, so it may be that 
what I'm asking isn't feasible, if someone could share the why along 
with the how or how not, that would be great.


1. Is there a simple, known, way to convert a single file, or multiple 
files at once, on a *nix host to a tape image that can be read by simh 
and unix v6? Perhaps something along the lines of - on the host, 
convert_util myfile tape.simh; in simh, attach tm0 tape.simh; on unix, 
dd if=/dev/mt0 of=myfile


2. Is it appropriate to read directly from a simulated tape device 
using dd, or is dd going to read the tape marks (whatever those are) 
as part of the file data?


3. Is the tape device the best to use for something like this, or 
would another device be more straightforward?


Grateful for any assistance,

Will

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] {Spam?} transferring files to and from v6 unix running in pdp11 emulator

2015-11-20 Thread Will Senn



On 11/20/15 10:51 AM, Anders Magnusson wrote:

Den 2015-11-20 kl. 17:35, skrev Will Senn:

Hi,

I have searched and searched and have not found a satisfactory answer 
to this question:


How can I efficiently copy files from my host system to unix version 
6 running in the pdp11 emulator and from unix 6 to my host system?

I usually do this by just tar'ing to/from a disk file, something like:

on pdp11: tar cf /dev/rxp0c myfiles
on host: tar xf simh-disk-file

Works both ways :-)

-- Ragge

Hi,

This sounded promising, but as it turns out there appear to be 2 
problems... 1. v6 doesn't have tar, and 2. it looks like v6 doesn't have 
rx device support (floppies). Are you using v6 with tweaks, or v7, or 
some other variant of unix?


Thanks,

Will
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Re: [Simh] {Spam?} transferring files to and from v6 unix running in pdp11 emulator

2015-11-20 Thread Will Senn



On 11/20/15 1:22 PM, Anders Magnusson wrote:

Den 2015-11-20 kl. 20:12, skrev Will Senn:



On 11/20/15 10:51 AM, Anders Magnusson wrote:

Den 2015-11-20 kl. 17:35, skrev Will Senn:

Hi,

I have searched and searched and have not found a satisfactory 
answer to this question:


How can I efficiently copy files from my host system to unix 
version 6 running in the pdp11 emulator and from unix 6 to my host 
system?

I usually do this by just tar'ing to/from a disk file, something like:

on pdp11: tar cf /dev/rxp0c myfiles
on host: tar xf simh-disk-file

Works both ways :-)

-- Ragge

Hi,

This sounded promising, but as it turns out there appear to be 2 
problems... 1. v6 doesn't have tar, and 2. it looks like v6 doesn't 
have rx device support (floppies). Are you using v6 with tweaks, or 
v7, or some other variant of unix?

Hm, it was some time ago, but I think it was tar.  Otherwise try cpio?
You do not have to use floppies.  rxp is the raw device for rp disks 
(avoids caching).  Just work against that file.


-- Ragge



Thanks. I combined a number or responses and came up with the following...


--From Unix v6 on PDP 11/40 SimH to Host:

create and attach an additional rk device:
simh> attach rk3 rk3
co

get a file of interest and note it's size in bytes:
# ls -l /etc/rc
-rw-rw-r--  1 bin90 Oct 10 12:32 /etc/rc

look at the od dump of the file for comparison later:
# od -c /etc/rc
000  r  m -  f /  e  t  c  /  m  t  a  b \n
020  /  e  t  c  /  u  p  d  a  t  e \n  /  e  t  c
040  /  m  o  u  n  t /  d  e  v  /  r  k  1
060  /  u  s  r  /  s  o  u  r  c  e \n  /  e  t  c
100  /  m  o  u  n  t /  d  e  v  /  r  k  2
120  /  u  s  r  /  d  o  c \n \n
132

write the file to the rk device (the sync may not be needed, but the 
result looks cleaner, also it doesn't apper that you can specify bs=1, 
device errors out):

# dd if=/etc/rc of=/dev/rrk03 conv=sync
0+1 records in
1+0 records out

exit the sim and then on the host, read from the rk image using bs=1 and 
count from the ls output:

$ dd if=rk3 of=rc bs=1 count=90
90+0 records in
90+0 records out

$ od -c rc
000r   m   -   f   /   e   t   c   /   m   t   a b  \n
020/   e   t   c   /   u   p   d   a   t   e  \n   /   e t   c
040/   m   o   u   n   t   /   d   e   v   /   r   k 1
060/   u   s   r   /   s   o   u   r   c   e  \n   /   e t   c
100/   m   o   u   n   t   /   d   e   v   /   r   k 2
120/   u   s   r   /   d   o   c  \n \n
132

This looks perfect, but I'm skeptical.


-- From Host to Unix v6 on PDP 11/40 SimH Host:

make a minor edit to the rc file (change m to n in the word mtab) and 
note it's size in bytes:

$ ls -l rc
-rw-r--r--  1 wsenn  staff  90 Nov 20 16:15 rc

it better be 90, unless I did something other than changing a letter

$ dd if=rc of=rk3 conv=sync
0+1 records in
1+0 records out
512 bytes transferred in 0.37 secs (13854733 bytes/sec)
note the count of blocks

with the number of blocks on hand, fire up the simulation
# dd if=/dev/rrk3 of=rc.dd count=1

because of the fact that I can't specify bs=1, the result is padded:
od -c rc.dd
000  r  m -  f /  e  t  c  /  n  t  a  b \n
020  /  e  t  c  /  u  p  d  a  t  e \n  /  e  t  c
040  /  m  o  u  n  t /  d  e  v  /  r  k  1
060  /  u  s  r  /  s  o  u  r  c  e \n  /  e  t  c
100  /  m  o  u  n  t /  d  e  v  /  r  k  2
120  /  u  s  r  /  d  o  c \n \n \0 \0 \0 \0 \0 \0
0001000

so, I read from the dd file with the number of bytes still in hand:
dd if=rc.dd of=rc bs=1 count=90
90+0 records in
90+0 records out

then diff the file against the original:
diff rc /etc/rc
1c1
* rm -f /etc/ntab
---
. rm -f /etc/mtab

Woohoo and whew! A lot of work, but file transfer in both directions. 
Does this approach seem sound to you or do you see some refinements that 
are possible/necessary?


Thanks,

Will






___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh