VOGONS


First post, by I4ko

User metadata
Rank Newbie
Rank
Newbie

Last couple of days, after 0.70 was released I've been trying everything I could think of to make megaem work. I need a gm/mt32 emulation, with virtualy zero cpu consumption. 0.70 works like a charm in general - 10k cycles with 44100 hz on all sound mixers, super2xsai, and no frameskip is using just 3-5% cpu. Both under linux and windows.
Using mt32emu or timidity is no option - constant cpu load on 100% and sound shuttering.

So I decided to use the gus gm/mt32 emulation. However megaem requires VCPI (which must have been around in dosbox since 0.65) but is unable to find it (xms, ems, umb = true).

Running dosbox with xms and ems=false and emb=true/false and booting a dos 6.22 image was a little better - however EMM386 was not able to use framebuffer, even in frame E000 it complains of a rom there. Megaem loads but in convensional mem, since it complains it cannot find emm manger, but is able to find vcpi provided by EMM386 - very strange. (It doesn't matter if I use dos's HIMEM or internal dosbox).

Tried with qemm - no luck at all - qemm does not load.

Disk images are very incovenient so I took the DEVICE.COM from qemm and with it I can load himem.sys and emm386.exe (4.45 or 4.95) (either with frame e000 or with noframe) if autoexec section. However megaem still compains I have no emm installed and runs in convensional mem.(Very stange again since EMM386 is the VCPI provider).
EMM386 however list ems memory fine, but dosbox's mem also says there is no ems memory. I've tryed with memory set to 4,8,16 and 63 mb.

I waht to push this to the limits, so either:
1. DOSBOX provides VCPI.
2. EMM386 (or other ems manger) is able to load and work as supposed.
NMI are not needed since I only want to use megaem for midi, nmi are needed only for sb emulation, which we already have.

I am open to any suggestions since I would like to make use of this low power cpu method of gm/mt32 emulation.

Reply 1 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

However megaem requires VCPI

dosbox CAN provide vcpi services, but only for a limited number of
special games as if always enabled along with ems we'd have to
switch to v86 by default which would kick out lots of games.

So if you can compile the sources of dosbox it'd be quite easy to
test the builtin vcpi host (no need to boot msdos and stuff).

Reply 2 of 24, by I4ko

User metadata
Rank Newbie
Rank
Newbie

Yes, on linux I've build from cources (0.70 stable) myself, but was unable to find any configure switch to enable or disable support. And it does not provide vcpi (to megaem). I cannot find any refence to VCPI except in files ChangeLog, NEWS and src/ints/ems.cpp which look fine and I cannot seem to get how to enable it for particular application.

When I played dos games on real pc my config was always with emm386 providing ems and umb, and never had any problems.

btw with device.com from qemm i do not need msdos. it loads bin drivers as if they were not stipped from the real exe.

Reply 3 of 24, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
#define ENABLE_V86_STARTUP 0

to

#define ENABLE_V86_STARTUP 1

in the ems.cpp

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

Reply 4 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Not sure if the v86mode startup still works. If it doesn't, look further at
ems.cpp for this code:

	case 0xDE:		/* VCPI Functions */
if (!vcpi.enabled) {
LOG(LOG_MISC,LOG_ERROR)("EMS:VCPI Call %2X not supported",reg_al);
reg_ah=EMM_FUNC_NOSUP;
} else {
switch (reg_al) {
case 0x00: /* VCPI Installation Check */
if (((reg_cx==0) && (reg_di==0x0012)) || (cpu.pmode && (reg_flags & FLAG_VM))) {

and remove those if () checks down there so vcpi services are
reported unconditionally.

and I cannot seem to get how to enable it for particular application

This is intentional.

Reply 5 of 24, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
(cpu.pmode && (reg_flags & FLAG_VM)

thought that that part would be valid. although it wouldn't hurt to remove it.

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

Reply 7 of 24, by I4ko

User metadata
Rank Newbie
Rank
Newbie

Did all three things but when trying to run megaem

"Exit to error: IRET from pmode to v86 with CPL!=0"

in dynamic, normal and full core (if it there is full now, but dosbox is not complaining)

Also other things seem to be broken (like that parlap extender, with error "Paging requested without PE=1"). However pharlap extender run very fine under real pc with emm386 and now it does not.

I am not very good at progaming but it seems that page frame of the internal implementation is at E000, and size is 64k. However every EMM i've found says there is a ram or rom piece in the frame at his location and thus criples it serices. Does dosbox put same data there if ems=false in the config. If so could it be made to no fill this area and then use some "userland" emm like Jemm386?

Reply 8 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

However every EMM i've found says there is a ram or rom piece

Well that's because emm386 is a bit stupid.

Also other things seem to be broken

When starting up with v86mode? That's why it's disabled by default.

Reply 9 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

"Exit to error: IRET from pmode to v86 with CPL!=0"

I could get it to start up, but it says something about not being able to
communicate with the tsr. So better try around with emm386-stuff
when booting xydos.
Try loading it with "device=emm386.exe /frame=e000 ram" or how ever
that frame command is spelled (frame: or /f= or something like that).

Reply 10 of 24, by I4ko

User metadata
Rank Newbie
Rank
Newbie

ms dos FRAME=e000 is ok or M9 is the same, however it allows runnig without frame with NOFRAME, and when running EMM386 it says everything is fine and it provides ems ram and services, but dosbox's mem does not see it ems. Also megaem does not see ems memory but sees vcpi and is happy. Problem is megaem loads in low-dos mem, leaving with around 300 free.

It (ems manger finds rom or ram in the buffer) does not happen only with ms dos emm386 but also with 7-8 emms I've found on the net, some like qemm and 286 based emms does not run at all, some like jemm (which is based on the freedos one) run and compain the same.

I guess I'll stick to that now, where 300-330k lowmem is ok and no extender game/app.

If I find time I may try to dump with debug the memory area and see if there is something written in.

Reply 11 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

however it allows runnig without frame with NOFRAME

Didn't really understand your posting. Are you using device.com for
this (doesn't work for this, promised) or booting xxdos? In the 2nd case
you're missing upper memory?

Reply 12 of 24, by I4ko

User metadata
Rank Newbie
Rank
Newbie

Using device.com to load microsofts emm386.exe with noframe.
It happuly says:

emm386 successfully installed.

available expanded memory 7104kb
lim/ems version 4.0
total expanded memory pages 486
available expanded memory pages 444
total handles 64
active handles 1
page frame segment NONE

total upper memory available 47 kb
largest upper memory block available 43 kb
upper memory starting address e000 h

emm386 active.

dosbox's mem says
619 kb free convensional
6640 kb free extended

mem is set to 8, xms, ems, and umb are set to false.

however msdos orginal mem (on mounted directory) says:

655360 bytes total conventional
635392 largest executable program size

7667712 bytes total EMS memory
7045120 bytes free EMS memory

7340032 bytes total contiguos extended memory
0 bytes available contiguos extended memory
6799360 bytes available XMS memory
MS-DOS resident in HMA

Maybe the memory manager structures of dos emulations are not fully msdos compatible.

here are some screenshots http://hristo.todorov.googlepages.com/dosboxems

BTW It seems very strange to me that various emm mangers I've tryed find data in E000 segment either with device.com or with real dos from disk image. Wihh debug memory area is clean, and i can fill and compare fine with different patterns.

Reply 14 of 24, by I4ko

User metadata
Rank Newbie
Rank
Newbie

Megaem works to the extend where it cannot find ems and loads in conventional (it finds vcpi services and no ems). In fact no other program (beside the ems manger and dos's mem) cannot see there is EMS mem.

Reply 16 of 24, by I4ko

User metadata
Rank Newbie
Rank
Newbie

Many thanks, it's runnig fine now 😀
In realdos (6.22) megaem sees ems memory, so I suspect the dos implementation of dosbox is not fully complete yet 😀 Also extender games not compainig for procesor mode (exatly that way it was with real hardware). Only having an image is a minor discomfort.

Reply 18 of 24, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

This stuff needs v86 mode and dosbox's vcpi technique avoids using it (too messy,
remember all the crashes because emm386 was loaded?)
So your best bet is booting an msdos image where you load emm386 in the config.sys