News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Freedos usb stick?

Started by dreadnaut, October 03, 2013, 10:51:09 PM

Previous topic - Next topic

dreadnaut

Has anyone tried to make one of those, and put Stunts on it? :D

No time tonight, but I might give it a try in the future, for CTG's joy!

Friker


Duplode

That would be a nice thing to have. I hardly remember what playing under pure DOS felt like  ::) (I once tried doing that in a VM, but it didn't work first time and I was too lazy to try and tune FreeDOS until it worked.)

zaqrack

ZakStunts hosted a FreeDos based bootable CD image including full competition archive around 2005 for several years, prepared for the second WSM. It was working well so assume it should be the same case with a USB stick - with the extra benefit of being able to save your replay directly on the USB stick.

dreadnaut

Small update: creating a Freedos usb stick is very easy using Rufus!

Daniel3D

Quote from: dreadnaut on October 03, 2013, 10:51:09 PM
Has anyone tried to make one of those, and put Stunts on it? :D

No time tonight, but I might give it a try in the future, for CTG's joy!

I have tried without success with freedos. I ran into multiple problems.

first with the executable, it could not run stunts (packaged file.. error) this seemed to be fixed with the LOADFIX program.
Then i ran into memory errors. e.g. Not enough memory to run.
that could not be solved with the standard Himemx en 386 counterpart.
Jemmex solved the memory problem but ran into an error when starting stunts.
I also downloaded Dos 7.1 and copied HYMEM and EMM386 from there.
No luck with either of them.

after about 4 days i setup a VM to boot from my freedos USB,
and an other VM that booted DOS7.1 from another USB.
that speeded testing up a whole bit.

VM Freedos had the same errors, worked on it a while and gave up,
Dos 7.1 ran no problem, with sound and everything right form install. no editing necessary,
But when i booted DOS7.1 on my regular machine the CPU gave problems. No fix as far as i can tell.

But i have a cheap old (1CPU 1ghz with 1gig ram) laptop.
That gave some EMM386 errors that would feezeup the system
but i managed to solve that, (see link below)

I have now a MS-DOS 7.1 on USB that runs Stunts perfectly.
(just need to work on sound a bit but i haven't even looked at that yet)

It looks like original dos is an easier option to go for in this case for me.

I used Dos-to-USB, and it worked.
https://download.cnet.com/DOS-on-USB/3000-2094_4-10795476.html

for the EMM386 memory problems:
http://www.abandonia.com/vbullet/showthread.php?t=9744

I don´t think that this will work on all systems. But its a start.
I have some ideas for Freedos to try.  but i wanted to share this.

Overall this has kept me bussy for about 2 weeks  ???
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Cas

Oh!  I haven't tried those utilities to create a FreeDOS or MSDOS 7.1 USB flash drive. I think I tried at some point long ago and had difficulties, but I don't remember which method I used. Anyway, on my computer, I have FreeDOS in a separate partition and it boots well and can run Stunts, but I installed FreeDOS from a CD. What I can add are the following points:

- FreeDOS, MSDOS and any DOS are real mode operating systems and depend on BIOS functions and on the MBR partitioning system. They will fail to install and/or run properly if your computer does not have ROM BIOS functions or does not support MBR system. New computers typically come ready for the UEFI system, but many can still be configured to work in MBR mode (especially desktop computers). In order for DOS to work, you have to partition your hard drive in MBR mode. Even if you're not installing DOS on your hard drive, some UEFIs won't be able to boot flash drives in MBR mode unless all drives are set up in that mode too. That seems to be the case of my newer desktop computer. Same goes for boot CDs.

- I'm pretty sure that Stunts does not require EMS, so I wouldn't recommend running DOS with an expanded memory manager to run Stunts. EMMs also put your processor in virtual 86 mode, which makes old real mode programs slightly more unstable. Better use pure real mode. HIMEM.SYS provides access to extended memory. I don't remember if Stunts uses this, but it won't hurt. Not sure about LoadFix, but LoadHigh will be useful to keep drivers in high memory (not the same as extended memory). Also, don't load a CD ROM driver. It takes lots of conventional memory and Stunts doesn't need it. FreeDOS sets up a CD ROM driver by default so you may want to remove this from your CONFIG.SYS or AUTOEXEC.BAT.

- Sound... well, that's hard to solve in pure DOS. If you have a computer old enough like the motherboard has ISA card slots, you're in luck. Almost every ISA sound card you can find in stock somewhere will be compatible with SoundBlaster Pro. Some PCI sound cards do have some degree of compatibility with SB Pro, but that won't help for Stunts. They mostly have to be cards by Creative and while the compatibility is reasonable for the DSP (sampling), it usually fails for FM synthesis (which is what Stunts uses). Newer cards are guaranteed not to work. Up to some point, computers at least included an internal PC Speaker, but now most don't. Still, many computers that don't include such speaker do have the pins in the motherboard where you can plug one. These speakers are cheap and can be found in electronic shops.

- If you can get a booting FreeDOS, but you would like a newer version and that one is not working, you can just install the old one and then copy the kernel and other files directly on top of that install and that'll be fine. If you have problems booting MSDOS 7.1, you can get a copy of bad-old Windows 95 or 98 and strip it from everything but the DOS part.
Earth is my country. Science is my religion.

Daniel3D

My two laptop's are both old enough to support MBR. (Legacy mode it's called in one of them)

So I have hope. Booting from usb is not a problem either.
CAS, can you please send me a copy of your cofig.sys (fdconfig.sys) and autoexec.bat?

Maybe I can figure it out  8)
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Cas

Right now, I have it installed with what I think is the default. I'll upload them here. But it's been some time since I last ran Stunts in pure DOS, so I'll give it a try now and I'll tell you how it does with the different menu options....
Earth is my country. Science is my religion.

Cas

Alright... I wasn't able to get it to run properly. This is as much as I could get:

I booted with the last option and I was getting "Packed file is corrupt" errors. My first thought was that it had to do with game speed, so I used a TSR that slows programs down, but it didn't work. Then I tried loadfix and was able to run the Setup, which hints that this is a memory geometry problem, but Stunts itself wouldn't run with loadfix. It doesn't give the former error message, but it crashes.

So I restarted with nothing by using F8 and skipping everything but the basics. It doesn't work. Then I tried again with HIMEM only. This sort of worked. I was able to get Stunts to start by running it with loadfix. No sound whatsoever, having set it up for internal PC speaker, meaning I don't have one. I can use the menu, but when I try to race, I get a sign telling me that there isn't enough memory, which isn't true. Other games run fine.

My guess is that Stunts has a complex strategy in memory handling to try to maximise conventional memory available at run time. This was common in old games, but sadly, makes it non-standard and it turns out that many modern computers have a very weird low-memory geometry as they reserve blocks there for UEFI stuff perhaps. As a result, only games that manage their memory exclusively by calling DOS interrupts will have a good chance to run well or those that do it via a DPMI. Others... it depends... There probably is a way to trick Stunts with a EMM driver so that it thinks it's accessing a region, but actually, it's another, but it'll take me some time to find the configuration and it will probably not be the same as you would need on your computer. Besides, Stunts might not like the driver and become unstable. I'd say you need a really old computer with a pure BIOS-based system to run Stunts without problems natively, I'm afraid.
Earth is my country. Science is my religion.

Daniel3D

I've noticed that freedos has 635k of conventional memory in stead of 640k in MS-DOS.

Stunts in VGA mode requires the full 640k to run

E.g. it seems that it isn't possible to run stunts in freedos unless this can be altered.

::Side note:: does 'restunts' have an effect on memory handeling?
Can't download it anymore so I can not test this.
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

Duplode

Quote from: Daniel3D on July 30, 2020, 04:30:19 PM
E.g. it seems that it isn't possible to run stunts in freedos unless this can be altered.

For a different point in configuration space, I did manage to run Stunts (while actually getting to drive) under FreeDOS + VirtualBox a while ago. The main difficulty was with sound: PC speaker doesn't work, and Sound Blaster crashes on game startup no matter what. To get working sound, I had to switch from VirtualBox to QEMU and find out appropriate BLASTER settings for AUTOEXEC.BAT (this QEMU test was done with MSDOS, but I suspect FreeDOS would also have worked).

Cas

Virtually, DOSBox does such a great job, that I've never tried any other thing. I do have a few old computers, but I would have to clean them, find some DIN5 keyboard and a serial adapter for the mouse, etc.

About conventional memory, yes, some games used to be more demanding than others, but having the full 640k free is almost impossible. Remember that MEM substracts its own memory consumption for the estimation and COMMAND.COM unloads its transient part when running programs, keeping the resident part (which is usually loaded high), so the estimation is not totally accurate.

About high memory and UMBs
I think the problem here has to do with high memory and upper memory blocks. The thing is this: the first megabyte is composed first of 640k that are guaranteed to be RAM. The first kilobyte is used by the BIOS to store some configuration and by the microprocessor to keep track of the interrupt vectors. A portion of the DOS kernel lies usually in the lower part of these 640K and, if you use DOS=HIGH, it's moved to "high memory" or if you use "UMB", to upper memory blocks. The thing is conventional memory goes up to 9000:FFFF. After that, you have the video RAM, from A000 :0000 to B000:FFFF. From that point on, it all depends a lot on your computer. There is a region that's often used by expanded memory managers, another one that points to parts of the ROM BIOS, but these may be located differently. Any RAM available from that point onwards is called high memory and UMBs are a particular region that, if I remember correctly, are often taken by ROM, but sometimes not, so then you can use them. The thing is that it seems new computers usually don't respect these old non-standard trends and everything after the video RAM is pretty unpredictable. This is why memory management for DOS on new computers is not good and some games are never satisfied. DOSBox, as an emulator, does respect this very well: it's its job.

Memory management in Stunts is weird
When I was working on the Vizcacha project, I had problems because of how Stunts manages its memory. I examined the structure of the memory used by Stunts with a TSR, but then, when I made another TSR to make use of that, I realised that Stunts not only loaded at a different point in memory with my TSR, but also, distributed its memory blocks in a comlpetely different fashion from what it did with the other TSR. Because of this, besides my TSR not being able to achieve the desired goal, its presence tended to mess up with Neverlock, which was now unablet o find the memory block were Stunts held its copy protection scheme data. As a consequence, copy protection was enabled when entering Stunts. LOAD.EXE does very weird things including copying parts of other executable code pieces on top of itself as it runs. Very hard to solve :S
Earth is my country. Science is my religion.

Daniel3D

Yeah, stunts is a pain to get to run outside a virtualized environment. But it was possible, so I want to make it work. (I'm so close)

Two Three thoughts.
Some games from the 640k era were later revived with a new memory handeling. (Dos4gw?? I believe)
Stunts missed that.

And I would like to know is restunts changes memory handeling (I am afraid not) because it bypasses load.exe..
See: http://forum.stunts.hu/index.php?topic=2454.0

About the copy protection. Could we remove all the answers with stressed? Then no crack is needed..
Edison once said,
"I have not failed 10,000 times,
I've successfully found 10,000 ways that will not work."
---------
Currently running over 20 separate instances of Stunts
---------
Check out the STUNTS resources on my Mega (globe icon)

llm

#14
Quote from: Cas on July 31, 2020, 03:16:21 AM
...Because of this, besides my TSR not being able to achieve the desired goal, its presence tended to mess up
with Neverlock, which was now unablet o find the memory block were Stunts held its copy protection scheme data.
As a consequence, copy protection was enabled when entering Stunts. LOAD.EXE does very weird things
including copying parts of other executable code pieces on top of itself as it runs. Very hard to solve :S

Stunts can run in CGA/EGA/MCGA/Tandy Mode (configured sound driver get loaded dynamically after the game is started)
the stunts exe would have become too big back in that days so the developers invented a system that allows to
create a real dos exe - in memory - from the game-code and configured graphics-mode-code, that is the purpose of the LOAD.EXE
- to reduce executable size

there are two programs (one by user clvn the other by w4kfu - see the reverse engineering thread)
which can do this upfront resulting in a plain dos executable for each graphic mode
(these executables are the base for the restunts project)
svn://anders-e.com/restunts/trunk/restunts/src/execombiner

the copy protection is just a single byte switch

btw: i've also managed to integrate the sounde-driver directly into the game-exe
(so no dynamic code loading anymore just to ease reverse engineering even a bit more)
svn://anders-e.com/restunts/trunk/restunts/src/drvcombiner

the stunts executeable just allocates all free memory and handles the rest of allocations with an self written
internal memory mananger - thats it

Quote from: Daniel3D on August 01, 2020, 07:01:47 AM
Two Three thoughts.
Some games from the 640k era were later revived with a new memory handeling. (Dos4gw?? I believe)
Stunts missed that.

And I would like to know is restunts changes memory handeling (I am afraid not) because it bypasses load.exe..
See: http://forum.stunts.hu/index.php?topic=2454.0

About the copy protection. Could we remove all the answers with stressed? Then no crack is needed..

DOS4GW is a 32Bit DOS Extender - Stunts is a 16bit real mode (80186er Code) program - so there is absolutely no use for that
the stunts game needs to be compiled different (for 32bit and with an extender) to use that - but that is not possible without the source code

stunts just uses all conventional memory it can - no EMS/XMS etc. himem could be of use to get dos out of the way

i don't think that restunts reduces the needed memory amount - but i've never got any problem to get it run
under Dosbox or in Virtual Machines under a real dos (with the very same memory constraints) - so whats the problem?
is freedos just to memory consuming?

Stressed does not work in any way with the executeable - but its easy to create the non LOAD.EXE using the execombiner
and patch the single byte to prevent copy protection
see subversion links with code and this post: http://forum.stunts.hu/index.php?topic=2454.msg43618#msg43618