VOGONS


C drive write protected.

Topic actions

First post, by mclatilla

User metadata
Rank Newbie
Rank
Newbie

Hi all!

I'm from Spain (sorry for my english 😀)and I've been using DOSBox for a long time to play my old games. It's a program that I appreciate a lot and it always worked as intended.

I work in Madrid, at the AVE Maintenance Workshop. We maintain the High Speed Trains called AVE Class 100 from ALSTOM:

300px-Renfe_clase_100.JPG
http://en.wikipedia.org/wiki/AVE_Class_100

You would be pleased to know that we use DOSBox in the workshop everyday!

We use it to communicate via serial port with the different systems:

-Main control unit
-Recorder unit (crash recording)
-Air conditioning systems: driving cars and passenger cars
-Etc...

These systems have custom 15-year old DOS programs that only work with slow processors, i.e. 486, Pentium without L1 cache, etc due to erratic behaviour of the serial port.

One day we tried DOSBox, configured the serial port to directserial, adjusted cycles to 300 and voila!! It solved almost all our communication problems 😀

However, one of the executables, the passenger cars air conditioning one doesn't work properly in DOSBox. It displays with a "C drive is write protected" message so it can't create a file to store the readings.

In a normal Windows XP command prompt, the program runs fine (except for the lack of communication!)

It's strange indeed because the driving car air conditioning program is very similar and works without a glitch!

I've been searching the forums for similar problems but I'm a bit dissoriented :s

I attach the EXE file (in spanish, sorry!) to try it for yourselves... Just press the Enter key inside DOSBox a couple of times to see the error message. Try it in a command prompt to see what it should do.

I've tried several DOSBox versions without luck. Tried also several options.

What should I try to get it working? Is the program trying to access the disk in a non-supported way?

Thanks a lot, indeed.

Reply 1 of 25, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

I tried it, and I get the same error message. I tried to mount the C-drive with a large -freesize 2000 but that didn't make any difference. Don't know what could be wrong here.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 2 of 25, by mclatilla

User metadata
Rank Newbie
Rank
Newbie

Thanks for trying it 😀

Reply 3 of 25, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

it doesn't seem to use dos calls to determine the write protection.

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It uses portlevel disk access. Will not be supported by dosbox.

Besides that, it should again be noted that dosbox is supposed to be used
with games only, every other usage may have arbitrary results and we
won't take ANY responsibility (train crashes? hm).

Reply 5 of 25, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Why does it work in NTVDM though?

1+1=10

Reply 6 of 25, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

it might just use some values to detect the write protection or so.
Or some different branch is taken in dosbox.

Similar application worked fine according to the OP.

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Why does it work in NTVDM though?

The ports stuff? Wouldn't know why there'd be a problem with it.

Reply 8 of 25, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

NT will certainly not let a DOS application touch the real hardware ports.

1+1=10

Reply 9 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

afaik that's wrong, like floppy ports are fully accessible, part of the vga registers.
Guess the same for the ide stuff.
Of course they're virtualized so the vdm can modify/disallow combinations.

Reply 10 of 25, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

If that was true a virus running in NTVDM could kill the system. They may be emulated to some extent but are not forwarded to real hardware.

Anyway, I've given the program the register read value it wants (IDE register write-read test): it will go further but later complain about write protection again, this time without accessing IDE ports.

1+1=10

Reply 11 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

They may be emulated to some extent but are not forwarded to real hardware.

That's up to the vdm, iirc the floppy stuff was forwarded in most parts.

Hacking out the port checks makes the app work.

Reply 12 of 25, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

The ports are not forwarded directly to hardware under Windows.
Windows decides which ones it will service on its own, and which it will queue for eventual passing to the hardware (because it can't pass it immediately in case another request is already active).
I'll have a look at this. It sounds like a fun puzzle.

Reply 13 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Windows decides which ones it will service on its own, and which it will queue for eventual passing to the hardware

"queuing+passed to hardware" isn't THAT far from "virtualitzed+forwardedifneeded".

It sounds like a fun puzzle.

As noted above it's already solved, but feel free to have additional fun.

Reply 14 of 25, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

My computer has no floppy but still the program works in NTVDM.

> Hacking out the port checks makes the app work.

Even after pressing Y ?

1+1=10

Reply 15 of 25, by mclatilla

User metadata
Rank Newbie
Rank
Newbie
wd wrote:

Besides that, it should again be noted that dosbox is supposed to be used with games only, every other usage may have arbitrary results and we won't take ANY responsibility (train crashes? hm).

Don't worry about that! 😀

I attach the similar program that works. I guess this one it uses regular DOS calls instead, doesn't it?

Reply 16 of 25, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

There's a check for write-protection, whose result is checked in two different places in the code. The code that sets the state can be patched (just one byte), which makes the program run for a while. Then I see "unexpected error" (perhaps because it can't communicate with anything).
Use a hex editor to change the byte at offset 0xb82d from 03 to 00.

Reply 17 of 25, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

but what does it check ? (as it works on hals pc without a floppy drive)

Water flows down the stream
How to ask questions the smart way!

Reply 18 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Even after pressing Y ?

Yes. If it's the same that i remember.

Reply 19 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

as it works on hals pc without a floppy drive

Suppose real hw, even if no drive is attached, return 0 instead of 0xff.