How To: Create an SD Card Image

Tutorials and help articles.

Articles will be approved by our staff before posting. This is to ensure that the community gets the highest quality possible content.
Gerry
Posts: 36
Joined: Sat Feb 17, 2024 8:54 am
Location: Dallas, Tx.

Re: How To: Create an SD Card Image

Post by Gerry »

I'm not communicating my issue very well. Using the -sdcard switch with the Mac x16emu emulator requires a .img (or apparently a .VHD) file which is a image of the sdcard. The official release of the latest SD card zip file decompresses to a root directory with the rest of the real files organized in subdirectories. Copy those directories directly to an SD card, plug it into a real X16 and Bob's your uncle (it works!). But for an emulator to see and use these files, it needs to be converted into a disk image (file types .VHD or .IMG) but a Mac can't make the .img file but by third-party applications and, as far as I know, not a .VHD file at all. Macs use the .dmg filetype for the same thing. I tried using a .dmg file made for the -sdcard switch but all I got was gobbly gook.

The only solutions I see for Mac users are, one, use a Windows machine to make the image, two, have someone post the .img and .VHD files to the website for download or, three, spend some money to by a Mac app to make them. For me, the question becomes, are Mac users being left in a chicken and the egg dilemma? I hope not as we like the X16 emulator too and really appreciate having it available. So what can I do to help fix this catch-22?

Your help is greatly appreciated.

Thank you,
Gerry
Gerry
Posts: 36
Joined: Sat Feb 17, 2024 8:54 am
Location: Dallas, Tx.

Re: How To: Create an SD Card Image

Post by Gerry »

I'm not communicating my issue very well. Using the -sdcard switch with the Mac x16emu emulator requires a .img (or apparently a .VHD) file which is a image of the sdcard. The official release of the latest SD card zip file decompresses to a root directory with the rest of the real files organized in subdirectories. Copy those directories directly to an SD card, plug it into a real X16 and Bob's your uncle (it works!). But for an emulator to see and use these files, it needs to be converted into a disk image (file types .VHD or .IMG) but a Mac can't make the .img file but by third-party applications and, as far as I know, not a .VHD file at all. Macs use the .dmg filetype for the same thing. I tried using a .dmg file made for the -sdcard switch but all I got was gobbly gook.

The only solutions I see for Mac users are, one, use a Windows machine to make the image, two, have someone post the .img and .VHD files to the website for download or, three, spend some money to by a Mac app to make them. For me, the question becomes, are Mac users being left in a chicken and the egg dilemma? I hope not as we like the X16 emulator too and really appreciate having it available. So what can I do to help fix this catch-22?

Your help is greatly appreciated.

Thank you,
Gerry
TomXP411
Posts: 1761
Joined: Tue May 19, 2020 8:49 pm

Re: How To: Create an SD Card Image

Post by TomXP411 »

Gerry wrote: Tue May 14, 2024 8:35 pm Thank you for your time and answers. That worked for me, I got the x16emu to run with the sdcard.img image and it loaded. That image is blank with no files. So the next questions; where do I find the latest .img file with files or how do I turn the latest SDcard_root subdirectory into an .img file on a Mac?

Thanks again,
Gerry
You don't need an .img file, unless you're doing very specific performance testing. Otherwise, just use the -fsroot parameter to point the emulator to whatever directory you expanded the SD Card Starter Kit into. I usually just create a directory named "fsroot" underneath the emulator directory on my systems, so it's easy to find. I also create several startup scripts with different parameters, based on what file sets I want to start with.

So my startup usually looks like

x16emu.exe -fsroot C:\cx16\fsroot -scale 2 -echo
TomXP411
Posts: 1761
Joined: Tue May 19, 2020 8:49 pm

Re: How To: Create an SD Card Image

Post by TomXP411 »

Gerry wrote: Wed May 15, 2024 7:18 am I'm not communicating my issue very well. Using the -sdcard switch with the Mac x16emu emulator requires a .img (or apparently a .VHD) file which is a image of the sdcard.
No, it doesn't. That's just one way to do it, and it's the worst way. The only reason to use an .img file is if you're exercising the built in CMD-RDOS ROM code. Otherwise, just use the hostfs interface, which works just fine with loose files.
Gerry
Posts: 36
Joined: Sat Feb 17, 2024 8:54 am
Location: Dallas, Tx.

Re: How To: Create an SD Card Image

Post by Gerry »

Thank you so much for your answer. I will try your solution this afternoon. As I said before, there's a lot of information on this site.
Where can I find documentation on the emulators along with the switch options? I don't want to burn you out asking a thousand minor questions when I want to use this resource after I've tried doing what the documentation says and have questions. To me, the documentation is the first-level of support and you SMEs (Subject Matter Experts) are second-level support.

Thank s again,
Gerry
TomXP411
Posts: 1761
Joined: Tue May 19, 2020 8:49 pm

Re: How To: Create an SD Card Image

Post by TomXP411 »

Gerry wrote: Wed May 15, 2024 6:05 pm Thank you so much for your answer. I will try your solution this afternoon. As I said before, there's a lot of information on this site.
Where can I find documentation on the emulators along with the switch options? I don't want to burn you out asking a thousand minor questions when I want to use this resource after I've tried doing what the documentation says and have questions. To me, the documentation is the first-level of support and you SMEs (Subject Matter Experts) are second-level support.

Thank s again,
Gerry
There should be two different documents in the emulator download - an X16 Reference Guide, and the emulator documentation. If you can't find those, you can look at our GitHub repositories:
* https://github.com/X16Community/x16-docs
* https://github.com/X16Community/x16-emulator
Gerry
Posts: 36
Joined: Sat Feb 17, 2024 8:54 am
Location: Dallas, Tx.

Re: How To: Create an SD Card Image

Post by Gerry »

Just to let you know Tom, the -fsroot switch doesn't work in the Mac emulator. According to the docs, the -fsroot defaults to the x16emu directory and when I run the emulator with that switch it complains that it failed to resolve the argument to -fsroot. How is the directory name for the DOS files need to be referred to in the fsroot switch? I tried a dash, a forward slash, a reverse slash, no slash but nothing worked. I will post screen shots in later but letting you know. Also, I got all of -fsroot options listed in the Terminal window. The path to the emulator is long so perhaps I need to movethis all up to my home directory. I'll have more info later.

Gerry
TomXP411
Posts: 1761
Joined: Tue May 19, 2020 8:49 pm

Re: How To: Create an SD Card Image

Post by TomXP411 »

Gerry wrote: Wed May 15, 2024 11:03 pm Just to let you know Tom, the -fsroot switch doesn't work in the Mac emulator. According to the docs, the -fsroot defaults to the x16emu directory and when I run the emulator with that switch it complains that it failed to resolve the argument to -fsroot. How is the directory name for the DOS files need to be referred to in the fsroot switch? I tried a dash, a forward slash, a reverse slash, no slash but nothing worked. I will post screen shots in later but letting you know. Also, I got all of -fsroot options listed in the Terminal window. The path to the emulator is long so perhaps I need to movethis all up to my home directory. I'll have more info later.

Gerry
It should be something like -fsroot /path/to/your/files
User avatar
Yazwho
Posts: 165
Joined: Fri Feb 19, 2021 2:59 pm
Contact:

Re: How To: Create an SD Card Image

Post by Yazwho »

If you're on Windows, BitMagic -- The Emulator can also help create sdcard images.

You can load files into the virtual sdcard, modify them within the emulator, and then write the sdcard image out for re-use!

Its still pre-beta, but for most cases its very usable. Just note, The Emulator doesn't have an auto updater.

https://github.com/Yazwh0/BitMagic/releases/tag/latest
Attachments
emulator-sdcard.gif
emulator-sdcard.gif (5.4 MiB) Viewed 3227 times
Gerry
Posts: 36
Joined: Sat Feb 17, 2024 8:54 am
Location: Dallas, Tx.

Re: How To: Create an SD Card Image

Post by Gerry »

Okay, I think I figured some of this out. I apologize for taking longer than expected to update my post. Next, there are two issues. First, the full path for the DOS files directed by fsroot switch needs to be defined. Trying to append onto the emulator's directory doesn't work. It took some testing but moving the emulator directory higher to the top of the directory got it working.

Second, it appears there is a character limit as to how long the path for fsroot to the DOS files. I had my Emulator directory buried pretty deep. I was just trying to be neat. When I shortened the path to the DOS files it started working. I included some screen grabs showing how the emulator responded to the DOS files long path and how the fsroot switch is defined.

It's nice to offer some new information after asking you all for help.

Is this a bug or a feature?

Thanks,
Gerry

P.S. - This is true for both the Mac and Windows versions of the emulator.
Attachments
X16_3.jpg
X16_3.jpg (69.25 KiB) Viewed 3195 times
X16_1.jpg
X16_1.jpg (32.95 KiB) Viewed 3195 times
Last edited by Gerry on Fri May 17, 2024 6:58 am, edited 1 time in total.
Post Reply