VOGONS


First post, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie

It has always been a problem for Windows with CF cards reporting itself as Removable instead of Fixed. Sadly, CF cards reporting itself as Fixed is very hard to find.

The question has been raised a few times and I still haven't found an answer until I stumbled upon this video from dosdude1's channel about how to reprogram SM2236-based CF cards with the controller's MP tool.

I decided to give this a try and of all the cards I've attempted only a Toshiba 128GB CF card turned out to be using SM2236 (thus picked up by the tool). After reprogramming the card following the video's instructions, it now reports as Fixed and has SMART enabled. I did a F3 test just in case, and it passed without errors so the card is now working and ready to be used.

Just I'm not sure about other CF controllers (vendors and models). Is there a good place for documentations of known CF card controllers (and maybe supported NAND flash types)?

Reply 2 of 12, by douglar

User metadata
Rank Oldbie
Rank
Oldbie

Is this relevant at all?

https://www.delkin.com/blog/technical-guide-c … gital-sd-cards/

the CF card has a TRUE IDE mode, which allows the CF card to function exactly as a PATA/IDE drive. This mode is entered when the card has pin 9 grounded on the 50 pin connector when power is applied. When is TRUE IDE mode the CF card is not hot swappable. The passive adapter takes care of grounding pin 9.

Reply 3 of 12, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
douglar wrote on 2023-10-29, 23:21:

Is this relevant at all?

https://www.delkin.com/blog/technical-guide-c … gital-sd-cards/

the CF card has a TRUE IDE mode, which allows the CF card to function exactly as a PATA/IDE drive. This mode is entered when the card has pin 9 grounded on the 50 pin connector when power is applied. When is TRUE IDE mode the CF card is not hot swappable. The passive adapter takes care of grounding pin 9.

I'm not sure about this. From what I know the Fixed/Removable flag is set in the firmware. Some old Sandisk cards had an utility called ATCFWCHG to modify this bit, but it doesn't work on newer cards anymore. They probably changed the flash controller, or moved to a firmware version on which this no longer works.

Reply 4 of 12, by douglar

User metadata
Rank Oldbie
Rank
Oldbie
LSS10999 wrote on 2023-10-30, 04:53:

I'm not sure about this. From what I know the Fixed/Removable flag is set in the firmware. Some old Sandisk cards had an utility called ATCFWCHG to modify this bit, but it doesn't work on newer cards anymore. They probably changed the flash controller, or moved to a firmware version on which this no longer works.

I've got 15 different CF cards manufactured between 2008 - 2023. I'm never run into the "removable CF card" issue. Could it be that the adapters I have ground pin 9? I can check that later today. Could it be that some firmware versions check pin 9 and others don't? Seems very possible. Seems like there's at least 5 major families of Pata-Flash controllers in the market since they were introduced over 25 years ago, and each family produced many revisions over time as specs & flash & standards changed. Also seems very possible that each revision had multiple versions of the firmware, so it's probably very complicated and sample of 15 random CF's might not be a a big enough sample to hit that issue.

Reply 5 of 12, by darry

User metadata
Rank l33t++
Rank
l33t++
douglar wrote on 2023-10-30, 15:11:
LSS10999 wrote on 2023-10-30, 04:53:

I'm not sure about this. From what I know the Fixed/Removable flag is set in the firmware. Some old Sandisk cards had an utility called ATCFWCHG to modify this bit, but it doesn't work on newer cards anymore. They probably changed the flash controller, or moved to a firmware version on which this no longer works.

I've got 15 different CF cards manufactured between 2008 - 2023. I'm never run into the "removable CF card" issue. Could it be that the adapters I have ground pin 9? I can check that later today. Could it be that some firmware versions check pin 9 and others don't? Seems very possible. Seems like there's at least 5 major families of Pata-Flash controllers in the market since they were introduced over 25 years ago, and each family produced many revisions over time as specs & flash & standards changed. Also seems very possible that each revision had multiple versions of the firmware, so it's probably very complicated and sample of 15 random CF's might not be a a big enough sample to hit that issue.

I seem to recall that, at some point, some OSes started explicitly caring about this. I could be wrong.

I think I recall that Windows XP either does not like booting from or installing to (maybe both) a drive with with the removable bit set.

Reply 6 of 12, by douglar

User metadata
Rank Oldbie
Rank
Oldbie
darry wrote on 2023-10-30, 16:04:

I think I recall that Windows XP either does not like booting from or installing to (maybe both) a drive with with the removable bit set.

OK, thanks. That makes sense. I can't recall ever installing XP on a CF, so that's likely why I have never seen this issue. I usually look at using a physical disk drive or a low capacity sata SSD for XP installs.

Reply 7 of 12, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
darry wrote on 2023-10-30, 16:04:

I seem to recall that, at some point, some OSes started explicitly caring about this. I could be wrong.

I think I recall that Windows XP either does not like booting from or installing to (maybe both) a drive with with the removable bit set.

In Windows 2000 you can force a disk to be considered as Fixed through a registry value. In Windows XP (and onwards) it's not possible anymore -- you need a filter driver called CFADISK.

I once heard removable CF cards were a valid use case for Windows Embedded, but I'm not sure how it performs. Some Windows disk-related APIs will not return removable drives, which could lead to some programs being confused if the system drive happens to be "removable".

On the other hand, Linux will tell you if the card is Removable, but it doesn't really care with respect to booting and using them.

Reply 8 of 12, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

Some iterations of partition editors seem to let you flip the removable or fixed bit in Linux, but I am not sure which ones, seemed Lubuntu was shuffling from one to another all the time. Anyway, best keep it away from windows built in system management editor, I swear that thing just sets what it wants every time you load it, cancelling your other OS active primaries and other shady "our way or the highway" crap.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 9 of 12, by ChrisXF

User metadata
Rank Newbie
Rank
Newbie

It seems that the grounding pin 9 to become a regular hard drive is disappearing from modern CF drives. Sandisk for one have confirmed they've dropped support altogether.

Here's some more: https://www.thinkwiki.org/wiki/CompactFlash_boot_drive

Reply 10 of 12, by LSS10999

User metadata
Rank Oldbie
Rank
Oldbie
BitWrangler wrote on 2023-10-31, 01:41:

Some iterations of partition editors seem to let you flip the removable or fixed bit in Linux, but I am not sure which ones, seemed Lubuntu was shuffling from one to another all the time. Anyway, best keep it away from windows built in system management editor, I swear that thing just sets what it wants every time you load it, cancelling your other OS active primaries and other shady "our way or the highway" crap.

I recall reading discussions about flipping that bit from partition table or something but I never found any concrete answer.

As for other partitioning tools messing up the partition table... I think the only case where it could be a big problem would be multibooting with OS/2 (ArcaOS) but that's off-topic.

By the way, I think CF card firmware may additionally include some quirks. I had a Sandisk 64GB CF card exhibit a very odd behavior when used with a CF-IDE adapter in Windows --

If the card has been manipulated by anything other than Windows itself, Windows will not see the actual partition table and would instead see a 31GB unformatted partition. This made the card extremely risky to be used this way as you could accidentally erase its contents.

ChrisXF wrote on 2023-10-31, 01:53:

It seems that the grounding pin 9 to become a regular hard drive is disappearing from modern CF drives. Sandisk for one have confirmed they've dropped support altogether.

Here's some more: https://www.thinkwiki.org/wiki/CompactFlash_boot_drive

Back to the main topic... I'm looking for a good place to know which CF controller certain card brands (and of certain periods) might be using. For now, looks like the only answer to this problem would be using the respective MP tool to reprogram the card to make it behave properly.

Reply 11 of 12, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
LSS10999 wrote on 2023-10-31, 02:57:

By the way, I think CF card firmware may additionally include some quirks. I had a Sandisk 64GB CF card exhibit a very odd behavior when used with a CF-IDE adapter in Windows --

If the card has been manipulated by anything other than Windows itself, Windows will not see the actual partition table and would instead see a 31GB unformatted partition. This made the card extremely risky to be used this way as you could accidentally erase its contents.

That sounds eerily familiar to the Sintechi SD adapters (which are typically an FPGA programmed to do SD->CF translation) that malfunction if they can't find a primary FAT partition when reset. They seem to rely on that partition to know what IDE physical layout to emulate (cylinders/heads/sectors), and if they can't find one they will keep returning ATA IDENTIFY info for every attempted sector read instead of actual data.

Reply 12 of 12, by Ryccardo

User metadata
Rank Member
Rank
Member
douglar wrote on 2023-10-29, 23:21:

Is this relevant at all?

the CF card has a TRUE IDE mode […]

I've heard of some card that would automatically appear as removable in PCMCIA mode and fixed in IDE mode, but don't remember which one it was…

BitWrangler wrote on 2023-10-31, 01:41:

Some iterations of partition editors seem to let you flip the removable or fixed bit in Linux

Never heard of that, though - it's not stored anywhere on the ordinary data area and neither it's something you could spoof with a DDO (unlike, let's say, switching back on AHCI if you use BIOS emulation on a Macbook)

XP and removable drives

It mostly works fine - once you can get it installed (which pretty much means using a 3rd party partitioner instead of the one in the installer), even without cfadisk if you don't need/want swap and don't mind pressing alt+tab then enter on boot (a modal warning that swap isn't supported on removable drives appears under the blue login screen!!)

Yes, it's an artificial (and, as it shows, poorly implemented) restriction in the NT series - nothing else, including the various evolutions of DOS, care

Now if my CF-based computer (designed with 2009 parts) didn't have int13 problems with such large cards... (most HDDs declare the conventional 8 GB limit for CHS capacity, most CFs their full size, and this is seemingly what makes it go wrong, modern Linux with GRUB that goes LBA at the first opportunity works fine)