Physical disk as Pcem hard disk?

Support and general discussion.
Post Reply
Zup
Posts: 83
Joined: Mon 30 Nov, 2015 10:47 am

Physical disk as Pcem hard disk?

Post by Zup »

Is it possible?

The entire story (so you can figure what am I trying to do):

I've got a ZX-Uno. It is a FPGA based computer with the same size factor as a Raspberry Pi. Although it was made thinking about doing a hardware emulated ZX Spectrum, the designers added the capability to hold and use up to 9 "cores". Each core can emulate a computer/console (there are 15~20 of those cores). One of those cores emulate a PC/XT, and its "hard disk" is the SD card reader. That PC/XT core does not have floppy, so the SD must be a bootable XT hard disk (clone).

To create that SD card I've been using PCem. First I make a disk image using win32diskimager, then I use that image with PCem and, when it's ready, I dump the image into the same SD card.

So I was wondering if it is possible using a device (the SD card reader) as a hard disk for PCem. Doing so would save me time from dumping the contents of the SD card. I guess that (using Linux) I could edit pcem.cfg and put a line like hdc_fn = /dev/sdc but I don't know if it would work (PCem should be running as root).

Can it be done in windows? Maybe a future update (with a big red warning about the risks of using a device directly)?

Thanks.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Physical disk as Pcem hard disk?

Post by omarsis81 »

I second this request. It would make file transfer between host and guest a lot easier, but I guess it would demand heavy programing because Windows 9x would have to read a NTFS partition on the host side, something not possible I think
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Physical disk as Pcem hard disk?

Post by ppgrainbow »

I would like to this feature request!

I currently have a 512 MB, 1 GB and 2 GB flash drive formatted as a FAT partition, a 1 GB and 2 GB compact flash and a 2 GB SD card that can be used to run under MS-DOS/Windows 95.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Physical disk as Pcem hard disk?

Post by omarsis81 »

ppgrainbow wrote:I would like to this feature request!

I currently have a 512 MB, 1 GB and 2 GB flash drive formatted as a FAT partition, a 1 GB and 2 GB compact flash and a 2 GB SD card that can be used to run under MS-DOS/Windows 95.
I suspect reading from a FAT32 host would be much easier to implement
User avatar
ppgrainbow
Posts: 479
Joined: Thu 04 Sep, 2014 7:03 am
Contact:

Re: Physical disk as Pcem hard disk?

Post by ppgrainbow »

omarsis81 wrote:
ppgrainbow wrote:I would like to this feature request!

I currently have a 512 MB, 1 GB and 2 GB flash drive formatted as a FAT partition, a 1 GB and 2 GB compact flash and a 2 GB SD card that can be used to run under MS-DOS/Windows 95.
I suspect reading from a FAT32 host would be much easier to implement
FAT32 is a good option as well...especially for drives greater than 2 GB to 8 GB in size. :)
Zup
Posts: 83
Joined: Mon 30 Nov, 2015 10:47 am

Re: Physical disk as Pcem hard disk?

Post by Zup »

omarsis81 wrote:
ppgrainbow wrote:I would like to this feature request!

I currently have a 512 MB, 1 GB and 2 GB flash drive formatted as a FAT partition, a 1 GB and 2 GB compact flash and a 2 GB SD card that can be used to run under MS-DOS/Windows 95.
I suspect reading from a FAT32 host would be much easier to implement
Sorry, maybe I was misunderstood. The goal is not reading disk images from NTFS/FAT32 filesystems (it does), nor reading files from filesystems (like DOSBox does when mounting folders).

The goal is using the SD card as a whole so commands like FDISK would write over the MBR of the SD card (and make partitions on that SD), SYS would make a partition bootable (writting the boot record of the partition) and so on.

As I said, maybe the linux version could do using /dev files instead of image files, but you'll have to give PCem CHS parameters of that SD card to work.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Physical disk as Pcem hard disk?

Post by omarsis81 »

Zup wrote:The goal is using the SD card as a whole so commands like FDISK would write over the MBR of the SD card (and make partitions on that SD), SYS would make a partition bootable (writting the boot record of the partition) and so on.
Hmm I believe is almost the same, anyway, reading from a SD card would be great too!
Zup
Posts: 83
Joined: Mon 30 Nov, 2015 10:47 am

Re: Physical disk as Pcem hard disk?

Post by Zup »

I've compiled v12 version of PCem with my Debian (64 bits). It needed two changes to work (both 'depcomp' and 'missing' links are pointing to older versions of automake; needed to add -m32 to compiler flags).

After that, I've tried to select /dev/sdc as HDD image file but it didn't work. But after manually editing pcem.cfg, I've launched PCem as root and it booted from the SD card. I didn't even put any CHS values on pcem.cfg file.

I haven't tried to FDISK that SD card from PCem, but I guess it will work. Now I wonder how can I do that same trick under Windows...

BTW, the latest source downloaded from the repository doesn't compile. It complains about a dell200s initialization function...
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Physical disk as Pcem hard disk?

Post by SarahWalker »

Run autoconf & automake. That's best practice when using source from the repo on Linux - as I don't generally develop on Linux the Linux makefiles aren't always kept up to date.
Greatpsycho
Posts: 151
Joined: Tue 22 Mar, 2016 10:03 am
Location: Korea
Contact:

Re: Physical disk as Pcem hard disk?

Post by Greatpsycho »

Zup wrote:I've compiled v12 version of PCem with my Debian (64 bits). It needed two changes to work (both 'depcomp' and 'missing' links are pointing to older versions of automake; needed to add -m32 to compiler flags).

After that, I've tried to select /dev/sdc as HDD image file but it didn't work. But after manually editing pcem.cfg, I've launched PCem as root and it booted from the SD card. I didn't even put any CHS values on pcem.cfg file.

I haven't tried to FDISK that SD card from PCem, but I guess it will work. Now I wonder how can I do that same trick under Windows...

BTW, the latest source downloaded from the repository doesn't compile. It complains about a dell200s initialization function...
I already have a patch to fix the dell200 compilation problem, but it has not been reflected yet. The patch link is below.
https://pcem-emulator.co.uk/phpBB3/view ... =681#p5327
Post Reply