⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ramutil.c

📁 ramdisk,著名的内存虚拟磁盘的源代码
💻 C
字号:
//=============================================================================
//
// Compuware Corporation
// NuMega Lab
// 9 Townsend West
// Nashua, NH 03060  USA
//
// Copyright (c) 1998 Compuware Corporation. All Rights Reserved.
// Unpublished - rights reserved under the Copyright laws of the
// United States.
//
//=============================================================================

// RFSDUTIL.C - Utility routines for Registry File System
// Copyright (c) 1996, Compuware Corporation

#include  "ramdisk.h"
#include PAGEABLE_CODE_SEGMENT
#include PAGEABLE_DATA_SEGMENT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Function
//	SetupDCB
//
// Purpose
//	Initializes fields of a DCB passed to the port driver on an
//	AEP_INQUIRY call.
//
// Parameters
//	pDcb	address of the DCB to initialize
//
// Return Value
//	nonen
//
// Remarks
//	The upper IOS layers are fairly sensitive the values inserted 
//	into the DCB by this routine. The fields must be consistent with
//	values supplied in the INF file and the DRP, or the upper layers
//	may ignore or unconfig the DCB. What's not clear is exactly which
//	parameters have a critical role.

VOID SetupDCB(DCB* pDcb)
{
	pDcb->DCB_max_xfer_len= 4*512;//0xFFFFFFFF;
	
	pDcb->DCB_actual_sector_cnt[0] = 6144;
	pDcb->DCB_actual_sector_cnt[1] = 0;
	
	pDcb->DCB_actual_blk_size = 512;
	pDcb->DCB_actual_head_cnt = 1;
	pDcb->DCB_actual_cyl_cnt = 1;
	pDcb->DCB_actual_spt = 6144;
		
	pDcb->DCB_cmn.DCB_TSD_Flags = DCB_TSD_ACTUAL_PRE_SET;
	pDcb->DCB_cmn.DCB_device_type = DCB_type_disk;
	pDcb->DCB_cmn.DCB_device_flags |= DCB_DEV_WRITEABLE|DCB_DEV_SERIAL_CMD;
	pDcb->DCB_max_sg_elements =1;		
	pDcb->DCB_q_algo = DCB_q_fi_fo;		

}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Function
//	AssociateDriveLetter
//
// Purpose
//	Associate a drive letter with a DCB
//
// Parameters
//	pDcb	pointer to the DCB
//
// Return Value
//	Returns the assigned drive letter code (A=0).
//
// Remarks
//	To do this requires two calls to the IOS service routine in 
//	the first field of the ILB. The first call grabs the next
//	free drive letter, and the second call binds the DCB to that
//	drive letter.
//
//	It has been observed that previously configured network shares
//	may end up conflicting with the RFSD upon booting after the 
//	initial installation. This is not serious - simply redefine the
//	shares to the next letter.
//
//	A port driver should not really have to do this - the DISKTSD
//	(or voltrack?) should take care of it automatically. Again, 
//	it is not clear exactly what the requirements are for having the
//	IOS automatically assign a drive letter, but this approach seems
//	to work fine.
//
/*
BYTE AssociateDriveLetter(DCB_COMMON* pDcb)
{
	ISP_pick_drive_letter PDisp;
	ISP_dcb_associate ADisp;	

// Set up an ISP to grab the next free drive letter and send it.

	PDisp.ISP_p_d_l_hdr.ISP_func = ISP_DRIVE_LETTER_PICK;
	PDisp.ISP_p_d_l_pdcb = pDcb;
	PDisp.ISP_p_d_l_flags = 0;
	RAMDISK_Ilb.ILB_service_rtn((PISP)&PDisp);

// Now bind the allocated drive letter to the DCB.

	ADisp.ISP_d_a_hdr.ISP_func = ISP_ASSOCIATE_DCB;
	ADisp.ISP_d_a_dcb = pDcb;
	ADisp.ISP_d_a_drive = PDisp.ISP_p_d_l_letter[0];
	RAMDISK_Ilb.ILB_service_rtn((PISP)&ADisp);

	return (pDcb->DCB_drive_lttr_equiv = PDisp.ISP_p_d_l_letter[0]);
}

*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -