Making a new SD Card useful.

213 views
Skip to first unread message

fixit9660

unread,
Apr 11, 2024, 5:29:18 AMApr 11
to retro-comp
Apologies for the post but I've just built my SC503 and I'm learning fast. At the moment I'm groping around for info to enable me to use a new SD Card.
I've been looking and reading hard but can't seem to find the info I need, or if I've found it I don't understand it.
I've got an SD Card. It's a Sandisk Ultra 128Gb which has been used in a Windoze PC, so it's almost certainly an NTFS format/file system. From what I've read and been told, I think it needs to be formatted into 8Mb partitions of FAT32 format.
Whilst blundering around I've gotten the following info out of the system:

From within BASIC I can save a program to the A: drive but not the C: drive -
save "c:test"
Too many files
Ok

If I drop out into CPM I get this:
B>dir c:

C:              :              :              :            
C:              :              :              :            
C:              :              :              :            
C:              :              :              :            
C:              :              :              :            
C:              :              :              :            
C:              :              :              :            
C:              :              :              :            etc. A lot of this!!!

B>stat

A: R/W, Space: 64k
B: R/W, Space: 24k
C: R/W, Space: 8176k
D: R/W, Space: 8176k


B>

B>stat c:dsk:


    C: Drive Characteristics
65536: 128 Byte Record Capacity
 8192: Kilobyte Drive  Capacity
  512: 32  Byte Directory Entries
    0: Checked  Directory Entries
  256: Records/ Extent
   32: Records/ Block
   64: Sectors/ Track
   16: Reserved Tracks

B>

B>fdisk80

FDISK80 for RomWBW, UNA, Mini-M68k, KISS-68030, SBC-188  ----  
       Version 1.1-23 created 3-June-2023
                 (Running under RomWBW HBIOS)

HBIOS unit number [0..4]: 4

Capacity of disk 4:  (119G)  249737216      Geom e2b01010
Nr  ---Type- A --      Start         End   LBA start  LBA count  Size
 1 NTFS/HPFS   07     2:10:9 1023:254:63       32768  249704448  119G
 2             00       *** empty ***
 3             00       *** empty ***
 4             00       *** empty ***
   Reserved 1 x 8Mb CP/M slices
>>?

   Commands are single letters

A)ctivate (toggle active/boot flag)
D)elete a partition [<n>]
G)eometry (C:H:S) management
H)elp (or use "?")
I)nitialize a new empty partition table
L)ist useful hexadecimal partition types
N)ew (create a new partition)
P)rint the partition table
T)ype (set the type of a partition)
Q)uit without any changes
R)eserve area for RomWBW/UNA CP/M slices
U)nit (get a new unit number/letter)
W)rite partition table to disk and exit

Numbers: 0100 64 0x40    optional multipliers: G M K U (.. K=1024, U=1)
Units: Y T S B -- (cYlinders, Tracks/heads, Sectors, Bytes)
e.g., 40y (40 cylinders), 1Gb (one gigabyte), 327 (327 current units),
  0x100T (256 tracks), 0x400000ub (4,194,304 bytes) -- 'u' is separator
>>q

...so I gather it IS in NTFS format of 119G, despite the line saying "Reserved 1 x 8Mb CP/M slices"?

From long and bitter experience with numerous and exotic OSes, I'm sure there is a specific preparation sequence that I need to execute in order to render this SD Card usable, but I'll be damned if I can find it.
Would someone please put me out of my misery?

Andrew Lynch

unread,
Apr 11, 2024, 6:56:11 AMApr 11
to retro-comp, fixit9660
Hi
I can appreciate your confusion, RomWBW does things a bit differently than you may be used to doing.

My advice is to download RomWBW and use the provided tools like Win32DiskImager to write a "compiled" image to your SD.


Or you can use dd in Linux to do the same thing.  Fast and easy!

I like to use the HD1K combo image since it gives a good selection of options and there are many others to choose from.

Also, there is a utility called "clrdir" you can use on a new disk to wipe out the contents of a directory and reset to "factory format"

You need to use this tool to allow CP/M to clear the directory structure so it can use it to save and load files.

Otherwise, the "debris" left over from previous formats, data, etc. confuse CP/M.

Honestly, I never use FDISK80.  The last I heard, it was still in development and not ready for prime time yet.

Maybe that's changed, but for now, I would use the disk imaging tools and "clrdir"

Best of luck!  Thanks, Andrew Lynch

PS, I am a huge RomWBW fan, but my info may be out of date



--
You received this message because you are subscribed to the Google Groups "retro-comp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to retro-comp+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/retro-comp/7b6a99fe-06cc-4056-b6a5-39acd81965d1n%40googlegroups.com.

Wayne Warthen

unread,
Apr 11, 2024, 2:07:55 PMApr 11
to retro-comp
Andrew's comments are exactly right.  I will just add a bit more detail.

First, and most important, please be sure to review the RomWBW User Guide document.  You will find "RomWBW User Guide.pdf" in the Doc directory of the distribution, or as Andrew points out, you can get the latest version from the GitHub repository at https://github.com/wwarthen/RomWBW/blob/master/Doc/RomWBW%20User%20Guide.pdf.  Section 4 and 5 are relevant to your questions.  I am very happy to answer questions, but would certainly appreciate it if you would read the guide first.

Although RomWBW does (sort of) understand disk partitions, you do not need to actually to the partitioning if you simply write one of the pre-build disk images to your media.  The image includes a default partition table.  Just write the disk image to your media and the partition table will be overwritten with one that is ideal for RomWBW (including space for a FAT filesystem that both RomWBW and your PC can access).  The images include several ready-to-boot CP/M filesystems with typical files and applications (described in the User Guide).

The other thing I want to clarify here is the difference between partitions and slices.  Normally, a disk partition will include a single filesystem.  For example, a MS-DOS FAT partition will host a single FAT filesystem.  However, RomWBW CP/M uses a single partition as a container for multiple CP/M filesystems which are referred to as slices.  This is done because CP/M filesystems are quite small (8 MB) and you can only have 4 partitions on a disk.  So, RomWBW uses a single partition to contain up to 256 of the 8MB CP/M filesystems.  The slices exist sequentially starting at the beginning of the RomWBW partition.

I hope this helps.  Please let us know how you do.

Thanks, Wayne

fixit9660

unread,
Apr 15, 2024, 4:54:32 AMApr 15
to retro-comp

Having read the RomWBW User Guide 3v5, Sections various including 4 and 5, I have several questions. Some are related to The SD Card formatting process and some are MBASIC related. Before I go further I should state that I built my first Z80-based computer from a kit in 1978 and learnt my first BASIC shortly thereafter. Since then I have used multiple dialects of BASIC. I have also done some Z80 Assembler, Unix Shell scripts, some BSD and Sun server admin/maintenance, some C++, and worked extensively on Juniper, Nortel and Cisco network support.

1.       I understand the rationale relating to the RomWBW disk images and making the production easy of an SD Card usable in the system. As a newcomer to this environment I don’t understand the image names and their relevance to my needs with MBASIC.

2.       I did find and use the Win32DiskImager tool apparently successfully with the hd1k_combo.img on my windoze 7 PC. I used the AOMEI Partition Assistant 10.3.1 to analyse the SD Card and it showed multiple partitions as expected, including one which I used it to format to FAT16, however the PC was not able to see it, as I expected it to? Using FDISK80 showed the RomWBW and FAT16 partitions.

3.       I also used FDISK80 and CLRDIR from the SC503 to successfully initialise another 32Gb SD Card, again using the method indicated in the User Manual. After I had loaded MBASIC, following loading it from CPM, I was then able to access the disk I: from MBASIC to save and load programs and data successfully. Loading MBASIC directly from the SC503 boot menu I was not able to access the SD Card. Loading MBASIC using this method also showed a lot more memory available for program use. I assume that the extra program space, and the SD Card access problem are due to MBASIC using CPM’s disk access routines?

4.       Is there a Command Line method to view the contents and/or size of the SD card files from MBASIC, and CP/M please? I’m thinking of something like the DIR, TYPE, LIST, commands from other OSes.

5.       Is MBASIC 5.0 the most advanced version available to use on the SC503?

 

Apologies if I’m missing some obvious points, but after 50 years of intense concentration in some highly stressful environments, the edge has somewhat been eroded. “My mind is going, I can feel it…”

MartinR

unread,
Apr 15, 2024, 7:11:18 AMApr 15
to retro-comp
In answer to your final question -  I use the following on my SC126:

BASIC-80 Rev. 5.21
[CP/M Version]
Copyright 1977-1981 (C) by Microsoft
Created: 28-Jul-81

I can't remember whether it came bundled with RomWBW, or I found it out there 'in the wild' via one of the usual websites. Equally, I'm unsure as to what material difference 5.21 offers over 5.0. However, it's the version that I remember using from decades ago so I was keen to re-live that.

fixit9660

unread,
Apr 15, 2024, 10:24:38 AMApr 15
to retro-comp
Ah yes, sorry on my part; I have the same version, it came with RomWBW.

Wayne Warthen

unread,
Apr 15, 2024, 2:14:47 PMApr 15
to fixit9660, retro-comp
Hi,

On Mon, Apr 15, 2024 at 1:54 AM fixit9660 <fixi...@gmail.com> wrote:

Having read the RomWBW User Guide 3v5, Sections various including 4 and 5, I have several questions. Some are related to The SD Card formatting process and some are MBASIC related. Before I go further I should state that I built my first Z80-based computer from a kit in 1978 and learnt my first BASIC shortly thereafter. Since then I have used multiple dialects of BASIC. I have also done some Z80 Assembler, Unix Shell scripts, some BSD and Sun server admin/maintenance, some C++, and worked extensively on Juniper, Nortel and Cisco network support.

Thank you for reviewing the manual!

1.       I understand the rationale relating to the RomWBW disk images and making the production easy of an SD Card usable in the system. As a newcomer to this environment I don’t understand the image names and their relevance to my needs with MBASIC.

The images are generally based on the operating system.  Combo refers to the image that contains multiple different OSes that you can boot.  All of the OSes will have a copy of Microsoft BASIC (MBASIC).  You probably want to choose an OS to work with first and boot that OS.  From there, you can start and work with MBASIC as desired.

2.       I did find and use the Win32DiskImager tool apparently successfully with the hd1k_combo.img on my windoze 7 PC. I used the AOMEI Partition Assistant 10.3.1 to analyse the SD Card and it showed multiple partitions as expected, including one which I used it to format to FAT16, however the PC was not able to see it, as I expected it to? Using FDISK80 showed the RomWBW and FAT16 partitions.

I am not familiar with AOMEI Partition Assistant.  If it did not format the partition such that Windows can see it, I don't know what the problem would be.  I would strongly suggest that you format the FAT partition from RomWBW (any OS will work).  You would use "FAT FORMAT n:" where n is the number of the disk unit with the FAT partition you want to format.  This has always produced a formatted FAT partition that is usable by both RomWBW and Windows.

3.       I also used FDISK80 and CLRDIR from the SC503 to successfully initialise another 32Gb SD Card, again using the method indicated in the User Manual. After I had loaded MBASIC, following loading it from CPM, I was then able to access the disk I: from MBASIC to save and load programs and data successfully. Loading MBASIC directly from the SC503 boot menu I was not able to access the SD Card. Loading MBASIC using this method also showed a lot more memory available for program use. I assume that the extra program space, and the SD Card access problem are due to MBASIC using CPM’s disk access routines?

Loading MBASIC from the Boot Loader menu loads a "ROM" BASIC.  There is no operating system underneath it to allow access to any disks (not even RAM or ROM disks).  It is only intended as a quick way to try MBASIC, but with no ability to save or load programs.  Since there is no operating system underneath it, it does have access to more memory than MBASIC loaded from within CP/M.

4.       Is there a Command Line method to view the contents and/or size of the SD card files from MBASIC, and CP/M please? I’m thinking of something like the DIR, TYPE, LIST, commands from other OSes.

I suspect you are thinking about OSes such as those found on Commodore or ATARI computers.  They did not have an OS like CP/M underneath BASIC.  The OS was just an extension of BASIC.  Using MBASIC on CP/M, there is a FILES command.  I am not aware of anything like a TYPE command.  There is a LIST command, but that is for listing the contents of the BASIC program.  Note that the FILES command is only available if you run MBASIC from CP/M.  It is not available if you run the ROM version of MBASIC from the Boot Loader.

5.       Is MBASIC 5.0 the most advanced version available to use on the SC503?

The version of MBAISC provided with RomWBW is v5.21.  I think that is the most current version ever produced for Z80 CP/M computers.  The ROM version of MBASIC provided with RomWBW is v4.7b.  I don't know if there is anything more recent for Z80 ROM-hosted MBASIC.

Thanks,

Wayne

Phillip Stevens

unread,
May 12, 2024, 8:18:53 PMMay 12
to retro-comp
On Tuesday 16 April 2024, Wayne Warthen wrote:

5.       Is MBASIC 5.0 the most advanced version available to use on the SC503?

The version of MBAISC provided with RomWBW is v5.21.  I think that is the most current version ever produced for Z80 CP/M computers.

There is a v5.29 version kicking around, but if I remember correctly, I was reading somewhere that someone just changed the version byte string from v5.21 but they are otherwise identical. I haven't checked myself.

The ROM version of MBASIC provided with RomWBW is v4.7b.  I don't know if there is anything more recent for Z80 ROM-hosted MBASIC.

A while ago, with Spencer's endorsement, I made a new release of MBASIC called v4.7c which is used by default on some of his machines. I also maintain versions supporting the 8085 CPU, and the Am9511A APU.

The key fix is the serial driver has been improved so that interstitial character delays are unnecessary. The earlier v4.7b version could easily suffer from character overrun, so it was necessary to space out each character via a Terminal setting when uploading. It is still necessary to have a short delay after each line (CR/LF) entered, to allow the BASIC tokenisation process to work, but otherwise uploading BASIC programs from the Terminal is now much faster and more reliable.

Also some new features have been added. 1. Hardware sanity check on boot. 2. RST Jump Table in RAM, to allow these instructions to be useful from uploaded programs, 3. added HLOAD to permit directly uploading assembled / compiled HEX programs, and the big one 4. added MEEK and MOKE instructions that allow directly viewing and entering assembly programs.

There's also some Z80 instruction optimisation (as the Microsoft release code is 8080 compliant) which gets about 9% speed-up for BASIC programs.

Cheers, Phillip

Reply all
Reply to author
Forward
0 new messages