The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: wkt@tuhs.org (Warren Toomey)
Subject: [Unix-jun72] Dealing with 0407 a.outs in the V1 kernel
Date: Sun, 4 May 2008 11:03:52 +1000	[thread overview]
Message-ID: <20080504010352.GA14058@minnie.tuhs.org> (raw)
In-Reply-To: <2901.1209825347@mini>

On Sat, May 03, 2008 at 10:35:47AM -0400, Brad Parker wrote:
> And it runs, but nothing happens.  I have not debugged it much.  Wish we
> had a working v1 as.

I think getting the V1 kernel to grok 0407 a.outs should be easier. Here are
snippets from the V1 and V2 a.out man pages:

1st Edition                               2nd Edition
-----------                               -----------
The header always contains 6 words:       The header always contains 8 words:
 1  a "br .+14" instruction [205(8)]       1  a "br .+20" instruction [207(8)]
 2  the size of the program text           2 the size of the program text
 3  the size of the symbol table           3 the size of the initialised data
 4  the size of the relocation bits area   4 the size of the uninit (bss) data
 5  the size of a data area                5 the size of the symbol table
 6  a zero word, unused at present         6 the entry location, always 0
                                           7 stack size required, always 0
                                           8 a flag indicating relocation bits
                                             have been suppressed


When I wrote the Apout support for V1 and V2, I found that all of an 0405
a.out was loaded into memory including the header, but the 0407 a.out is
loaded into memory MINUS the 8-word header.

So, I'm guessing, in the kernel's sysexec: code, where it does

        cmp     core,$405       / br .+14 is first instruction if file is
                                / standard a.out format

we have to add a section that recognises 0407, adds up the size of text,
data and bss (words 2, 3, 4), saves that in u.count, and loads the
rest of the a.out into memory but with the 8-word header removed.

Cheers,
	Warren



      parent reply	other threads:[~2008-05-04  1:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03 14:35 [Unix-jun72] mount woes Brad Parker
2008-05-03 17:52 ` [Unix-jun72] mount woes (fixed) Brad Parker
2008-05-03 18:14   ` Tim Newsham
2008-05-03 18:16     ` Tim Newsham
2008-05-04  1:27       ` [Unix-jun72] rk03 vs rk05 Warren Toomey
2008-05-04  1:03 ` Warren Toomey [this message]

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=20080504010352.GA14058@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).