1
0
Fork 0

dos changes c2woody

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1689
This commit is contained in:
Peter Veenstra 2004-02-28 16:35:42 +00:00
parent 410b9f72d2
commit e05d508f81
6 changed files with 72 additions and 14 deletions

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_inc.h,v 1.38 2004-02-28 16:35:42 qbix79 Exp $ */
#ifndef DOS_H_
#define DOS_H_
@ -349,19 +351,37 @@ public:
#pragma pack(1)
#endif
struct sDIB {
Bit8u stuff1[20]; // -0x18 some stuff, hopefully never used....
RealPt firstMCB; // -0x04 first memory control block
RealPt firstDPB; // 0x00 first drive parameter block
Bit16u regCXfrom5e; // -0x18 CX from last int21/ah=5e
Bit16u countLRUcache; // -0x16 LRU counter for FCB caching
Bit16u countLRUopens; // -0x14 LRU counter for FCB openings
Bit8u stuff1[6]; // -0x12 some stuff, hopefully never used....
Bit16u sharingCount; // -0x0c sharing retry count
Bit16u sharingDelay; // -0x0a sharing retry delay
RealPt diskBufPtr; // -0x08 pointer to disk buffer
Bit16u ptrCONinput; // -0x04 pointer to con input
Bit16u firstMCB; // -0x02 first memory control block
RealPt firstDPB; // 0x00 first drive parameter block
RealPt firstFileTable; // 0x04 first system file table
RealPt activeClock; // 0x08 active clock device header
RealPt activeCon; // 0x0c active console device header
RealPt activeCon; // 0x0c active console device header
Bit16u maxSectorLength; // 0x10 maximum bytes per sector of any block device;
RealPt discInfoBuffer; // 0x12 pointer to disc info buffer
RealPt curDirStructure; // 0x16 pointer to current array of directory structure
RealPt fcbTable; // 0x1a pointer to system FCB table
Bit8u stuff2[0x21]; // 0x1e more stuff
Bit16u buffers_x; // x in BUFFERS x,y
Bit16u buffers_y; // y in BUFFERS x,y
RealPt fcbTable; // 0x1a pointer to system FCB table
Bit16u protFCBs; // 0x1e protected fcbs
Bit8u blockDevices; // 0x20 installed block devices
Bit8u lastdrive; // 0x21 lastdrive
Bit8u stuff2[0x12]; // 0x22 NUL driver
Bit8u joindedDrives; // 0x34 joined drives
Bit16u specialCodeSeg; // 0x35 special code segment
RealPt setverPtr; // 0x37 pointer to setver
Bit16u a20FixOfs; // 0x3b a20 fix routine offset
Bit16u pspLastIfHMA; // 0x3d psp of last program (if dos in hma)
Bit16u buffers_x; // 0x3f x in BUFFERS x,y
Bit16u buffers_y; // 0x41 y in BUFFERS x,y
Bit8u bootDrive; // 0x43 boot drive
Bit8u useDwordMov; // 0x44 use dword moves
Bit16u extendedSize; // 0x45 size of extended memory
// some more stuff, hopefully never used.
} GCC_ATTRIBUTE(packed);
#ifdef _MSC_VER

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos.cpp,v 1.66 2004-02-18 13:02:55 qbix79 Exp $ */
/* $Id: dos.cpp,v 1.67 2004-02-28 16:35:14 qbix79 Exp $ */
#include <stdio.h>
#include <stdlib.h>
@ -764,6 +764,10 @@ static Bitu DOS_21Handler(void) {
}
break;
}
case 0x5f: /* Network redirection */
reg_ax=0x0001; //Failing it
CALLBACK_SCF(true);
break;
case 0x60: /* Canonicalize filename or path */
MEM_StrCopy(SegPhys(ds)+reg_si,name1,DOSNAMEBUF);
if (DOS_Canonicalize(name1,name2)) {
@ -872,7 +876,6 @@ static Bitu DOS_21Handler(void) {
case 0x32: /* Get drive parameter block for specific drive */
case 0x5c: /* FLOCK File region locking */
case 0x5e: /* More Network Functions */
case 0x5f: /* And Even More Network Functions */
default:
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al);
reg_al=0x00; /* default value */

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_classes.cpp,v 1.34 2004-02-03 14:54:36 finsterr Exp $ */
/* $Id: dos_classes.cpp,v 1.35 2004-02-28 16:35:14 qbix79 Exp $ */
#include <string.h>
#include <stdlib.h>
@ -64,11 +64,36 @@ void DOS_InfoBlock::SetLocation(Bit16u segment)
pt=PhysMake(seg,0);
/* Clear the initual Block */
for(Bitu i=0;i<sizeof(sDIB);i++) mem_writeb(pt+i,0xff);
sSave(sDIB,activeCon,RealMake(0x54,0));
sSave(sDIB,regCXfrom5e,(Bit16u)0);
sSave(sDIB,countLRUcache,(Bit16u)0);
sSave(sDIB,countLRUopens,(Bit16u)0);
sSave(sDIB,protFCBs,(Bit16u)0);
sSave(sDIB,specialCodeSeg,(Bit16u)0);
sSave(sDIB,joindedDrives,(Bit8u)0);
sSave(sDIB,lastdrive,(Bit8u)0x18);
sSave(sDIB,setverPtr,(Bit32u)0);
sSave(sDIB,a20FixOfs,(Bit16u)0);
sSave(sDIB,pspLastIfHMA,(Bit16u)0);
sSave(sDIB,blockDevices,(Bit8u)0);
sSave(sDIB,bootDrive,(Bit8u)0);
sSave(sDIB,useDwordMov,(Bit8u)1);
sSave(sDIB,extendedSize,(Bit16u)0x4000); // >16mb
sSave(sDIB,sharingCount,(Bit16u)0);
sSave(sDIB,sharingDelay,(Bit16u)0);
}
void DOS_InfoBlock::SetFirstMCB(Bit16u _firstmcb)
{
sSave(sDIB,firstMCB,RealMake(_firstmcb,0));
sSave(sDIB,firstMCB,_firstmcb); //c2woody
}
void DOS_InfoBlock::SetfirstFileTable(RealPt _first_table){

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id */
/* $Id: dos_execute.cpp,v 1.35 2004-02-28 16:35:14 qbix79 Exp $ */
#include <string.h>
#include "dosbox.h"
@ -298,6 +298,9 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
else memsize=maxsize;
if (!DOS_AllocateMemory(&pspseg,&memsize)) E_Exit("DOS:Exec error in memory");
loadseg=pspseg+16;
if ((!iscom) & (head.minmemory == 0) & (head.maxmemory == 0))
loadseg = (0x9fed0 - imagesize)/16; //c2woody
} else loadseg=block.overlay.loadseg;
/* Load the executable */
Bit8u * loadbuf=(Bit8u *)new Bit8u[0x10000];

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_ioctl.cpp,v 1.18 2004-01-10 14:03:34 qbix79 Exp $ */
/* $Id: dos_ioctl.cpp,v 1.19 2004-02-28 16:35:14 qbix79 Exp $ */
#include <string.h>
#include "dosbox.h"
@ -97,6 +97,10 @@ bool DOS_IOCTL(void) {
mem_writew(ptr+2,drive>=2); // nonremovable ?
mem_writew(ptr+4,0x0000); // num of cylinders
mem_writeb(ptr+6,0x00); // media type (00=other type)
// drive parameter block following
mem_writeb(ptr+7,drive); // drive
mem_writeb(ptr+8,0x00); // unit number
mem_writed(ptr+0x1f,0xffffffff); // next parameter block
break;
default :
LOG(LOG_IOCTL,LOG_ERROR)("DOS:IOCTL Call 0D:%2X Drive %2X unhandled",reg_cl,drive);

View file

@ -57,6 +57,9 @@ void DOS_SetupTables(void) {
mem_writeb(Real2Phys(dos.tables.indosflag),0);
/* Create the DOS Info Block */
dos_infoblock.SetLocation(DOS_GetMemory(1+(sizeof(DOS_InfoBlock::sDIB)/16)));
// dos_infoblock.SetLocation(0x4e); //c2woody
/* The above lines might be switched around when working on certain programs */
/* Create a fake SFT, so programs think there are 100 file handles */
seg=DOS_GetMemory(1);
real_writed(seg,0,0xffffffff); //Last File Table