VOGONS


First post, by chyang

User metadata
Rank Newbie
Rank
Newbie

hi, all:
After some efforts, I have made it run successfully with my private SDL. Now the SDL works great. But there are some problems inside dosbox 0.63.
After dosbox shows, the screen will fast blink as if someone is typing space quickly, screen will scroll and cannot get anything input.
I used gdb to track the problem, to now, the internal execution seems to be wrong with my compiled dosbox, the program stuck on the command input part, but every time it gets from input, the character will be char 255. Further trace found that the call in dev_con.h/device_CON::Read's call to CALLBACK_RunRealInt(0x16) won't execute correctly, it will be interpreted as ret=1 while in fact it should be ret=17 in Normal_Loop() line 124.
I added a quick hack, inserted when the ret returns 1 reassign it to 17, it solves the problem but it won't get any input after the dosbox initialization finishes. I suspect the keyboard's interrupt handler is not set correctly.
I do suspect it would be a compiler problem, since my arm compiler is a little outdated, while rebuild 3.4.4/4.0.0 for native arm neither work for me. 🙁
Any similar reports?
Thanks.
--
Chen

Reply 1 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

well there was one on IRC once.
I figured out as much as that.

I suspected it to be in the fact that callbacks use a Bitu and what is written in memory is a Bit16u. but according to harekiet this couldn't be the issue.

if you can compile the debugger enalbed version of dosbox you might want to see what is presetn on where
runrealint points to.
C800:0984

and c800:110
and c800:120

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

Reply 3 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

So if i understood it correctly, CALLBACK_RunRealInt(0x16)
is called, the normal core executes something, but
INT16_Handler() is never called.
First of all switch to the full core, if it works ok it's
most likely a bug in the normal core, otherwise maybe
something with the callback setup as Qbix said.

For the normal core: try to add some debug output to
CPU_Core_Normal_Run(), something like replacing the

restart_opcode:
switch (core.opcode_index+Fetchb()) {

by

restart_opcode:
Bit8u bt=Fetchb();
LOG_MSG("cs:eip=%x:%x, opcode=%x",SegValue(cs),reg_eip,bt);
switch (core.opcode_index+bt) {

and see what output you get past the CALLBACK_RunRealInt.
Should look like
cs:eip=c800:984, opcode=cd (execute interrupt)
cs:eip=c800:110, opcode=fb (STI)
cs:eip=c800:111, opcode=fe (special callback opcode)
then the normal core should return into dosbox.cpp with
returncode something like 0x11 (issue callback).

Reply 5 of 12, by chyang

User metadata
Rank Newbie
Rank
Newbie

Got the root cause and should be able to solve it. The interrupt set up code on arm is problematic. The unaligned word access would cause problem. I changed to byte access in callback.c's line 155:
phys_writew(CB_BASE+(callback<<4)+3,callback);

One solution is to change the writew/readw/writed/readd implementation. I have used that one.

But it's slow than expected. 🙁

Reply 6 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm dosbox has allready a switch for unalligned memory acces.
maybe it's not properly used in the phys_writew or something like that.

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

Reply 8 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

does this mean it runs using the cvs ?
Could you confirm that ?

http://pcnwstage.phys.rug.nl/dosboxcvs.tgz

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

Reply 9 of 12, by chyang

User metadata
Rank Newbie
Rank
Newbie

No, I haven't used the cvs version, just the released dosbox-0.63.tar.gz, now it works great. After removed the code wd suggested, it runs faster. 😀

Thansk Qbix and WD, without you two, I couldn't find the problem. 😀

Reply 11 of 12, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Yes, it's best to try the CVS source, as many fixes and improvements have been added since 0.63. It's quite stable as many people are testing it all the time (on Win32 and Linux at least).

Reply 12 of 12, by chyang

User metadata
Rank Newbie
Rank
Newbie

No lucky for me. I hacked the Config to Config_ to avoid the class confliction to Qtopia. After it run, it will stuck in somewhere. Don't have chance to see whether the aligned/unaligned problem has been solved or not. I will update if I have time to figure out the problem inside.
Thanks.