From edd15150f34b040d5ab68a1b418705c0de895a1e Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Sat, 20 Jun 2026 20:00:32 -0500 Subject: Re-arrange patch files Some of the patches are applied to files in subdirectories of ::/Kernel and ::/Adam. The directory tree has been re-arranged in such a way as to allow them to be #included without having the compiler backtrack to their parent directory. --- Adam/ABlkDev/Patches/Mount2CaseAFDC.HC | 80 ++++++++++++++++++++++++++++++ Adam/ABlkDev/Patches/Mount2CaseBFDC.HC | 22 ++++++++ Adam/ABlkDev/Patches/Mount2LtrsFDC.HC | 14 ++++++ Adam/ABlkDev/Patches/Mount2VarsFDC.HC | 10 ++++ Adam/ABlkDev/Patches/Mount2VarsFDC2.HC | 7 +++ Adam/Patches/Mount2CaseAFDC.HC | 80 ------------------------------ Adam/Patches/Mount2CaseBFDC.HC | 22 -------- Adam/Patches/Mount2LtrsFDC.HC | 14 ------ Adam/Patches/Mount2VarsFDC.HC | 10 ---- Adam/Patches/Mount2VarsFDC2.HC | 7 --- Kernel/BlkDev/Patches/BlkDevAddFDC.HC | 28 +++++++++++ Kernel/BlkDev/Patches/BlkDevInitFDC.HC | 8 +++ Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC | 22 ++++++++ Kernel/Patches/BlkDevAddFDC.HC | 28 ----------- Kernel/Patches/BlkDevInitFDC.HC | 8 --- Kernel/Patches/Let2BlkDevTypeFDC.HC | 22 -------- 16 files changed, 191 insertions(+), 191 deletions(-) create mode 100644 Adam/ABlkDev/Patches/Mount2CaseAFDC.HC create mode 100644 Adam/ABlkDev/Patches/Mount2CaseBFDC.HC create mode 100644 Adam/ABlkDev/Patches/Mount2LtrsFDC.HC create mode 100644 Adam/ABlkDev/Patches/Mount2VarsFDC.HC create mode 100644 Adam/ABlkDev/Patches/Mount2VarsFDC2.HC delete mode 100644 Adam/Patches/Mount2CaseAFDC.HC delete mode 100644 Adam/Patches/Mount2CaseBFDC.HC delete mode 100644 Adam/Patches/Mount2LtrsFDC.HC delete mode 100644 Adam/Patches/Mount2VarsFDC.HC delete mode 100644 Adam/Patches/Mount2VarsFDC2.HC create mode 100644 Kernel/BlkDev/Patches/BlkDevAddFDC.HC create mode 100644 Kernel/BlkDev/Patches/BlkDevInitFDC.HC create mode 100644 Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC delete mode 100644 Kernel/Patches/BlkDevAddFDC.HC delete mode 100644 Kernel/Patches/BlkDevInitFDC.HC delete mode 100644 Kernel/Patches/Let2BlkDevTypeFDC.HC diff --git a/Adam/ABlkDev/Patches/Mount2CaseAFDC.HC b/Adam/ABlkDev/Patches/Mount2CaseAFDC.HC new file mode 100644 index 0000000..2e70791 --- /dev/null +++ b/Adam/ABlkDev/Patches/Mount2CaseAFDC.HC @@ -0,0 +1,80 @@ +// PATCH: Add the ability to configure floppy BlkDevs (part 1 of 2) +// FILE: ::/Adam/ABlkDev/Mount.HC +// TO INSTALL: #include this file at the end of the first switch statement. +// ADAM PATCH: Must be installed after kernel patches! + +case BDT_FLOPPY: + do { + "Include $PURPLE$0x$FG$ prefix.\nI/O Port Base:\n"; + GetS(base0_buf,STR_LEN); + } while (!Str2I64(base0_buf)) + do { + "Drv Num:\n"; + unit=GetChar-'0'; + } while (0<=unit<=3) + "If you have a 3.5-inch high-density (1.44 Meg)\n" + "floppy disk, there are some default params you can use.\n" + "Otherwise, you will need to set the manually (Intel's datasheet\n" + "for the 82077AA is very useful here).\n\n" + "Use default params "; + If (YorN) { + defaults=TRUE; + } else { + "The folowing parameters are used to configure the ctrlr:\n" + "Most can be entered in either decimal or hex, but the head\n" + "count, sector size, and data rate take single decimal digits.\n" + do { + "Cylinders:\n"; + GetS(cyl_buf,STR_LEN); + } while (!Str2I64(cyl_buf)); + do { + "Heads:\n"; + heads=GetChar-'0'; + } while (1<=heads<=2); + do { + "Sectors:\n"; + GetS(spt_buf,STR_LEN); + } while (0<=Str2I64(spt_buf)<=255); + do { + "Sector Size (128<base0=%s;",base0_buf); + DocPrint("bd->blk_size=128<<%d;",2); + DocPrint("bd->cyls=%s;bd->heads=%d;bd->spt=%s;","80",2,"18"); + DocPrint("bd->srt=%s;bd->hut=%s;bd->hlt=%s;","13","5","0"); + DocPrint("bd->bps=%d;bd->gpl1=%s;bd->gpl2=%s",0,"27","124"); + DocPrint("bd->dtl=%s","255"); + } else { + DocPrint("bd->base0=%s;",base0_buf); + DocPrint("bd->blk_size=128<<%d;",size); + DocPrint("bd->cyls=%s;bd->heads=%d;bd->spt=%s;",cyl_buf,heads,spt_buf); + DocPrint("bd->srt=%s;bd->hut=%s;bd->hlt=%s;",srt_buf,hut_buf,hlt_buf); + DocPrint("bd->bps=%d;bd->gpl1=%s;bd->gpl2=%s",bps,gpl1_buf,gpl2_buf); + DocPrint("bd->dtl=%s",dtl_buf); + } \ No newline at end of file diff --git a/Adam/ABlkDev/Patches/Mount2LtrsFDC.HC b/Adam/ABlkDev/Patches/Mount2LtrsFDC.HC new file mode 100644 index 0000000..5325350 --- /dev/null +++ b/Adam/ABlkDev/Patches/Mount2LtrsFDC.HC @@ -0,0 +1,14 @@ +// PATCH: Update ltr lst to reflect remapping of drv ltrs +// FILE: ::/Adam/ABlkDev/Mount.HC +// TO INSTALL: Comment out the original Print call. +// THEN: #include this file after it. +// ADAM PATCH: Must be installed after kernel patches! + +"\n****** Mount Drives ******\n" + "$GREEN$A$FG$-$GREEN$B$FG$ are RAM drives.\n" + "$GREEN$C$FG$-$GREEN$L$FG$ are ATA hard drives.\n" + "$GREEN$M$FG$-$GREEN$P$FG$ are ISO file read drives.\n" + "$GREEN$Q$FG$-$GREEN$S$FG$ are ISO file write drives.\n" + "$GREEN$T$FG$-$GREEN$V$FG$ are ATAPI CD/DVD drives.\n" + "$GREEN$W$FG$-$GREEN$Z$FG$ are floppy drives.\n" + "\nDrive Letter ($PURPLE$$FG$ to exit):"; \ No newline at end of file diff --git a/Adam/ABlkDev/Patches/Mount2VarsFDC.HC b/Adam/ABlkDev/Patches/Mount2VarsFDC.HC new file mode 100644 index 0000000..d6e4a0e --- /dev/null +++ b/Adam/ABlkDev/Patches/Mount2VarsFDC.HC @@ -0,0 +1,10 @@ +// PATCH: Add more U8 bufs for floppy configuration +// FILE: ::/Adam/ABlkDev/Mount.HC +// TO INSTALL: Comment out the original declaration. +// THEN: #include this file after it. +// ADAM PATCH: Must be installed after kernel patches! + +U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN], + cyl_buf[STR_LEN],heads,spt_buf[STR_LEN],size,srt_buf[STR_LEN], + hut_buf[STR_LEN],hlt_buf[STR_LEN],bps,gpl1_buf[STR_LEN], + gpl2_buf[STR_LEN],dtl_buf[STR_LEN]*filename=NULL,*filename2=NULL,res=0; \ No newline at end of file diff --git a/Adam/ABlkDev/Patches/Mount2VarsFDC2.HC b/Adam/ABlkDev/Patches/Mount2VarsFDC2.HC new file mode 100644 index 0000000..d148a83 --- /dev/null +++ b/Adam/ABlkDev/Patches/Mount2VarsFDC2.HC @@ -0,0 +1,7 @@ +// PATCH: Add two new Bools for floppy configuration +// FILE: ::/Adam/ABlkDev/Mount.HC +// TO INSTALL: Comment out the old Bool declaration. +// THEN: #include this file after it. +// ADAM PATCH: Must be installed after kernel patches! + +Bool whole_drv,make_free,defaults=FALSE; \ No newline at end of file diff --git a/Adam/Patches/Mount2CaseAFDC.HC b/Adam/Patches/Mount2CaseAFDC.HC deleted file mode 100644 index 2e70791..0000000 --- a/Adam/Patches/Mount2CaseAFDC.HC +++ /dev/null @@ -1,80 +0,0 @@ -// PATCH: Add the ability to configure floppy BlkDevs (part 1 of 2) -// FILE: ::/Adam/ABlkDev/Mount.HC -// TO INSTALL: #include this file at the end of the first switch statement. -// ADAM PATCH: Must be installed after kernel patches! - -case BDT_FLOPPY: - do { - "Include $PURPLE$0x$FG$ prefix.\nI/O Port Base:\n"; - GetS(base0_buf,STR_LEN); - } while (!Str2I64(base0_buf)) - do { - "Drv Num:\n"; - unit=GetChar-'0'; - } while (0<=unit<=3) - "If you have a 3.5-inch high-density (1.44 Meg)\n" - "floppy disk, there are some default params you can use.\n" - "Otherwise, you will need to set the manually (Intel's datasheet\n" - "for the 82077AA is very useful here).\n\n" - "Use default params "; - If (YorN) { - defaults=TRUE; - } else { - "The folowing parameters are used to configure the ctrlr:\n" - "Most can be entered in either decimal or hex, but the head\n" - "count, sector size, and data rate take single decimal digits.\n" - do { - "Cylinders:\n"; - GetS(cyl_buf,STR_LEN); - } while (!Str2I64(cyl_buf)); - do { - "Heads:\n"; - heads=GetChar-'0'; - } while (1<=heads<=2); - do { - "Sectors:\n"; - GetS(spt_buf,STR_LEN); - } while (0<=Str2I64(spt_buf)<=255); - do { - "Sector Size (128<base0=%s;",base0_buf); - DocPrint("bd->blk_size=128<<%d;",2); - DocPrint("bd->cyls=%s;bd->heads=%d;bd->spt=%s;","80",2,"18"); - DocPrint("bd->srt=%s;bd->hut=%s;bd->hlt=%s;","13","5","0"); - DocPrint("bd->bps=%d;bd->gpl1=%s;bd->gpl2=%s",0,"27","124"); - DocPrint("bd->dtl=%s","255"); - } else { - DocPrint("bd->base0=%s;",base0_buf); - DocPrint("bd->blk_size=128<<%d;",size); - DocPrint("bd->cyls=%s;bd->heads=%d;bd->spt=%s;",cyl_buf,heads,spt_buf); - DocPrint("bd->srt=%s;bd->hut=%s;bd->hlt=%s;",srt_buf,hut_buf,hlt_buf); - DocPrint("bd->bps=%d;bd->gpl1=%s;bd->gpl2=%s",bps,gpl1_buf,gpl2_buf); - DocPrint("bd->dtl=%s",dtl_buf); - } \ No newline at end of file diff --git a/Adam/Patches/Mount2LtrsFDC.HC b/Adam/Patches/Mount2LtrsFDC.HC deleted file mode 100644 index 5325350..0000000 --- a/Adam/Patches/Mount2LtrsFDC.HC +++ /dev/null @@ -1,14 +0,0 @@ -// PATCH: Update ltr lst to reflect remapping of drv ltrs -// FILE: ::/Adam/ABlkDev/Mount.HC -// TO INSTALL: Comment out the original Print call. -// THEN: #include this file after it. -// ADAM PATCH: Must be installed after kernel patches! - -"\n****** Mount Drives ******\n" - "$GREEN$A$FG$-$GREEN$B$FG$ are RAM drives.\n" - "$GREEN$C$FG$-$GREEN$L$FG$ are ATA hard drives.\n" - "$GREEN$M$FG$-$GREEN$P$FG$ are ISO file read drives.\n" - "$GREEN$Q$FG$-$GREEN$S$FG$ are ISO file write drives.\n" - "$GREEN$T$FG$-$GREEN$V$FG$ are ATAPI CD/DVD drives.\n" - "$GREEN$W$FG$-$GREEN$Z$FG$ are floppy drives.\n" - "\nDrive Letter ($PURPLE$$FG$ to exit):"; \ No newline at end of file diff --git a/Adam/Patches/Mount2VarsFDC.HC b/Adam/Patches/Mount2VarsFDC.HC deleted file mode 100644 index d6e4a0e..0000000 --- a/Adam/Patches/Mount2VarsFDC.HC +++ /dev/null @@ -1,10 +0,0 @@ -// PATCH: Add more U8 bufs for floppy configuration -// FILE: ::/Adam/ABlkDev/Mount.HC -// TO INSTALL: Comment out the original declaration. -// THEN: #include this file after it. -// ADAM PATCH: Must be installed after kernel patches! - -U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN], - cyl_buf[STR_LEN],heads,spt_buf[STR_LEN],size,srt_buf[STR_LEN], - hut_buf[STR_LEN],hlt_buf[STR_LEN],bps,gpl1_buf[STR_LEN], - gpl2_buf[STR_LEN],dtl_buf[STR_LEN]*filename=NULL,*filename2=NULL,res=0; \ No newline at end of file diff --git a/Adam/Patches/Mount2VarsFDC2.HC b/Adam/Patches/Mount2VarsFDC2.HC deleted file mode 100644 index d148a83..0000000 --- a/Adam/Patches/Mount2VarsFDC2.HC +++ /dev/null @@ -1,7 +0,0 @@ -// PATCH: Add two new Bools for floppy configuration -// FILE: ::/Adam/ABlkDev/Mount.HC -// TO INSTALL: Comment out the old Bool declaration. -// THEN: #include this file after it. -// ADAM PATCH: Must be installed after kernel patches! - -Bool whole_drv,make_free,defaults=FALSE; \ No newline at end of file diff --git a/Kernel/BlkDev/Patches/BlkDevAddFDC.HC b/Kernel/BlkDev/Patches/BlkDevAddFDC.HC new file mode 100644 index 0000000..1f9e75a --- /dev/null +++ b/Kernel/BlkDev/Patches/BlkDevAddFDC.HC @@ -0,0 +1,28 @@ +// PATCH: Add the ability to create floppy drvs +// FILE: ::/Kernel/BlkDev/DskAddDev.HC +// TO INSTALL: #include this file at the end of the switch statement. + +case BDT_FLOPPY: + dv->dv_signature=DRV_SIGNATURE_VAL; + if (!BlkDevInit(bd)) + dv->dv_signature=0; + else { + dv->dv_signature=0; + if (make_free) + dv=DrvMakeFreeSlot(bd->first_drive_let); + else + dv=DrvMakeFreeSlot(DrvNextFreeLet(bd->first_drive_let)) + if (bd->heads!=FDCChk(bd)) + dv->fs_type=FSt_UNKNOWN; + else { + FDCReadBlks(bd,&br,0,1); + if (br.signature==MBR_PT_REDSEA && br.signature2==0xAA55) { + dv->dv_signature=DRV_SIGNATURE_VAL; + dv->bd=bd; + dv->fs_type=FSt_REDSEA; + RedSeaInit(dv); + } else + dv->fs_type=FSt_UNKNOWN; + } + } + break; \ No newline at end of file diff --git a/Kernel/BlkDev/Patches/BlkDevInitFDC.HC b/Kernel/BlkDev/Patches/BlkDevInitFDC.HC new file mode 100644 index 0000000..630bad8 --- /dev/null +++ b/Kernel/BlkDev/Patches/BlkDevInitFDC.HC @@ -0,0 +1,8 @@ +// PATCH: Add the ability to init floppy BlkDevs +// FILE: ::/Kernel/BlkDev/DskBlkDev.HC +// TO INSTALL: #include this file at the end of the switch statement. + +case BDT_FLOPPY: + bd->max_writes=bd->max_reads=bd->spt; + res=FDCInit(bd); + break; \ No newline at end of file diff --git a/Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC b/Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC new file mode 100644 index 0000000..be31e7f --- /dev/null +++ b/Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC @@ -0,0 +1,22 @@ +// PATCH: Remaps ltrs W-Z for floppy drives +// FILE: ::/Kernel/BlkDev/DskDrv.HC +// TO INSTALL: Comment out the original function. +// THEN: #include this file after it. + +I64 Let2BlkDevType(U8 drv_let) +{//Drv letter to BlkDev Type. drv_let=0 not allowed. See BDT_NULL. + drv_let=Let2Let(drv_let); + if ('A'<=drv_let<='B') + return BDT_RAM; + if ('C'<=drv_let<='L') + return BDT_ATA; + if ('M'<=drv_let<='P') + return BDT_ISO_FILE_READ; + if ('Q'<=drv_let<='S') + return BDT_ISO_FILE_WRITE; + if ('T'<=drv_let<='V') + return BDT_ATAPI; + if ('W'<=drv_let<='Z') + return BDT_FLOPPY; + return BDT_NULL; +} \ No newline at end of file diff --git a/Kernel/Patches/BlkDevAddFDC.HC b/Kernel/Patches/BlkDevAddFDC.HC deleted file mode 100644 index 1f9e75a..0000000 --- a/Kernel/Patches/BlkDevAddFDC.HC +++ /dev/null @@ -1,28 +0,0 @@ -// PATCH: Add the ability to create floppy drvs -// FILE: ::/Kernel/BlkDev/DskAddDev.HC -// TO INSTALL: #include this file at the end of the switch statement. - -case BDT_FLOPPY: - dv->dv_signature=DRV_SIGNATURE_VAL; - if (!BlkDevInit(bd)) - dv->dv_signature=0; - else { - dv->dv_signature=0; - if (make_free) - dv=DrvMakeFreeSlot(bd->first_drive_let); - else - dv=DrvMakeFreeSlot(DrvNextFreeLet(bd->first_drive_let)) - if (bd->heads!=FDCChk(bd)) - dv->fs_type=FSt_UNKNOWN; - else { - FDCReadBlks(bd,&br,0,1); - if (br.signature==MBR_PT_REDSEA && br.signature2==0xAA55) { - dv->dv_signature=DRV_SIGNATURE_VAL; - dv->bd=bd; - dv->fs_type=FSt_REDSEA; - RedSeaInit(dv); - } else - dv->fs_type=FSt_UNKNOWN; - } - } - break; \ No newline at end of file diff --git a/Kernel/Patches/BlkDevInitFDC.HC b/Kernel/Patches/BlkDevInitFDC.HC deleted file mode 100644 index 630bad8..0000000 --- a/Kernel/Patches/BlkDevInitFDC.HC +++ /dev/null @@ -1,8 +0,0 @@ -// PATCH: Add the ability to init floppy BlkDevs -// FILE: ::/Kernel/BlkDev/DskBlkDev.HC -// TO INSTALL: #include this file at the end of the switch statement. - -case BDT_FLOPPY: - bd->max_writes=bd->max_reads=bd->spt; - res=FDCInit(bd); - break; \ No newline at end of file diff --git a/Kernel/Patches/Let2BlkDevTypeFDC.HC b/Kernel/Patches/Let2BlkDevTypeFDC.HC deleted file mode 100644 index be31e7f..0000000 --- a/Kernel/Patches/Let2BlkDevTypeFDC.HC +++ /dev/null @@ -1,22 +0,0 @@ -// PATCH: Remaps ltrs W-Z for floppy drives -// FILE: ::/Kernel/BlkDev/DskDrv.HC -// TO INSTALL: Comment out the original function. -// THEN: #include this file after it. - -I64 Let2BlkDevType(U8 drv_let) -{//Drv letter to BlkDev Type. drv_let=0 not allowed. See BDT_NULL. - drv_let=Let2Let(drv_let); - if ('A'<=drv_let<='B') - return BDT_RAM; - if ('C'<=drv_let<='L') - return BDT_ATA; - if ('M'<=drv_let<='P') - return BDT_ISO_FILE_READ; - if ('Q'<=drv_let<='S') - return BDT_ISO_FILE_WRITE; - if ('T'<=drv_let<='V') - return BDT_ATAPI; - if ('W'<=drv_let<='Z') - return BDT_FLOPPY; - return BDT_NULL; -} \ No newline at end of file -- cgit v1.2.3