[Simh] VAX 8200
Timothe Litt
litt at ieee.org
Sat Mar 18 12:23:22 EDT 2017
Even though someone found a utility for the 8200, a program like this is
handy for other machines (and device roms).
A good outline of the essentials of PFN (and file) mapping, but for
general use...
You neither compute the checksum hinted at by "format" (and "buffer"),
nor do you $FAO or output it. Also, the movw @ 40$: (and the /2 above)
may want to be movl /4; most VAX do longword fetches for i-stream; as I
mentioned previously, word reads from I/O space may or may not be
supported on a given platform/address. Note that the "checksum" is
more often a CRC-32 than a 16-bit quantity.
You don't need $iouv2def for this,nor lib.mlb.(I expect that you
borrowed code from something that did.)
I recommend an explicit $close of the file, which can provide the exit
status. And .BIN would be a better file extension than .exe (since
you're not writing an executable file.)
Finally, the count at 40$ -1L and the 'page_count' symbol ought to be
functions of something like "rom_length" so they stay consistent. e.g.
rom_length = ^X10000; page_count = <rom_length+511>/512; loop_count =
rom_length / (2 or 4);
Have fun.
On 18-Mar-17 11:47, Rick Murphy wrote:
> On 3/16/2017 11:53 PM, Robert Armstrong wrote:
>>
>> >Under VMS, PFN map a section to the EEPROM, copy it to normal memory
>> & write it to disk.
>>
>> Um, fair enough. I don’t suppose someone has a program already
>> written to do this?
>>
>> I could have easily done that about ten or fifteen years ago, and
>> in theory I still can, but it’ll probably take an afternoon with the
>> VMS manuals to remember how J
>>
> Here's an example, which I wrote for the MicroVAX. Took me a bit to
> find this.
>
> The program creates a file called ROM.EXE and copies the boot ROM into
> that file.
> Note the " vbn=#<^X20040000/512>" line - that
> says that the ROM is mapped into physical address 20040000 on that
> system. Likely different for others. Size of the ROM is calculated by
> the "page_count" variable.
> -Rick
>
> .title copyrom - Copy the rom
> .psect data rd, wrt, nopic, noshr, noexe, long
> .library /sys$Library:lib/
> $iouv2def
> $secdef
> .psect data rd, wrt, nopic, noshr, noexe, long
>
> page_count = ^X10000/^X200
>
> file_fab: $FAB ALQ=page_count,-
> FAC=<GET,PUT>,-
> FNM=<ROM.EXE>,-
> FOP=UFO
>
> p1_space: .quad 0
>
> copy_sec_base: .long 0
> .long 0
>
> rom_sec_base: .long 0
> .long 0
> buf_descr: .long 80
> .address buffer
> buffer: .blkb 80
>
> format: .ascid /Checksum is !XW/
>
> .psect code rd, nowrt, pic, noshr, exe, long
>
> .entry go, ^m<>
>
> $create fab=file_fab
> blbs r0, 10$
> ret
>
> 10$: $crmpsc_s inadr=p1_space,-
> retadr=copy_sec_base,-
> flags=#<sec$m_expreg!sec$m_wrt>,-
> chan=file_fab+fab$l_stv
> blbs r0, 20$
> ret
>
> 20$: $crmpsc_s inadr=p1_space,-
> retadr=rom_sec_base,-
> flags=#<sec$m_expreg!sec$m_pfnmap>,-
> pagcnt=#page_count,-
> vbn=#<^X20040000/512>
> blbs r0, 30$
> ret
> 30$: movl rom_sec_base, r0
> movl copy_sec_base, r1
> movl #^x10000/2, r2
> 40$: movw (r0)+, (r1)+
> sobgtr r2, 40$
> movl #1,r0
> ret
> .end go
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20170318/c9ac119c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4577 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20170318/c9ac119c/attachment.bin>
More information about the Simh
mailing list