Home · Articles · Downloads · Hobby Wear · Forums · Web Links · News CategoriesThursday, July 19, 2018
Navigation
Home
Articles
Downloads
Hobby Wear
FAQ
Forums
Web Links
News Categories
Contact Us
Photo Gallery
OpenVMS Bigot
Search
Users Online
Guests Online: 9
No Members Online

Registered Members: 7,165
Newest Member: ozzievini
PdfFactory Pro Enterprise 2.31, MATFOR 4.00.061031 in Lahey Fortran, Adobe PhotoShop 9.0 CS2 oem, Trend Micro InterScan VirusWall 6.0, Adobe Acrobat 7.0 Professional sale, Salon Iris 5.05, Drafix Pro Landscape 11.2, oem Adobe PhotoShop CS 8.0 cheap buy, Catia 5 R12 P3 with SP2, Mcafee Secure Internet Gateway 4.5, oem Adobe Acrobat Professional 8 oem, Visual UML 4.1 Developer Edition, sale Adobe CS3 Design Premium Vol for Mac low price, Nuance Dragon Naturally Speaking 9.0 Professional With SP1, Adobe After Effects Plugins, low price AutoCAD 2006 cheap buy, Avid NewsCutter XP 3.8, The Movie Library 1.7.11, oem Adobe Creative Suite Premium Edition 2.0, ProFlyers 6.0 PDF Forms for Adobe Acrobat, PTC Pro Engineer Routed Systems Designer 5.0, sale DVDXCopy Platinum 4.0.38, CyberBizPlan v1.0.165 WinAll, NeverCenter Silo 1.16b, cheap buy AutoCAD 2005, Norton Save And Restore 11, sale Adobe Creative Suite 3 Design Premium sale, Adobe Premiere Plugins Collection 2007, cheap buy Adobe Creative Suite Premium Edition 2.0 for Mac sale, Active Desktop Calendar 6.5.061124, sale Adobe Acrobat 6.0 Professional, X-Rite MonacoPROFILER Platinum 4.8, EmailUnlimited 6.1 Win98NTME, oem Adobe Photoshop CS3 Extended sale
Sponsors
Island Computer
View Thread
OpenVMS Hobbyist Program | Alpha Systems Forums | FreeAXP
Author Importing raw files by faking as disk images
Hein
Member

Posts: 15
Joined: 02.02.07
Posted on March 09 2011 18:03
Ever wondered how to get some fresh files accessible by FreeAXP without a network connection like FTP, NFS or Samba ?

Using a disk image, is a somewhat cumbersome but effective method it seems.
I tried successfully with a backup container, a zip file and en executable (self extracting zip).
Startup FreeEXP in the configuration screen; point a free device to the file to be imported; Boot FreeAXP; mount/foreign the new device; and copy blocks into a file!

A tricky part was that best I know there is no native OpenVMS tool to copy using Logical Block IO. So I wrote a tool. See below.
(sorry, the
...


tags still drop spaces. Sent Email!)

The cumbersome part is that a config/reboot is needed.
I don't suppose we can dynamically alter the mapping.

The buggy part was that the image is presented as truncated down to 512 bytes blocks. Fine for EXE and BCK files, not so good for ZIP.

Would it be desirable for FreeAXP to round up to the next full 512 rather then truncate? I don't know. It may cause an IO error when the last block is tried to be read. Physically add null bytes to round up?

The workaround I used for this was to APPEND some bytes to the file to fill out the last block, using ECHO or PERL. For example:

# echo "nou, eens ff kijken of we er een blockje bij kunnen toveren" >> test.zip

or

# perl -e "print q(*)x511" >> test.zip

This made it all work for me.

Now if only we had a simple ODS2 & ODS5 non-shared file manipulation tool on Windoze! Just delete and copy in and out to start with. No directory create or growth for starters. INDEXF, BITMAP...

The inverse, export process would be harder as one would need to sufficiently pre-allocate the target. Still, it coudl be a viable method to get for example a somewhat predictable SYSDUMP.DMP file of the system.

Comments?
Hein



$ type COPY_LBN_SIMPLE.C

// copy_lbn_simple.c Hein van den Heuvel, March 2011,
// HvdH Performance Consulting
// A more complete version with statistics, selectable buffers sizes
// and more feature is available. Working on double buffering.

# define DEFAULT_BLOCKS 128

#define __NEW_STARLET
#include rms
#include iodef
#include dvidef
#include prvdef
#include syidef
#include string
#include stdio

__align (8) char io_buffer [ DEFAULT_BLOCKS * 512 ];

int sys$create(), sys$connect(), sys$write(), sys$close();
int sys$assign(), sys$getdviw(), sys$qiow(), sys$setprv();

struct RAB64 rab;
struct FAB fab;

main(int argc, char *argv[]) {


unsigned int privs[] = { PRV$M_LOG_IO, 0}, prvprv[2],
status, mounted, blocks_left, channel = 0, lbn = 0,
io_size = DEFAULT_BLOCKS*512,
blocks_per_io = DEFAULT_BLOCKS;

struct { short status, byte_count_low, byte_count_hi, mbz; } iosb;
struct { long count; void *address; } devnam_desc;
struct { short len, cod; void *address; int *retlen; }
getdvi_items[] = { 4, DVI$_MAXBLOCK, &blocks_left, 0,
4, DVI$_MNT, &mounted, 0, 0,0,0,0};

// Set up FAB and RAB for FIXED Length 512 Byte output file and large buffers

fab = cc$rms_fab;
rab = cc$rms_rab64;

fab.fab$b_fac = FAB$M_PUT | FAB$M_BIO ;
fab.fab$w_mrs = 512;
fab.fab$b_rfm = FAB$C_FIX;

rab.rab64$l_fab = (void *) &fab;
rab.rab64$l_rop = RAB$M_BIO;
rab.rab64$l_rbf = (char *) -1;
rab.rab64$l_ubf = (char *) -1;
rab.rab64$pq_rbf = (void *) io_buffer;
rab.rab64$q_rsz = io_size;

// Check for arguments and grab privs.

if (argc < 3 ) {
fprintf (stderr, "Usage: %s <input_device:> <output_file>\n", argv[0]);
return 268435472;
}

status = sys$setprv ( 1, privs, 0, prvprv);
if (!(status == 1) &&
((privs[0] & prvprv[0]) != privs[0])) { // SS$_NOTALLPRIV = 1665
fprintf (stderr, "Sorry, could not get required LOG_IO privilege.\n");
return status;
}

// Get a channel for QIO access, and obtain target size

devnam_desc.address = argv[1];
devnam_desc.count = strlen (argv[1]);
status=sys$assign(&devnam_desc,&channel,0,0,0);
if (status&1) status = sys$getdviw(0, channel,
0, getdvi_items, &iosb, 0,0 ,0 ,0);
if (!(status & 1)) return (status);
if ( !blocks_left || !mounted ) { // Needs, to be at least FOREIGN mounted.
fprintf (stderr, "%d blocks, device is %s mounted.\n",
blocks_left, (mounted)? "" : "NOT" );
return 124; // %SYSTEM-F-DEVNOTMOUNT, device is not mounted
}

// Create output file with initial size

fab.fab$l_fna = argv[2];
fab.fab$b_fns = strlen( argv[2] );
fab.fab$l_alq = blocks_left;
status = sys$create ( &fab);
if (status & 1) status = sys$connect ( &rab);

// Loop reading and writing while all is well and something left to copy

while (blocks_left && status & 1) {

if (blocks_left < blocks_per_io) {
blocks_per_io = blocks_left;
io_size = blocks_per_io * 512;
rab.rab64$q_rsz = io_size;
}


// Read and write IO

status = sys$qiow(0, channel, IO$_READLBLK, &iosb,
0,0, io_buffer, io_size, lbn, 0,0,0);

if (status & 1) status = iosb.status;
if (status & 1) {
status = sys$write ( &rab );
if (status & 1) {
lbn += blocks_per_io;
blocks_left -= blocks_per_io;

// Read and Write Error handling

} else {
printf ("SYS$WRITE error %d after %d blocks read at LBN %d\n",
status, blocks_per_io, lbn);
}
} else {
printf ("QIO LBN READ error %d for %d blocks read at LBN %d\n",
status, blocks_per_io, lbn);
}
}

// All done

if (status & 1) status = sys$close (&fab);
return (status);
}






Hein van den Heuvel
HvdH Performance Consulting
firstnamelastname.gmail.com
Author RE: Importing raw files by faking as disk images
Hein
Member

Posts: 15
Joined: 02.02.07
Posted on March 09 2011 18:07
that was kinda stupid of me...

I tried to write a comment line with the tags for code |code| and un-code |\code| in there topic. I used the boxes, not bars, and of course they took effect.

Oh well... Hein



Hein van den Heuvel
HvdH Performance Consulting
firstnamelastname.gmail.com
Author RE: Importing raw files by faking as disk images
malmberg
Moderator

Posts: 464
Joined: 15.04.08
Posted on March 10 2011 12:36
There is a tool on the freeware to read ODS-2 disks on Microsoft Windows.

Could this be modified to create a simple ODS-2 volume populated with a single file?
Author RE: Importing raw files by faking as disk images
Hein
Member

Posts: 15
Joined: 02.02.07
Posted on March 10 2011 18:57
Along the same lines I was thinking of checking out whether DFU code could be re-used. It knows ODS and knows to find files. That would be useful to grab files from you FreeAXP drives without booting it.

To get a single file there, I suspect that my hokey method is only slight more cumbersome than an full OpenVMS - ODS 2/5 writer on windows.

In order to write you would need access to the container file which you can not, nor should not, get while FreeAXP is running.
So to push a file there you need to shutdown, copy with special tool and reboot.
My method is to shutdown, point to target, reboot, and copy with other special tool.

A tool to truly manipulate files between windows and an ODS image would be neato.

Hein


Hein van den Heuvel
HvdH Performance Consulting
firstnamelastname.gmail.com
Author RE: Importing raw files by faking as disk images
iamcamiel
Moderator

User Avatar

Posts: 22
Location: Wageningen, The Netherlands
Joined: 06.04.08
Posted on March 11 2011 02:21
Hi Hein,

Interesting approach...

We're rounding down the filesize, because if the image file contains a filesystem, or if you'd like to create a filesystem on it, the OS expects every byte of every block to be there (readable and writeable).

While I can see that rounding up would be helpful in your situation, I wouldn't want to change the current default behavior. What we could do is add a configuration file parameter that will let the emulator do that.
http://sourceforge.net/projects/es40
Jump to Forum:
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Member Poll
Are you going to OpenVMS Boot Camp 2016?

Yes

No

You must login to vote.
Shoutbox
You must login to post a message.

malmberg
June 26 2018
https://www.openvmshobbyi
st.com/forum/viewthread.p
hp?forum_id=10&thread_id=
2363


bhamakripa
June 24 2018
I am trying OpenVMS via SIMH. Need to get OS binaries for v7.3. Registered here but don't have any membership number yet which is needed to get license. Pls suggest what to do. I hardly know anyth

basilh
June 05 2018
Any other forum members in Perth, Australia?

LouF91
April 05 2018
ah maybe they love that!

malmberg
March 24 2018
Probably. More people hang out on the comp.os.vms newsgroup.

vaxpert
March 23 2018
I have a PE42A and other Alpha system stuff for sale. I'm in So California. Any interest out there?

goodbyespy
February 27 2018
To Prohorenko. Please, visit group OpenVMS in the ok.ru

peteherrera
February 24 2018
How much does it cost to buy a complete OpenVMS hardcopy documentation set of the latest version

prohorenko
February 17 2018
Please help to obtain the license on OpenVMS

malmberg
December 12 2017
HPE only makes the most current version of OpenVMS Alpha / IA64 /VAX available to hobbyists. When I had access to the Alliance 1 program it was the same. No public downloads are allowed by HPE.

nmbonao
December 08 2017
Is anybody knows OpenVMS 8.2 version downloadable version? or CD copy? Thank you very much

aarommes
December 02 2017
Bitcoin and Blockchain enthusiasts ( plus distributed computing ) please connec / reply: http://www.openvmshobbyis
t.com/forum/viewthread.ph
p?forum_id=130&thread_id=
2991


malmberg
September 10 2017
https://sourceforge.net/p
/vms-ports/wiki/VMSInstal
lation/ For the most part just use VMS 6.1 media instead of 7.3. But why run the older release?


DoeveR
August 07 2017
Where can I find the write up on running VMS 6.1 using the simh emulator?

Bart
March 20 2017
Happy to have found my password again!

Shoutbox Archive