VOGONS


First post, by RayGunner

User metadata
Rank Newbie
Rank
Newbie

I'm trying to play Project: Nomad, with DOSBox, but I have a trouble. It throws me this error: "Unable to redirect output to NUL", and DOSBox hangs heavely.

The error don't shows on the status window of the DOSBox. It shows on DOSBox main window, so I suppose that it's an error from Nomad.

I've found on this forum other thread about Nomad, for a problem on errors with the sound on 0.57, but the game itself works great. From 0.58 onwards, the game never works again. Nevertheless i've followed the method showed in that post, but I get the same error.

Some ideas on that?

PD: Someone has version 0.57 of DOSBox to try it? At Sourceforge page I only found 0.58+

Thanks in Advance.

--------------------------------------
AMD Athlon XP 2000+
Onboard Realtek Soundcard
nVidia FX 5200
Win XP Pro

Reply 1 of 9, by RayGunner

User metadata
Rank Newbie
Rank
Newbie

More info.

I've messing around with the code on CVS and using the debugger (impressive... very very useful.. 😀 ) and i've found the problem (i think)

Digging a little the code, i've added the NUL device starting from the code of CON device. The device works ok, but I think (back on the old times of programming DOS) that certain device files (STDIN, STDOUT, NUL...) have fixed handles: Well. On DOSBox have different ones depending on what order has been opened for the first time. (look dos_files.cpp - DOS_Openfiles() )

So, back to the game, it tries to open NUL and waits for DOS to return it in handle 1! Hardcoded, no other options, sorry 😜 and DOSBox returns it on handle 8. Inmediatly, a fatal error develops...

Maybe all that text are bullshit to the programmers... I don't know very good the code yet, and I don't know if i'm doing a very bad thing... But, in fact, changing the return value of the handle and later restoring it with the debugger, the game works. Perfectly. With sound.

Can anyone of the programmers look at that? Please? Don't hesitate on asking me anything about the subject.

Thanks a lot.

Reply 2 of 9, by taiken7

User metadata
Rank Member
Rank
Member

I'd be really interested to see your modifications, since Ive been
tinkering in the background with /DEV's for a bit ...

Here's a bit of code and a loader to successfully get 1 device driver
loading (as if it had been in the config.sys)

Add this code to the end of dos.cpp; function DOS_Init(Section* sec) to setup the table.
(We should request some memory, but I'm not sure how)

// Create NUL Device Header

RealPt addr=dos_infoblock.GetPointer();
Bit16u TheSeg = RealSeg(addr);
Bit16u TheOfs = RealOff(addr)+0x22;

// NUL Header:
real_writew(TheSeg,TheOfs-34, (Bit16u) 0x003A-0x19); // pointer 2 1st table Ofs..
real_writew(TheSeg,TheOfs-32, (Bit16u) TheSeg); // pointer 2 1st table ..


// real_writew(TheSeg,TheOfs+2, (Bit16u) TheOfs+18-0x19); // Next ..
// real_writew(TheSeg,TheOfs+0s, (Bit16u) TheSeg); // Next ..

real_writew(TheSeg,TheOfs+0, (Bit16u) 0xffff); // SetNextDeviceHeader (0xFFFFFFFF);
real_writew(TheSeg,TheOfs+2, (Bit16u) 0xffff); // Hacked for Devloader
real_writew(TheSeg,TheOfs+4, (Bit16u) 0x8004); // SetAttribute(0x8004);
real_writew(TheSeg,TheOfs+6, (Bit16u) TheOfs+18); // SetStrategy(TheOfs+18);
real_writew(TheSeg,TheOfs+8, (Bit16u) TheOfs+18+6); // SetInterrupt(TheOfs+18+6);
real_writew(TheSeg,TheOfs+10, (Bit16u) 0x4e55); // Setname: "NU"
real_writew(TheSeg,TheOfs+12, (Bit16u) 0x4c20); // "L "
real_writew(TheSeg,TheOfs+14, (Bit16u) 0x2020); // " "
real_writew(TheSeg,TheOfs+16, (Bit16u) 0x2020); // " "

// NUL Driver code:
real_writew(TheSeg,TheOfs+18+0, (Bit16u) 0x2681);
real_writew(TheSeg,TheOfs+18+2, (Bit16u) 0x4f03);
real_writew(TheSeg,TheOfs+18+4, (Bit16u) 0x0001);
real_writew(TheSeg,TheOfs+18+6, (Bit16u) 0xcb00);

TheOfs+=26;

// These seem to be getting overwritten ..
// Header: CON
real_writew(TheSeg,TheOfs+2, (Bit16u) TheOfs+18-0x19); // Next ..
real_writew(TheSeg,TheOfs+0, (Bit16u) TheSeg); // Next ..
// Attrib:
real_writew(TheSeg,TheOfs+4, (Bit16u) 0x8013);
// Strategy:
real_writew(TheSeg,TheOfs+6, (Bit16u) 0xFFFF); //OFS
// Interrupt:
real_writew(TheSeg,TheOfs+8, (Bit16u) 0xFFFF); //SEG
// Name:
real_writew(TheSeg,TheOfs+10, (Bit16u) 0x434F); //NAME
real_writew(TheSeg,TheOfs+12, (Bit16u) 0x4e20);
real_writew(TheSeg,TheOfs+14, (Bit16u) 0x2020);
real_writew(TheSeg,TheOfs+16, (Bit16u) 0x2020);
TheOfs+=18;

// Header: AUX
real_writew(TheSeg,TheOfs+2, (Bit16u) TheOfs+18-0x19); // Next ..
real_writew(TheSeg,TheOfs+0, (Bit16u) TheSeg); // Next ..
// Attrib:
real_writew(TheSeg,TheOfs+4, (Bit16u) 0x8000);
// Strategy:
real_writew(TheSeg,TheOfs+6, (Bit16u) 0xFFFF); //OFS
// Interrupt:
real_writew(TheSeg,TheOfs+8, (Bit16u) 0xFFFF); //SEG
// Name:
real_writew(TheSeg,TheOfs+10, (Bit16u) 0x4155); //NAME
Show last 22 lines
  real_writew(TheSeg,TheOfs+12, (Bit16u) 0x5820); 
real_writew(TheSeg,TheOfs+14, (Bit16u) 0x2020);
real_writew(TheSeg,TheOfs+16, (Bit16u) 0x2020);
TheOfs+=18;

// Header: PRN
real_writew(TheSeg,TheOfs+2, (Bit16u) 0xFFFF); // END OF LIST
real_writew(TheSeg,TheOfs+0, (Bit16u) TheSeg); // Next ..
// Attrib:
real_writew(TheSeg,TheOfs+4, (Bit16u) 0xA8C0);
// Strategy:
real_writew(TheSeg,TheOfs+6, (Bit16u) 0xFFFF); //OFS
// Interrupt:
real_writew(TheSeg,TheOfs+8, (Bit16u) 0xFFFF); //SEG
// Name:
real_writew(TheSeg,TheOfs+10, (Bit16u) 0x5052); //NAME
real_writew(TheSeg,TheOfs+12, (Bit16u) 0x4E20);
real_writew(TheSeg,TheOfs+14, (Bit16u) 0x2020);
real_writew(TheSeg,TheOfs+16, (Bit16u) 0x2020);


(If you want to test Ansi.sys, Emm386.exe (win9X etc, try setting the
dos version to 0x700a);

int 21/function 30:
reg_al=dos.version.major=0x7;
reg_ah=dos.version.minor=0xa;

NOTE this hack breaks after the first device is loaded, so the others
will enter an infinite loop trying to walk the chain of devices (List-of-lists)

Attachments

  • Filename
    devload.exe
    File size
    5.79 KiB
    Downloads
    180 downloads
    File comment
    Device driver loader
    File license
    Fair use/fair dealing exception

Reply 8 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Remind me of testing it.. I rewrote devices support so the problems described in the first section (missing nul + opening of it on number 1) should be fixed.

(except it they start it like this nomad.exe >nul )

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