SGI: Development

Cant get DOSBox to compile - Page 2

Mare wrote:
Here is the really weird bit, if I put a printf("moo\n"); in the " class MOUNT : public Program " section it actually runs all the commands (INTRO / MOUNT / etc). Without the printf() it just prints a blank line and returns to the 'dos' prompt.


Code:
class MOUNT : public Program {
public:
void Run(void)
{
printf("moo\n");
<etc>
}


[in src/dos/dos_programs.cpp]. I build 0.65 with MipsPro 7.4.4m. However, INTRO/MOUNT still print only a blank line, and mounting a directory still doesn't work. But maybe I inserted the suggested printf at the wrong position. Any hint there?

_________________
The YOUNG get old, the OLD die -
that's what we've in common, not SGI.
Ok, this is getting really freaky now. I put some debugging printf's in some other places to track some more things but that stopped it 'running' the commands, now that I have taken them back out I can't get them to work again. To be honest I have no idea whats going on now.

I'll keep fiddling though, maybe its some kind of weird optimisation 'bug' causing it to not work.

I wish I had kept that binary that at least ran the commands :roll:
Mare wrote:
From what I can tell there are some issues with the command line parsing. Here is the really weird bit, if I put a printf("moo\n"); in the " class MOUNT : public Program " section it actually runs all the commands (INTRO / MOUNT / etc). Without the printf() it just prints a blank line and returns to the 'dos' prompt.

OK, I also made some progress. As I mentioned above, putting your printf directly into the MOUNT class didn't help me any [my version of dos_programs.cpp is 1.56]. However, when I put said printf into the MOUNT_ProgramStart function, then I can indeed run INTRO, although I can't run INTRO MOUNT properly - I only get instructions for mounting CDROM/info on special keys...Anyway, you might be right in assuming command line parsing is the crucial issue here...

BTW, there definitely seems to be an issue with the MOUNT class. Check its parentheses structure...

_________________
The YOUNG get old, the OLD die -
that's what we've in common, not SGI.
By now, surely everyone on here has succeeded to compile dosbox with MipsPro (I compiled dosbox 0.65 under Irix 6.5.29 with MipsPro 7.4.4m). However, I still can't mount any directory at all.

While above I was inclined to follow mare's suspicion that the problem has something to do with command line parsing, after some fiddling with printfs, I now believe the issue is in this part of the 'Execute' function from src/shell/shell_misc.cpp [mine is version 1.43]:

Code:
413    else
414    {   /* only .bat .exe .com extensions maybe be executed by the shell */
415       if(strcasecmp(extension, ".com") !=0)
416       {
417          if(strcasecmp(extension, ".exe") !=0) return false;
418         }
419       /* Run the .exe or .com file from the shell */
420       /* Allocate some stack space for tables in physical memory */
421       reg_sp-=0x200;
422       //Add Parameter block
423       DOS_ParamBlock block(SegPhys(ss)+reg_sp);
424       block.Clear();
425       //Add a filename
426       RealPt file_name=RealMakeSeg(ss,reg_sp+0x20);
427       MEM_BlockWrite(Real2Phys(file_name),fullname,strlen(fullname)+1);
428       /* Fill the command line */
429       CommandTail cmd;
430       if (strlen(line)>126) line[126]=0;
431       cmd.count=strlen(line);
432       memcpy(cmd.buffer,line,strlen(line));
433       cmd.buffer[strlen(line)]=0xd;
434       /* Copy command line in stack block too */
435       MEM_BlockWrite(SegPhys(ss)+reg_sp+0x100,&cmd,128);
436       /* Parse FCB (first two parameters) and put them into the current DOS_PSP */
437       Bit8u add;
438       FCB_Parsename(dos.psp(),0x5C,0x00,cmd.buffer,&add);
439       FCB_Parsename(dos.psp(),0x6C,0x00,&cmd.buffer[add],&add);
440       block.exec.fcb1=RealMake(dos.psp(),0x5C);
441       block.exec.fcb2=RealMake(dos.psp(),0x6C);
442       /* Set the command line in the block and save it */
443       block.exec.cmdtail=RealMakeSeg(ss,reg_sp+0x100);
444       block.SaveData();
445 #if 0
446       /* Save CS:IP to some point where i can return them from */
447       Bit32u oldeip=reg_eip;
448       Bit16u oldcs=SegValue(cs);
449       RealPt newcsip=CALLBACK_RealPointer(call_shellstop);
450       SegSet16(cs,RealSeg(newcsip));
451       reg_ip=RealOff(newcsip);
452 #endif
453       /* Start up a dos execute interrupt */
454       reg_ax=0x4b00;
455       //Filename pointer
456       SegSet16(ds,SegValue(ss));
457       reg_dx=RealOff(file_name);
458       //Paramblock
459       SegSet16(es,SegValue(ss));
460       reg_bx=reg_sp;
461       SETFLAGBIT(IF,false);
462       CALLBACK_RunRealInt(0x21);
463       /* Restore CS:IP and the stack */
464       reg_sp+=0x200;
465 #if 0
466       reg_eip=oldeip;
467       SegSet16(cs,oldcs);
468 #endif
469    }
470    return true; //Executable started
471 }
472


Since joerg got dosbox to mount when compiled with gcc, I wonder what could be different there when compiled with MipsPro...

_________________
The YOUNG get old, the OLD die -
that's what we've in common, not SGI.
For all you SGI supercomputer owners out there here is a MIPS4 binary of latest DOSBox 0.71. It was compiled using GCC since I feared to run into major difficulties when using MIPSpro.

SDL and all needed libraries that are not part of a basic IRIX 6.5 installation are linked-in static. Also note that this build was done on a post-6.5.18 system and thus probably wont run on older IRIX installations (please give me some feedback if it is working).

If you want to compile the software on your own then take care when compiling SDL (I used 1.2.12): the configure script wont include CD-ROM support on IRIX (dummy cdrom support that is). You have to edit SDL_config.h by hand and add it. Another issue is regarding lround() on IRIX. You have to add these lines after the #includes in src/dos/cdrom_image.cpp:
Code:
#if defined(_sgi_)
long int lround(double x);
#endif

Download it here: http://www.enosnusnu.de/uploads/div/dosbox/DOSBox-0.71_MIPS-4_IRIX65.tar.gz

I went to http://www.alex-soft.net/download/ with some abandonwares on it and downloaded Frogger and Green-Saucer to check them with DOSBox. The O2 machine I was running it on has a video board installed and so it is possible to record an area of the screen with little CPU load. The file is then saved as Quicktime (Motion) JPEG-A.

http://www.enosnusnu.de/uploads/div/dosbox/BLOOD_in_DOSBox_on_IRIX.mov
http://www.enosnusnu.de/uploads/div/dosbox/FROGGER_in_DOSBox_on_IRIX.mov
Installed your binary. Was able to mount my dirs properly. However, trying to run some of my favorites - "The incredible machine" & Infocom's "Journey" - only gave me a "Bus error(coredump)"...

_________________
The YOUNG get old, the OLD die -
that's what we've in common, not SGI.
Oskar45 wrote:
Installed your binary. Was able to mount my dirs properly. However, trying to run some of my favorites - "The incredible machine" & Infocom's "Journey" - only gave me a "Bus error(coredump)"...

I downloaded Frogger and it seems to run. So, your binary probably has serious problems with certain graphics...

_________________
The YOUNG get old, the OLD die -
that's what we've in common, not SGI.
I fist tried the file joerg provided on the first page of this post but after installing the necessary dependencies it would appear to me that the version of flac in nekoware is too new. Or maybe I screwed up something else :D or don't really know what's going on.

Code:
Chaos 30% ./dosbox
1576:./dosbox: rld: Fatal Error: Cannot Successfully map soname 'libFLAC.so.5' under any of the filenames /usr/nekoware/lib/libFLAC.so.5:/usr/lib32/libFLAC.so.5:/usr/lib32/internal/libFLAC.so.5:/lib32/libFLAC.so.5:\
/opt/lib32/libFLAC.so.5:/usr/nekoware/lib/libFLAC.so.5.5:/usr/lib32/libFLAC.so.5.5:/usr/lib32/internal/libFLAC\
.so.5.5:/lib32/libFLAC.so.5.5:/opt/lib32/libFLAC.so.5.5:

Code:
Chaos 3% pwd
/usr/nekoware/lib
Chaos 4% ls libFLAC*
libFLAC++.a       libFLAC++.so.7    libFLAC.la        libFLAC.so.9.0
libFLAC++.la      libFLAC++.so.7.0  libFLAC.so
libFLAC++.so      libFLAC.a         libFLAC.so.9





I also tried ElChupanibre's binary but it seems that my graphics is not setup correctly.
with frame buffer depth of 16:
Code:
Chaos 37% ./dosbox
CONFIG:Loading primary settings from config file dosbox.conf
MIDI:Opened device:none
SDL:OPENGL:No support for texturesize of 1024, falling back to surface
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  129 (MIT-SHM)
Minor opcode of failed request:  3 (X_ShmPutImage)
Serial number of failed request:  499
Current serial number in output stream:  500

tried changing the framebuffer depth but obviously that didn't fix the problem (OT: fixed my flicker problem that came up when I switched to an LCD though ;) )
with frame buffer depth of 8:
Code:
Chaos 4% ./dosbox
CONFIG:Loading primary settings from config file dosbox.conf
MIDI:Opened device:none
SDL:OPENGL:No support for texturesize of 1024, falling back to surface
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  129 (MIT-SHM)
Minor opcode of failed request:  3 (X_ShmPutImage)
Serial number of failed request:  494
Current serial number in output stream:  495


This is my octane with irix 6.5.29 and a v6 graphic card.

In the meantime, I will continue to use freedos in bochs.

_________________
Image (8x3.0ghz) Image (2x1.4ghz)

Image