Skip to content

[Tester needed] - Fixed VHD support in Initiator mode#335

Merged
erichelgeson merged 3 commits intomainfrom
eric/initiator/fixed-vhd
Apr 6, 2026
Merged

[Tester needed] - Fixed VHD support in Initiator mode#335
erichelgeson merged 3 commits intomainfrom
eric/initiator/fixed-vhd

Conversation

@erichelgeson
Copy link
Copy Markdown
Contributor

Enable with:

[SCSI]
InitiatorVHD=1

Adds 512 byte footer to imaged file, eg:

SCSI ID 2 capacity 166200 sectors x 512 bytes
Drive total size is 81 MiB
SCSI Version 2
[SCSI2]
  Vendor = "QUANTUM "
  Product = "CTS80S          "
  Version = "4.07"
  Type = 0
VHD output enabled for SCSI ID 2
Starting to copy drive data to HD20_imaged.vhd
$ tail -c 512 HD20_imaged.vhd| hexdump -C
00000000  63 6f 6e 65 63 74 69 78  00 00 00 02 00 01 00 00  |conectix........|
00000010  ff ff ff ff ff ff ff ff  00 00 00 00 62 73 63 69  |............bsci|
00000020  00 01 00 00 57 69 32 6b  00 00 00 00 05 12 70 00  |....Wi2k......p.|
00000030  00 00 00 00 05 12 70 00  03 d1 0a 11 00 00 00 02  |......p.........|
00000040  ff ff e7 72 89 85 23 72  e0 63 7d 4a cc 5f f7 82  |...r..#r.c}J._..|
00000050  88 25 ca 6f 00 00 00 00  00 00 00 00 00 00 00 00  |.%.o............|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000200

@androda
Copy link
Copy Markdown
Contributor

androda commented Feb 24, 2026

The Ultra initiator mode fix looks fine. But I don't know anything about VHDs.

@erichelgeson erichelgeson changed the title Fixed VHD support in Initiator mode [Tester needed] - Fixed VHD support in Initiator mode Mar 1, 2026
@erichelgeson erichelgeson force-pushed the eric/initiator/fixed-vhd branch from e77a8db to 0b70b73 Compare April 5, 2026 14:25
erichelgeson and others added 3 commits April 6, 2026 07:51
When InitiatorVHD=1 is set in bluescsi.ini, initiator mode saves disk
images as Fixed VHD files instead of raw .hda. A 512-byte footer
conforming to the Microsoft VHD Image Format Specification (Oct 2006)
is appended after the raw disk data, making images directly mountable
by Windows, QEMU, VirtualBox, and other tools.
@erichelgeson erichelgeson force-pushed the eric/initiator/fixed-vhd branch from 5f2cb57 to ae0041d Compare April 6, 2026 12:54
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

BlueSCSI Memory Report

Compared against release v2026.03.01

Memory Usage

Target FLASH RAM SCRATCH_X SCRATCH_Y
Pico_2_Audio_SPDIF 673.4 KB (+53.4 KB) [33%] 511.7 KB [100%] 3.5 KB [88%] 3.8 KB (+1.0 KB) [94%]
Pico_2_DaynaPORT 665.8 KB (+52.4 KB) [33%] 511.7 KB [100%] 3.5 KB [88%] 3.0 KB (+1.0 KB) [75%]
Pico_Audio_SPDIF 694.6 KB (+60.8 KB) [34%] 252.2 KB (+6.7 KB) [99%] 1.5 KB [38%] 768 B [19%]
Pico_DaynaPORT 686.4 KB (+60.3 KB) [34%] 245.8 KB (+15.6 KB) [96%] 1.5 KB [38%]
Ultra 682.5 KB (+57.5 KB) [33%] 511.7 KB [100%] 3.5 KB [88%] 3.0 KB (+1.0 KB) [75%]
Ultra_Wide 442.4 KB (+61.6 KB) [22%] 511.7 KB [100%] 2.0 KB [50%] 3.0 KB (+1.0 KB) [75%]

Symbol Region Changes

Pico_2_Audio_SPDIF: 3 symbols moved FLASH → RAM (+12 B)
Symbol Size
operator delete(void*, unsigned int) 4 B
operator new[](unsigned int) 4 B
operator delete[](void*) 4 B
Pico_2_Audio_SPDIF: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_fstat 16 B
_lseek 16 B
_close 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B
Pico_2_DaynaPORT: 3 symbols moved FLASH → RAM (+12 B)
Symbol Size
operator delete(void*, unsigned int) 4 B
operator new[](unsigned int) 4 B
operator delete[](void*) 4 B
Pico_2_DaynaPORT: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_fstat 16 B
_lseek 16 B
_close 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B
Pico_Audio_SPDIF: 13 symbols moved FLASH → RAM (+2.0 KB)
Symbol Size
mscd_xfer_cb 1.4 KB
mscd_control_xfer_cb 328 B
tud_descriptor_string_cb 116 B
mscd_open 104 B
mscd_reset 20 B
mscd_init 20 B
tud_descriptor_configuration_cb 8 B
operator delete(void*, unsigned int) 8 B
operator new[](unsigned int) 8 B
tud_descriptor_device_cb 8 B
operator delete[](void*) 8 B
exit 6 B
SdSpiCard::errorCode() const 4 B
Pico_Audio_SPDIF: 43 symbols moved RAM → FLASH (-5.3 KB RAM)
Symbol Size
amigaWifiCommand 1.2 KB
FatFile::rename(FatFile*, char const*) 332 B
FatPartition::init(FsBlockDeviceInterface*, unsigned char, unsigned long) 324 B
ExFatPartition::init(FsBlockDeviceInterface*, unsigned char, unsigned long) 252 B
ExFatFile::addDirCluster() 196 B
ExFatPartition::bitmapFind(unsigned long, unsigned long) 192 B
partitionTableGetVolumeStartSector(FsCache&, unsigned char) 192 B
ExFatPartition::bitmapModify(unsigned long, unsigned long, bool) 164 B
FatFile::makeUniqueSfn(FatLfn_t*) 144 B
ExFatFile::rename(ExFatFile*, char const*) 140 B
ExFatFile::preAllocate(unsigned long long) 136 B
ExFatPartition::freeClusterCount() 136 B
FatPartition::allocContiguous(unsigned long, unsigned long*) 136 B
FatPartition::freeClusterCount() 124 B
FatPartition::allocateCluster(unsigned long, unsigned long*) 124 B
FatFile::addDirCluster() 112 B
FatFile::fgets(char*, int, char const*) 106 B
FatFile::contiguousRange(unsigned long*, unsigned long*) 106 B
ExFatFile::fgets(char*, int, char const*) 104 B
FatPartition::fatPut(unsigned long, unsigned long) 104 B
FsBaseFile::copy(FsBaseFile const*) 102 B
ExFatPartition::fatPut(unsigned long, unsigned long) 80 B
ExFatPartition::freeChain(unsigned long) 78 B
ExFatFile::contiguousRange(unsigned long*, unsigned long*) 76 B
FatVolume::chdir(char const*) 72 B
FatFile::preAllocate(unsigned long) 72 B
ExFatVolume::chdir(char const*) 68 B
FatPartition::freeChain(unsigned long) 58 B
FatFile::getLfnChar(DirLfn_t const*, unsigned char) 52 B
ExFatFile::peek() 50 B
... and 13 more
Pico_DaynaPORT: 34 symbols moved FLASH → RAM (+7.2 KB)
Symbol Size
mscd_xfer_cb 1.4 KB
ExFatFile::write(void const*, unsigned int) 992 B
ExFatFile::read(void*, unsigned int) 672 B
FatFile::write(void const*, unsigned int) 524 B
FatFile::readPrivate(void*, unsigned int, DirFat_t**) 498 B
ExFatFile::seekSet(unsigned long long) 468 B
ExFatFile::buildSectorMap() 444 B
FatFile::buildSectorMap() 358 B
mscd_control_xfer_cb 328 B
FatFile::seekSet(unsigned long) 272 B
FatFile::readSectorsDirect(unsigned long, unsigned char*, unsigned long) 200 B
ExFatFile::readSectorsDirect(unsigned long, unsigned char*, unsigned long) 200 B
FatPartition::fatGet(unsigned long, unsigned long*) 154 B
tud_descriptor_string_cb 116 B
mscd_open 104 B
ExFatPartition::fatGet(unsigned long, unsigned long*) 96 B
FsCache::prepare(unsigned long, unsigned char) 84 B
ExFatPartition::dirSeek(DirPos_t*, unsigned long) 80 B
FsCache::sync() 74 B
ExFatPartition::dirCache(DirPos_t const*, unsigned char) 68 B
ExFatFile::dirCache(unsigned char, unsigned char) 60 B
FatFile::cacheDirEntry(unsigned char) 32 B
FatFile::readDirCache() 32 B
mscd_reset 20 B
mscd_init 20 B
FsBaseFile::operator=(FsBaseFile const&) 12 B
tud_descriptor_configuration_cb 8 B
operator delete(void*, unsigned int) 8 B
operator new[](unsigned int) 8 B
tud_descriptor_device_cb 8 B
... and 4 more
Pico_DaynaPORT: 3 symbols moved RAM → FLASH (-1.2 KB RAM)
Symbol Size
amigaWifiCommand 1.2 KB
StreamFile<FsBaseFile, unsigned long long>::peek() 34 B
StreamFile<FatFile, unsigned long>::peek() 10 B
Ultra: 4 symbols moved FLASH → RAM (+16 B)
Symbol Size
operator new(unsigned int) 4 B
operator delete[](void*) 4 B
operator new[](unsigned int) 4 B
operator delete(void*, unsigned int) 4 B
Ultra: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_lseek 16 B
_close 16 B
_fstat 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B
Ultra_Wide: 4 symbols moved FLASH → RAM (+16 B)
Symbol Size
operator delete(void*, unsigned int) 4 B
operator new[](unsigned int) 4 B
operator delete[](void*) 4 B
operator new(unsigned int) 4 B
Ultra_Wide: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_fstat 16 B
_lseek 16 B
_close 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B

@erichelgeson erichelgeson merged commit ab0d756 into main Apr 6, 2026
1 check passed
@erichelgeson erichelgeson deleted the eric/initiator/fixed-vhd branch April 6, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants