VOGONS


Stack segment not present

Topic actions

Reply 21 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

The "#define C_DIRECTLPT 1" is added by patch in src/platform/visualc/config.h .
I'm using mingw, so the above path should be declared somewhere?
I've added the missed lines to "dosbox/config.h" ,but when ran "./configure" these ones are deleted.
😕 😕

Reply 22 of 43, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

That file is only used by msvc (under *nix/mingw it is generated).

Well just remove all occurences of C_DIRECTLPT (which should be
all like #ifdef DIRECTLPT or similar) or rename that to WIN32 or
something so it succeeds compiling.

Reply 24 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

put parport.h in /include/automake.am
it's wrong in /src/hardware/serialport.

No "automake.am" , Is it the "makefile.am"?
I've made the changes in these last ones.

compiler shows cdirect error.

Well just remove all occurences of C_DIRECTLPT (which should be
all like #ifdef DIRECTLPT or similar)

"directlpt_win32.h" -> compiler errors
in "directlpt_win32.cpp", too -> as above

see attached.

Attachments

  • Filename
    make_err_pport3.rar
    File size
    684 Bytes
    Downloads
    115 downloads
    File license
    Fair use/fair dealing exception

Reply 25 of 43, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ok hal uses vc assembler in porttalk.cpp, which doesn't work as
is under mingw. Don't know if this file crucial, looks like it is.
Would require converting these snippets to at&t-style asm.

Did you try it with msvc already? You need to compile a few
libraries for this though.

Reply 26 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

Did you try it with msvc already? You need to compile a few
libraries for this though.

I supose these one in ".diff" : libpng, zlib,...
I don't have vc installed in this machine: I try soon...

-----
I've followed line by line the ".diff"...
Placed the missing line for the config.h (#define,..) for the undeclared cdlptdirect errors, etc.
Solved some errors relate asm, changed the code syntax in :
__asm (".....");

For the last errors (see attached) I don't understand what the compiler wants, lines are the same as in ".diff", maybe mingw wants other syntax...

Attachments

  • Filename
    err_pport5.rar
    File size
    501 Bytes
    Downloads
    114 downloads
    File comment
    "make" errors
    File license
    Fair use/fair dealing exception

Reply 28 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

Maybe you could post the actual lines that create the errors, as the
line numbers seem to have changed.

Oops I'm sorry...

In attachment there are the mingw errors and the related porttalk.cpp , just tested on my home pc, so the path and the lines aren't the same of above post.

Attachments

  • Filename
    make_err_pport6.rar
    File size
    1.59 KiB
    Downloads
    110 downloads
    File comment
    mgw errs + porttalk.cpp
    File license
    Fair use/fair dealing exception

Reply 29 of 43, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Try adding
#include <winioctl.h>
at the very top of porttalk.cpp. Think it's missing METHOD_BUFFERED and
FILE_ANY_ACCESS which should be in winioctl.h
Don't know if that thing is in mingw.

Reply 30 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

I've found that the include file it isn't "winioctl.h" but "ioctrl.h".
After"included" this one in "porttalk.cpp", the last errors after "make" are related to a file/s in my "Documents and Settings" folder.😕
The compiler shows:

E:/Documents and Settings..../Temp/ccS8aaaa.s: Assembler messages:
E:/Documents and Settings..../Temp/ccS8aaaa.s:4180: Error: too many memory references for `mov'
E:/Documents and Settings..../Temp/ccS8aaaa.s:4183: Error: too many memory references for `mov'
E:/Documents and Settings..../Temp/ccS8aaaa.s:4186: Error: too many memory references for `out'

etc.

No "exe" was build.

_mf2hd_

Reply 32 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

Well,
I've tried to force mingw to read the intel's asm with the line:

asm (".intel_syntax noprefix");

but the compiler output is full of asm errors in the at&t form, with statements non present in porttalk.cpp (push,pop,...).
I've understood it doesn't like this format... 🙁

After I've learn many beautiful things about at&t's asm 😵 , I've put the following lines in porttalk.cpp:

asm ("mov portid,%edx");
asm ("mov value,%al");
asm ("out %al,%dx");
...etc

the compiler errors are:
---
undefined reference to `portid'
undefined reference to `value'
---
A line in porttalk.cpp with these ones:
---
void outportb(Bit32u portid, Bit8u value)
---
Any suggestions about these ones?
msVC's help doesn't shows nothing about Bit8u and Bit16u, so, where are they from?
Is there something to "#include"?

"Thanks" are always included. 😀

_mf2hd_

Reply 33 of 43, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Sorry, didn't look at it yet. But you can browse the dosbox sources,
there you'll find asm blocks where you can compare the both
assembler types, like this:

#if defined (_MSC_VER)
__asm {
__asm finit
__asm fsave dyn_dh_fpu.state[0]
__asm fstcw dyn_dh_fpu.host_cw
}
#else
__asm__ volatile (
"finit \n"
"fsave %0 \n"
"fstcw %1 \n"
:
: "m" (dyn_dh_fpu.state[0]), "m" (dyn_dh_fpu.host_cw)
: "memory"
);
#endif

Reply 34 of 43, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Try something like the following, but be sure to check the disassembly
for correctness, and maybe test it in the debugger as well.

void outportb(Bit32u portid, Bit8u value) {
__asm__ volatile (
"movl %0,%%edx \n"
"movb %1,%%al \n"
"outb %%al,%%dx "
:
: "r" (portid), "r" (value)
: "edx", "al"
);
}
Bit8u inportb(Bit32u portid) {
Bit8u value;
__asm__ volatile (
"movl %1,%%edx \n"
"inb %%dx,%%al \n"
"movb %%al,%0 "
: "=m" (value)
: "r" (portid)
: "edx", "al", "memory"
);
return value;
}

Reply 35 of 43, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

> but be sure to check the disassembly
for correctness, and maybe test it in the debugger as well.

It's not dangerous, he will get a privileged exception if it tries to access a wrong port.

1+1=10

Reply 37 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

Thank you wd, I've left for the moment the mingw and tried to compile with MSVC2K5exp (see attachment)...

mingw with your assembly lines :

***** --- *****

make[2]: Entering directory `/e/compile12/dosbox/dosbox/include'
cd .. && /bin/sh /e/compile12/dosbox/dosbox/missing --run automake-1.8 --gnu i nclude/Makefile
include/Makefile.am:40: blank line following trailing backslash
make[2]: *** [Makefile.in] Error 1
make[2]: Leaving directory `/e/compile12/dosbox/dosbox/include'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/e/compile12/dosbox/dosbox'
make: *** [all] Error 2

***** --- *****
The last line (40) in "...\include\makefile.am" is:

video.h\

I've deleted the "\" for test:

***** --- ****
make[2]: Entering directory `/e/compile12/dosbox/dosbox/include'
cd .. && /bin/sh ./config.status include/Makefile
config.status: creating include/Makefile
make[2]: Leaving directory `/e/compile12/dosbox/dosbox/include'
make[2]: Entering directory `/e/compile12/dosbox/dosbox/include'
make[2]: *** No rule to make target `control.h', needed by `all-am'. Stop.
make[2]: Leaving directory `/e/compile12/dosbox/dosbox/include'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/e/compile12/dosbox/dosbox'
make: *** [all] Error 2

**** --- ****

_mf2hd_

Attachments

  • Filename
    err_vc1.rar
    File size
    4.28 KiB
    Downloads
    407 downloads
    File comment
    the same cvs with MSVC
    File license
    Fair use/fair dealing exception

Reply 38 of 43, by mf2hd

User metadata
Rank Newbie
Rank
Newbie

I've tried to compile with mingw a fresh directory/files because the last ones was full of garbage made during the tests and...compiled succesfully!!!:happy:

I've tried the program and IT SEEMS TO RUN FINE!!!...😁 😁
the screen is hard to read on LCD because it's run only in simple vga resolution: now I'll try to add the svga patch...

The change to cpu.cpp that skips the "stack error" crash is the first that wd suggested.

Thanks again wd and hal for your suggestions and "pieces of code",as well as for your patients in following this "dummy".

_mf2hd_