This is my try to generate a VII data file from DOS.
It doesn't work currently. Perhaps anybody can tell me why.

Source Code appended (TP6)


----CUT -----
{ Quick'n Dirty Example to solve my problem (generating a ints.bin File
  in DOS) It failed :(
  Perhaps somebody can tell me why ..
  --------------------------------------
  You need Turbo Pascal 6
  Ansi C Programmers should also be able to read this source
}

Uses Crt;

Type Pointer_Rec = Record
                    Case Integer Of
                     0 : (address         : pointer);
                     1 : (offset, segment : word)
                    End;

Var F1,F2 : File;
    Buf   : Array[1..4000] Of Char;
    I     : Integer;
    B     : Byte;
    vector: Array [$00..$FF] of Pointer_Rec absolute $0000:0000;

Begin
 Assign(F1,'ints.bi2'); { The ints.bi2 file to be generated }
 Assign(F2,'ints.bin'); { The ints.bin file generatet with the bootdisk
method }
 ReWrite(F1,1);
 Reset(F2,1);
 BlockRead(F2,Buf,$CA); { Copy the initial Header }
 BlockWrite(F1,Buf,$CA);

 Buf[1]:='0'; Buf[2]:='5'; Buf[3]:='/'; Buf[4]:='0'; { Date of the bios
on my Palmtop }
 Buf[5]:='6'; Buf[6]:='/'; Buf[7]:='9'; Buf[8]:='3';
 Buf[9]:=Chr($0D); Buf[10]:=Chr($0A);
 BlockWrite(F1,Buf,10);
 B:=0;
 For I:=1 to 20 do BlockWrite(F1,B,1);
 BlockWrite(F1,Buf,8);

 For I:=$00 to $FF do { Copy the Interrupt Vectors }
 Begin
  BlockWrite(F1,Vector[i].Offset,2);
  BlockWrite(F1,Vector[i].Segment,2);
 End;

 Close(F2);
 Assign(F2,'ints.bin');
 Reset(F2,1);

 { Copy the rest from ints.bi2 (Don't know for what it's good }
 BlockRead(F2,Buf,Filesize(F2));
 BlockWrite(F1,Buf[$4F0],$5FF-$4EF);
 Close(F2);
 Close(F1);
End.

Makeint.pas

Reply via email to