diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2019-02-04 13:09:03 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2019-02-04 13:09:03 +0100 |
commit | 04e68443040c7abad84d66477e98f93bed701760 (patch) | |
tree | 2b6202afae659e773bf6916157d23e83edfa44e3 /app/baisy/2.2.1-schulis/src/block i-o | |
download | eumel-src-04e68443040c7abad84d66477e98f93bed701760.tar.gz eumel-src-04e68443040c7abad84d66477e98f93bed701760.tar.bz2 eumel-src-04e68443040c7abad84d66477e98f93bed701760.zip |
Initial import
Diffstat (limited to 'app/baisy/2.2.1-schulis/src/block i-o')
-rw-r--r-- | app/baisy/2.2.1-schulis/src/block i-o | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/app/baisy/2.2.1-schulis/src/block i-o b/app/baisy/2.2.1-schulis/src/block i-o new file mode 100644 index 0000000..6ac925d --- /dev/null +++ b/app/baisy/2.2.1-schulis/src/block i-o @@ -0,0 +1,52 @@ +PACKET diskblockioDEFINES readdiskblock,readdiskblockandcloseworkiferror, +readdiskcluster,writediskblock,writediskblockandcloseworkiferror, +writediskcluster,firstnondummydspage,blocknodumpmodus:BOOL VAR +blocknodumpflag:=FALSE ;LET writenormal=0;INT CONST firstnondummydspage:=2; +INT VAR error;PROC readdiskblock(DATASPACE VAR ds,INT CONST dspageno,INT +CONST blockno):IF blocknodumpflagTHEN dump("READ ",blockno)FI ;checkrerun; +readblock(ds,dspageno,eublock(blockno),error);IF error>0THEN lesefehler(error +)FI .END PROC readdiskblock;PROC readdiskblock(DATASPACE VAR ds,INT CONST +dspageno,REAL CONST blockno):IF blocknodumpflagTHEN dump("READ ",blockno)FI ; +checkrerun;readblock(ds,dspageno,eublock(blockno),error);IF error>0THEN +lesefehler(error)FI .END PROC readdiskblock;PROC +readdiskblockandcloseworkiferror(DATASPACE VAR ds,INT CONST dspageno,INT +CONST blockno):IF blocknodumpflagTHEN dump("READ ",blockno)FI ;checkrerun; +readblock(ds,dspageno,eublock(blockno),error);IF error>0THEN closework; +lesefehler(error)FI .END PROC readdiskblockandcloseworkiferror;PROC +readdiskblockandcloseworkiferror(DATASPACE VAR ds,INT CONST dspageno,REAL +CONST blockno):IF blocknodumpflagTHEN dump("READ ",blockno)FI ;checkrerun; +readblock(ds,dspageno,eublock(blockno),error);IF error>0THEN closework; +lesefehler(error)FI .END PROC readdiskblockandcloseworkiferror;PROC +readdiskcluster(DATASPACE VAR ds,INT CONST firstdspageno,REAL CONST clusterno +):IF blocknodumpflagTHEN dump("CLUSTER ",clusterno)FI ;INT VAR i;FOR iFROM 0 +UPTO sectorspercluster-1REP readdiskblock(ds,firstdspageno+i,blockno+real(i)) +PER .blockno:beginofcluster(clusterno).END PROC readdiskcluster;PROC +lesefehler(INT CONST fehlercode):errorstop(fehlertext).fehlertext:SELECT +fehlercodeOF CASE 1:"Diskettenlaufwerk nicht betriebsbereit"CASE 2: +"Lesefehler"OTHERWISE "Lesefehler "+text(fehlercode)END SELECT .END PROC +lesefehler;PROC writediskblock(DATASPACE CONST ds,INT CONST dspageno,INT +CONST blockno):IF blocknodumpflagTHEN dump("WRITE",blockno)FI ;checkrerun; +writeblock(ds,dspageno,writenormal,eublock(blockno),error);IF error>0THEN +schreibfehler(error)FI .END PROC writediskblock;PROC writediskblock( +DATASPACE CONST ds,INT CONST dspageno,REAL CONST blockno):IF blocknodumpflag +THEN dump("WRITE",blockno)FI ;checkrerun;writeblock(ds,dspageno,writenormal, +eublock(blockno),error);IF error>0THEN schreibfehler(error)FI .END PROC +writediskblock;PROC writediskblockandcloseworkiferror(DATASPACE CONST ds,INT +CONST dspageno,INT CONST blockno):IF blocknodumpflagTHEN dump("WRITE",blockno +)FI ;checkrerun;writeblock(ds,dspageno,writenormal,eublock(blockno),error); +IF error>0THEN closework;schreibfehler(error)FI .END PROC +writediskblockandcloseworkiferror;PROC writediskblockandcloseworkiferror( +DATASPACE CONST ds,INT CONST dspageno,REAL CONST blockno):IF blocknodumpflag +THEN dump("WRITE",blockno)FI ;checkrerun;writeblock(ds,dspageno,writenormal, +eublock(blockno),error);IF error>0THEN closework;schreibfehler(error)FI .END +PROC writediskblockandcloseworkiferror;PROC writediskcluster(DATASPACE CONST +ds,INT CONST firstdspageno,REAL CONST clusterno):IF blocknodumpflagTHEN dump( +"CLUSTER ",clusterno)FI ;INT VAR i;FOR iFROM 0UPTO sectorspercluster-1REP +writediskblock(ds,firstdspageno+i,blockno+real(i))PER .blockno:beginofcluster +(clusterno).END PROC writediskcluster;PROC schreibfehler(INT CONST fehlercode +):errorstop(fehlertext).fehlertext:SELECT fehlercodeOF CASE 1: +"Diskettenlaufwerk nicht betriebsbereit"CASE 2:"Schreibfehler"OTHERWISE +"Schreibfehler "+text(fehlercode)END SELECT .END PROC schreibfehler;PROC +blocknodumpmodus(BOOL CONST status):blocknodumpflag:=statusEND PROC +blocknodumpmodus;END PACKET diskblockio; + |