The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: wkt@tuhs.org (Warren Toomey)
Subject: [Unix-jun72] Yes, a mount command
Date: Sun, 4 May 2008 18:41:37 +1000	[thread overview]
Message-ID: <20080504084137.GA32129@minnie.tuhs.org> (raw)
In-Reply-To: <20080504065024.GA26878@minnie.tuhs.org>

I took Brad Parker's suggestion for a simple mount rk0 /usr command,
and modified it as follows:

exit  = 1.
write = 4.
mount = 21.

        mov     $1,r0
        sys     write; rk0+040020; 8.
        sys     write; usr+040020; 4.
        sys mount; rk0+040020; usr+040020
        sys exit
        sys exit

rk0:    </dev/rk0\0>
usr:    </usr\0>

Assemble this with V7 as, to get:

0000000    000407  000050  000000  000000  000074  000000  000000  000000
0000020    012700  000001  104404  040052  000010  104404  040063  000004
0000040    104425  040052  040063  104401  104401  062057  073145  071057
0000060    030153  027400  071565  000162  000000  000000  000000  000002
0000100    000000  000000  000002  000000  000000  000002  000002  000000
0000120    000000  000000  000000  000000  000000  000000  000000  000000
0000140    074145  072151  000000  000000  000001  000001  071167  072151
0000160    000145  000000  000001  000004  067555  067165  000164  000000
0000200    000001  000025  065562  000060  000000  000000  000002  000032
0000220    071565  000162  000000  000000  000002  000043

Now hand-edit the top line with a binary editor to have this:

0000000    000405  000130  000000  000000  000074  000000  010000  010000

This makes it an 0405 executable, and the first 2 instructions become
mov r0,r0, i.e. a NOP.

Copy the a.out into your V1 /tmp directory, and use tools/mktape.py to
rebuild the tape. If you haven't used it before, here is what I did:

        tools/mktape.py /usr/local/src/V1/bin/* /usr/local/src/V1/etc/* \
        /usr/local/src/V1/tmp/*

Now do tools/assemv7 cold to build a cold kernel, then ./simh.cfg to run it
to make rf0.dsk.

Now run tools/assemv7 with no args to get a warm kernel. Copy rf0.dsk to
rk0.dsk so that you have 2 filesystems. Run ./simh.cfg, login as root,
and you should see /tmp/a.out. Run /tmp/a.out; you should see /dev/rk0
echoed on stdout. I don't know why /usr is not echoed.

Now you can chdir to /usr and do ls -l in there.

Annoyingly, du / only shows / and doesn't traverse into /usr. So I
may have had it working before, but I didn't realise that du was not the
best tool to verify the mount.

Cheers,
        Warren

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.out
Type: application/octet-stream
Size: 156 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20080504/80d2673e/attachment.obj>


  reply	other threads:[~2008-05-04  8:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04  5:19 [Unix-jun72] init Tim Newsham
2008-05-04  5:31 ` Tim Newsham
2008-05-04  6:29   ` [TUHS] comparing s1 frags, s2 bits, 1ed and jun72 print out Tim Newsham
2008-05-04 20:18   ` [Unix-jun72] 0407 binaries on 1ed Tim Newsham
2008-05-04 22:33     ` Warren Toomey
2008-05-05  0:00       ` Tim Newsham
2008-05-05  1:17     ` [Unix-jun72] Another RK mount program Warren Toomey
2008-05-05  1:23     ` [Unix-jun72] No luck with C compiler yet, but an idea Warren Toomey
2008-05-05  1:56       ` Tim Newsham
2008-05-05 23:01         ` [Unix-jun72] uppercase input Warren Toomey
2008-05-04  6:50 ` [Unix-jun72] init Warren Toomey
2008-05-04  8:41   ` Warren Toomey [this message]
2008-05-04 12:54 ` Brad Parker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080504084137.GA32129@minnie.tuhs.org \
    --to=wkt@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).