Early partition table support

Adding infrastructure for partition table support.  Backward compatible.  Not ready for end user usage yet.

Bumped version to 3.1.1 to demarcate this change.
This commit is contained in:
Wayne Warthen
2020-05-03 19:05:44 -07:00
parent 74e79a6c59
commit ee0fac37f9
26 changed files with 2243 additions and 1075 deletions

View File

@@ -4,24 +4,24 @@ setlocal
echo.
echo Building Floppy Disk Images...
echo.
call BuildFD.cmd cpm22 ..\cpm22\cpm_wbw.sys
call BuildFD.cmd zsdos ..\zsdos\zsys_wbw.sys
call BuildFD.cmd nzcom ..\zsdos\zsys_wbw.sys
call BuildFD.cmd cpm3 ..\cpm3\cpmldr.sys
call BuildFD.cmd zpm3 ..\cpm3\cpmldr.sys
call BuildFD.cmd ws4
call BuildFD.cmd cpm22 wbw_fd144 ..\cpm22\cpm_wbw.sys
call BuildFD.cmd zsdos wbw_fd144 ..\zsdos\zsys_wbw.sys
call BuildFD.cmd nzcom wbw_fd144 ..\zsdos\zsys_wbw.sys
call BuildFD.cmd cpm3 wbw_fd144 ..\cpm3\cpmldr.sys
call BuildFD.cmd zpm3 wbw_fd144 ..\cpm3\cpmldr.sys
call BuildFD.cmd ws4 wbw_fd144
echo.
echo Building Hard Disk Images...
echo.
call BuildHD.cmd cpm22 ..\cpm22\cpm_wbw.sys
call BuildHD.cmd zsdos ..\zsdos\zsys_wbw.sys
call BuildHD.cmd nzcom ..\zsdos\zsys_wbw.sys
call BuildHD.cmd cpm3 ..\cpm3\cpmldr.sys
call BuildHD.cmd zpm3 ..\cpm3\cpmldr.sys
call BuildHD.cmd ws4
call BuildHD.cmd cpm22 wbw_hd0 ..\cpm22\cpm_wbw.sys
call BuildHD.cmd zsdos wbw_hd0 ..\zsdos\zsys_wbw.sys
call BuildHD.cmd nzcom wbw_hd0 ..\zsdos\zsys_wbw.sys
call BuildHD.cmd cpm3 wbw_hd0 ..\cpm3\cpmldr.sys
call BuildHD.cmd zpm3 wbw_hd0 ..\cpm3\cpmldr.sys
call BuildHD.cmd ws4 wbw_hd0
if exist ..\BPBIOS\bpbio-ww.rel call BuildHD.cmd bp
if exist ..\BPBIOS\bpbio-ww.rel call BuildHD.cmd bp wbw_hd
echo.
echo Building Combo Disk Image...

View File

@@ -1,10 +1,9 @@
#Param([Parameter(Mandatory)]$Disk, $SysFile="")
Param($Disk, $SysFile="")
Param($Disk, $Format="wbw_fd144", $SysFile="")
$ErrorAction = 'Stop'
$ImgFile = "fd_${Disk}.img"
$Fmt = "wbw_fd144"
$MediaID = 6
$Size = 1440KB
$CpmToolsPath = '../../Tools/cpmtools'
@@ -13,35 +12,31 @@ $env:PATH = $CpmToolsPath + ';' + $env:PATH
if (-not (Test-Path("d_${Disk}/")))
{
"Source directory d_${Disk} for disk ${Disk} not found!"
Write-Error "Source directory d_${Disk} for disk ${Disk} not found!" -ErrorAction Stop
return
}
"Generating Floppy Disk ${Disk}..."
#$Blank = ([string]([char]0xE5)) * $Size
#Set-Content -Value $Blank -NoNewLine -Path $ImgFile
$Blank = ([byte[]](0xE5) * $Size)
[System.IO.File]::WriteAllBytes($ImgFile, $Blank)
if ($SysFile.Length -gt 0)
{ [byte[]]$SysImg = [System.IO.File]::ReadAllBytes($SysFile) }
else
{ [byte[]]$SysImg = @() }
if ($SysFile.Length -gt 0)
{
"Adding System Image $SysFile..."
#$Sys = Get-Content -Path "$SysFile.sys" -Raw
#$Img = Get-Content -Path $ImgFile -Raw
#$NewImg = $Sys + $Img.SubString($Sys.Length, $Img.Length - $Sys.Length)
#Set-Content -NoNewLine -Path $ImgFile $NewImg
$Cmd = "mkfs.cpm -f $Fmt -b $SysFile $ImgFile"
$Cmd
Invoke-Expression $Cmd
}
$Image = ($SysImg + ([byte[]](0xE5) * ($Size - $SysImg.length)))
$Image[1410] = 0x4D
$Image[1411] = 0x49
$Image[1412] = 0x44
$Image[1413] = $MediaID
[System.IO.File]::WriteAllBytes($ImgFile, $Image)
for ($Usr=0; $Usr -lt 16; $Usr++)
{
if (Test-Path ("d_${Disk}/u${Usr}/*"))
{
$Cmd = "cpmcp -f $Fmt $ImgFile d_${Disk}/u${Usr}/*.* ${Usr}:"
$Cmd = "cpmcp -f $Format $ImgFile d_${Disk}/u${Usr}/*.* ${Usr}:"
$Cmd
Invoke-Expression $Cmd
}
@@ -54,7 +49,7 @@ if (Test-Path("d_${Disk}.txt"))
$Spec = $Line.Trim()
if (($Spec.Length -gt 0) -and ($Spec.Substring(0,1) -ne "#"))
{
$Cmd = "cpmcp -f $Fmt $ImgFile ${Spec}"
$Cmd = "cpmcp -f $Format $ImgFile ${Spec}"
$Cmd
Invoke-Expression $Cmd
}
@@ -63,7 +58,6 @@ if (Test-Path("d_${Disk}.txt"))
"Moving image $ImgFile into output directory..."
#&$env:COMSPEC /c move $ImgFile ..\..\Binary\
Move-Item $ImgFile -Destination "..\..\Binary\" -Force
return

View File

@@ -1,11 +1,21 @@
#Param([Parameter(Mandatory)]$Disk, $SysFile="")
Param($Disk, $SysFile="")
Param($Disk, $Format="wbw_hd_new", $SysFile="")
$ErrorAction = 'Stop'
$ImgFile = "hd_${Disk}.img"
$Fmt = "wbw_hd0"
$Size = (128KB * 65)
if ($Format -like "*_new")
{
# New hard disk format!!!
$MediaID = 10
$Size = 8 * 1MB
$ImgFile = "hd_${Disk}.bin"
}
else
{
# Legacy hard disk format
$MediaID = 4
$Size = 8320KB
$ImgFile = "hd_${Disk}.img"
}
$CpmToolsPath = '../../Tools/cpmtools'
@@ -13,35 +23,31 @@ $env:PATH = $CpmToolsPath + ';' + $env:PATH
if (-not (Test-Path("d_${Disk}/")))
{
"Source directory d_${Disk} for disk ${Disk} not found!"
Write-Error "Source directory d_${Disk} for disk ${Disk} not found!" -ErrorAction Stop
return
}
"Generating Hard Disk ${Disk}..."
#$Blank = ([string]([char]0xE5)) * $Size
#Set-Content -Value $Blank -NoNewLine -Path $ImgFile
$Blank = ([byte[]](0xE5) * $Size)
[System.IO.File]::WriteAllBytes($ImgFile, $Blank)
if ($SysFile.Length -gt 0)
{ [byte[]]$SysImg = [System.IO.File]::ReadAllBytes($SysFile) }
else
{ [byte[]]$SysImg = @() }
if ($SysFile.Length -gt 0)
{
"Adding System Image $SysFile..."
#$Sys = Get-Content -Path "$SysFile.sys" -Raw
#$Img = Get-Content -Path $ImgFile -Raw
#$NewImg = $Sys + $Img.SubString($Sys.Length, $Img.Length - $Sys.Length)
#Set-Content -NoNewLine -Path $ImgFile $NewImg
$Cmd = "mkfs.cpm -f $Fmt -b $SysFile $ImgFile"
$Cmd
Invoke-Expression $Cmd
}
$Image = ($SysImg + ([byte[]](0xE5) * ($Size - $SysImg.length)))
$Image[1410] = 0x4D
$Image[1411] = 0x49
$Image[1412] = 0x44
$Image[1413] = $MediaID
[System.IO.File]::WriteAllBytes($ImgFile, $Image)
for ($Usr=0; $Usr -lt 16; $Usr++)
{
if (Test-Path ("d_${Disk}/u${Usr}/*"))
{
$Cmd = "cpmcp -f $Fmt $ImgFile d_${Disk}/u${Usr}/*.* ${Usr}:"
$Cmd = "cpmcp -f $Format $ImgFile d_${Disk}/u${Usr}/*.* ${Usr}:"
$Cmd
Invoke-Expression $Cmd
}
@@ -54,7 +60,7 @@ if (Test-Path("d_${Disk}.txt"))
$Spec = $Line.Trim()
if (($Spec.Length -gt 0) -and ($Spec.Substring(0,1) -ne "#"))
{
$Cmd = "cpmcp -f $Fmt $ImgFile ${Spec}"
$Cmd = "cpmcp -f $Format $ImgFile ${Spec}"
$Cmd
Invoke-Expression $Cmd
}
@@ -63,7 +69,6 @@ if (Test-Path("d_${Disk}.txt"))
"Moving image $ImgFile into output directory..."
#&$env:COMSPEC /c move $ImgFile ..\..\Binary\
Move-Item $ImgFile -Destination "..\..\Binary\" -Force
return

View File

@@ -0,0 +1,40 @@
@echo off
setlocal
echo.
echo Building Floppy Disk Images...
echo.
call BuildFD.cmd cpm22 wbw_fd144 ..\cpm22\cpm_wbw.sys
call BuildFD.cmd zsdos wbw_fd144 ..\zsdos\zsys_wbw.sys
call BuildFD.cmd nzcom wbw_fd144 ..\zsdos\zsys_wbw.sys
call BuildFD.cmd cpm3 wbw_fd144 ..\cpm3\cpmldr.sys
call BuildFD.cmd zpm3 wbw_fd144 ..\cpm3\cpmldr.sys
call BuildFD.cmd ws4 wbw_fd144
echo.
echo Building Hard Disk Images...
echo.
call BuildHD.cmd cpm22 wbw_hd_new ..\cpm22\cpm_wbw.sys
call BuildHD.cmd zsdos wbw_hd_new ..\zsdos\zsys_wbw.sys
call BuildHD.cmd nzcom wbw_hd_new ..\zsdos\zsys_wbw.sys
call BuildHD.cmd cpm3 wbw_hd_new ..\cpm3\cpmldr.sys
call BuildHD.cmd zpm3 wbw_hd_new ..\cpm3\cpmldr.sys
call BuildHD.cmd ws4 wbw_hd_new
if exist ..\BPBIOS\bpbio-ww.rel call BuildHD.cmd bp wbw_hd_new
copy hd_prefix.dat ..\..\Binary\
echo.
echo Build Hard Disk Images...
copy /b hd_prefix.dat + ..\..\Binary\hd_cpm22.bin ..\..\Binary\hd_cpm22.img
copy /b hd_prefix.dat + ..\..\Binary\hd_zsdos.bin ..\..\Binary\hd_zsdos.img
copy /b hd_prefix.dat + ..\..\Binary\hd_nzcom.bin ..\..\Binary\hd_nzcom.img
copy /b hd_prefix.dat + ..\..\Binary\hd_cpm3.bin ..\..\Binary\hd_cpm3.img
copy /b hd_prefix.dat + ..\..\Binary\hd_zpm3.bin ..\..\Binary\hd_zpm3.img
copy /b hd_prefix.dat + ..\..\Binary\hd_ws4.bin ..\..\Binary\hd_ws4.img
if exist ..\..\Binary\hd_bp.bin copy /b hd_prefix.dat + ..\..\Binary\hd_bp.bin
echo.
echo Building Combo Disk Image...
copy /b hd_prefix.dat + ..\..\Binary\hd_cpm22.bin + ..\..\Binary\hd_zsdos.bin + ..\..\Binary\hd_nzcom.bin + ..\..\Binary\hd_cpm3.bin + ..\..\Binary\hd_zpm3.bin + ..\..\Binary\hd_ws4.bin ..\..\Binary\hd_combo.img

View File

@@ -5,12 +5,22 @@ SYSTEMS = ../CPM22/cpm_wbw.sys ../ZSDOS/zsys_wbw.sys ../CPM3/cpmldr.sys
FDIMGS = fd_cpm22.img fd_zsdos.img fd_nzcom.img \
fd_cpm3.img fd_zpm3.img fd_ws4.img
FDBIN = fd_cpm22.bin fd_zsdos.bin fd_nzcom.bin \
fd_cpm3.bin fd_zpm3.bin fd_ws4.bin
HDIMGS = hd_cpm22.img hd_zsdos.img hd_nzcom.img \
hd_cpm3.img hd_zpm3.img hd_ws4.img
HDBIN = hd_cpm22.bin hd_zsdos.bin hd_nzcom.bin \
hd_cpm3.bin hd_zpm3.bin hd_ws4.bin
# HDIMGS += hd_bp.img
# HDBIN += hd_bp.bin
OBJECTS = $(FDIMGS) $(HDIMGS) hd_combo.img
OTHERS = blank144 blankhd
HDPREFIX = # Legacy
#HDPREFIX = hd_prefix.dat # New
OBJECTS = $(FDIMGS) $(HDIMGS) hd_combo.img # Legacy
#OBJECTS = $(FDIMGS) $(HDIMGS) $(HDBIN) hd_combo.img # New
OTHERS = blank144 blankhd $(FDBIN) $(HDBIN)
DEST=../../Binary
@@ -19,8 +29,8 @@ include $(TOOLS)/Makefile.inc
DIFFPATH = $(DIFFTO)/Binary
hd_combo.img: $(HDIMGS)
cat $(HDIMGS) > $@
hd_combo.img: $(HDPREFIX) $(HDBIN)
cat $^ > $@
#
# this somewhat impenetrable and fragile code is used to build each of the images
@@ -30,17 +40,28 @@ hd_combo.img: $(HDIMGS)
# then process the d_{d}.txt file, copying in those files, and finally maybe put
# an OS at the start of each image
#
blank144:
@echo Making Blank Floppy of size 1440k
@LANG=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=1440 2>/dev/null
HDSIZE := $(shell expr 128 '*' 65)
FDSIZE := 1440
blank144:
@echo Making Blank Floppy of size $(FDSIZE)k
@LC_CTYPE=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(FDSIZE) 2>/dev/null
HDSIZE := 8320 # Legacy
#HDSIZE := 8192 # New
blankhd:
@echo Making Blank Hd of size $(HDSIZE)k
@LANG=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HDSIZE) 2>/dev/null
@LC_CTYPE=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HDSIZE) 2>/dev/null
%.img: %.bin
@if echo $@ | grep -q ^f ; then \
cat $< > $@ ; \
else \
cat $(HDPREFIX) $< > $@ ; \
fi ; \
%.img: $(SYSTEMS) blank144 blankhd Makefile
%.bin: $(SYSTEMS) blank144 blankhd Makefile
@sys= ; \
case $@ in \
(*cpm22*) sys=../CPM22/cpm_wbw.sys;; \
@@ -49,8 +70,12 @@ blankhd:
esac ; \
if echo $@ | grep -q ^f ; then \
fmt=wbw_fd144 ; type=fd_ ; proto=blank144 ; \
mid="MID\006" ; \
else \
#fmt=wbw_hd_new ; type=hd_ ; proto=blankhd ; \
#mid="MID\012" ; \
fmt=wbw_hd0 ; type=hd_ ; proto=blankhd ; \
mid="MID\004" ; \
fi ; \
d=$$(echo $(basename $@) | sed s/$$type//) ; \
echo Generating $@ ; \
@@ -59,6 +84,7 @@ blankhd:
echo copying system $$sys to $@ ; \
$(BINDIR)/mkfs.cpm -f $$fmt -b $$sys $@ ; \
fi ; \
LC_CTYPE=en_US.US-ASCII echo $$mid | dd bs=1 count=4 seek=1410 conv=notrunc of=$@ ; \
for u in $$(seq 0 15) ; do \
dir=d_$$d/u$$u ; \
if [ -d $$dir ] ; then \
@@ -93,7 +119,7 @@ imgdiff:
if echo $$i | grep -q ^f ; then \
fmt=wbw_fd144 ; \
else \
fmt=wbw_hd0 ; \
fmt=wbw_hd0_1024 ; \
fi ; \
$(BINDIR)/cpmls -i -f $$fmt $$i > $$i.ls ; \
$(BINDIR)/cpmls -i -f $$fmt $(DIFFPATH)/$$i > $$i.diff.ls ; \

View File

@@ -297,77 +297,6 @@ diskdef wbw_rom1024
os 2.2
end
# UNA 512KB ROM (128KB reserved, 384KB ROM Disk)
diskdef una_rom512
seclen 512
tracks 12
sectrk 64
blocksize 2048
maxdir 256
skew 0
boottrk 0
os 2.2
end
# UNA 512KB ROM (128KB reserved, 896KB ROM Disk)
diskdef una_rom1024
seclen 512
tracks 28
sectrk 64
blocksize 2048
maxdir 256
skew 0
boottrk 0
os 2.2
end
# RomWBW 8MB Hard Disk, LU 0-3
diskdef wbw_hd0
seclen 512
tracks 65
sectrk 256
blocksize 4096
maxdir 512
skew 0
boottrk 1
os 2.2
end
diskdef wbw_hd1
seclen 512
tracks 130
sectrk 256
blocksize 4096
maxdir 512
skew 0
boottrk 66
os 2.2
end
diskdef wbw_hd2
seclen 512
tracks 195
sectrk 256
blocksize 4096
maxdir 512
skew 0
boottrk 131
os 2.2
end
diskdef wbw_hd3
seclen 512
tracks 260
sectrk 256
blocksize 4096
maxdir 512
skew 0
boottrk 196
os 2.2
end
# RomWBW 720K floppy media
diskdef wbw_fd720
seclen 512
@@ -415,3 +344,111 @@ diskdef wbw_fd120
boottrk 2
os 2.2
end
# RomWBW 8MB Hard Disk, first 4 slices
# Legacy format, 512 dir entries, 8,320 sectors / slice
diskdef wbw_hd0
seclen 512
tracks 1040
sectrk 16
blocksize 4096
maxdir 512
skew 0
boottrk 16
os 2.2
end
diskdef wbw_hd1
seclen 512
tracks 2080
sectrk 16
blocksize 4096
maxdir 512
skew 0
boottrk 1056
os 2.2
end
diskdef wbw_hd2
seclen 512
tracks 3120
sectrk 16
blocksize 4096
maxdir 512
skew 0
boottrk 2096
os 2.2
end
diskdef wbw_hd3
seclen 512
tracks 4160
sectrk 16
blocksize 4096
maxdir 512
skew 0
boottrk 3136
os 2.2
end
# RomWBW 8MB Hard Disk
# New format, 1024 dir entries, 8,192 sectors / slice
# Pure filesystem image, no prefix
diskdef wbw_hd_new
seclen 512
tracks 1024
sectrk 16
blocksize 4096
maxdir 1024
skew 0
boottrk 2
os 2.2
end
# RomWBW 8MB Hard Disk, first 4 slices
# New format, 1024 dir entries, 8,192 sectors / slice
# Assumes 256 sector (16 track) hard disk prefix
diskdef wbw_hd0_new
seclen 512
tracks 1040
sectrk 16
blocksize 4096
maxdir 1024
skew 0
boottrk 18
os 2.2
end
diskdef wbw_hd1_new
seclen 512
tracks 2064
sectrk 16
blocksize 4096
maxdir 1024
skew 0
boottrk 1042
os 2.2
end
diskdef wbw_hd2_new
seclen 512
tracks 3112
sectrk 16
blocksize 4096
maxdir 1024
skew 0
boottrk 2066
os 2.2
end
diskdef wbw_hd3_new
seclen 512
tracks 4136
sectrk 16
blocksize 4096
maxdir 1024
skew 0
boottrk 3114
os 2.2
end

BIN
Source/Images/hd_prefix.dat Normal file

Binary file not shown.