Subject: Re: 4.3-reno binaries on NetBSD
To: Johnny Billquist <bqt@Update.UU.SE>
From: Clint Wolff (VAX collector) <vaxman@qwest.net>
List: port-vax
Date: 12/27/2000 08:22:59
The original 'MAGIC' was 0407 which is a branch past the header. This 
was done to allow people that were too stupid to strip the header off
of bootblocks to write them to disk and have them work correctly :)

The remaining ones were added to differentiate between executables,
but the offsets weren't accurate anymore... When UNIX moved to VAXen,
the opcode and offset didn't work anyway...

clint

PS 'stupid' is relative... If you're building bootblocks on an
experiemental OS that a couple of guys in the back lab wrote, yur
probably a smart feller...


On Tue, 26 Dec 2000, Johnny Billquist wrote:

> On 26 Dec 2000, Mirian Crzig Lennox wrote:
> 
> [...]
> > The problem is essentially this: in the 4.3 days, the first field of 
> > the a.out format header (exec) was a longword, a_magic.  This usually
> > contained one of OMAGIC, NMAGIC or ZMAGIC (0407, 0410, 0413).  OMAGIC
> > was the old format from the PDP-11 days and not really used.  NMAGIC
> > was the new format that used read-only text segments which could be
> > shared, and ZMAGIC was like NMAGIC, but demand-paged.
> 
> Here is a bit of silly knowledge for you all.
> 
> OMAGIC, NMAGIC and ZMAGIC are all from the PDP-11. If you look in
> /usr/share/misc/magic, you'll find a few more. The full list is:
> 0407, 0401, 0405, 0410, 0411, 0437, 0413, 0430, 0431.
> 
> Note that these are *not* longwords, but are actually just 16 bit
> quantities. There is a reason for this. If someone have the PDP-11 opcodes
> in their heads, they'll trigger on the fact that these are all in the form
> 0004xx, which is an unconditional branch on the pdp-11. What this means is
> that if you try to run these programs from the first byte onwards, you
> start with a small jump that skips over the header information.
> 
> This is where my knowledge ends. Exactly what happens then I don't know.
> If the start of the actual codes comes exactly behind the header, it would
> start executing as if the program had been correctly started, but I
> haven't really bothered that much with this arcane knowledge. :-)
> 
> Just thought you'd all like to know...
> 
> 	Johnny
> 
> Johnny Billquist                  || "I'm on a bus
>                                   ||  on a psychedelic trip
> email: bqt@update.uu.se           ||  Reading murder books
> pdp is alive!                     ||  tryin' to stay hip" - B. Idol
> 
> 
>