俺是用VC++的,可是俺们领导却弄了一个超过四万行的汇编...

迷雾夜 2002-03-29 03:04:00
俺是用VC++的,可是俺们领导却弄了一个超过四万行的汇编,要俺弄懂并修改,俺已过几个week的hell,可是有个关于用Ramdrive.sys,将我们做的一个Rom外接卡虚拟成引导用的A盘的段,俺实在没用过Ramdrive.sys,实在看不懂,网上也太少dos3下用Ramdrive.sys且汇编的资料,人说用VC++的人都很聪明,请who给点详细资料或经验,thank you!!!
...全文
93 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yihuo 2002-03-30
  • 打赏
  • 举报
回复
其实汇编没有什么,不知你有没有了DOSBIOS使用详解,只要把程序结构搞清楚,
你不知什么就查什么,就象API,不过这本书可不太好找了。
迷雾夜 2002-03-30
  • 打赏
  • 举报
回复
谢谢
tar 2002-03-29
  • 打赏
  • 举报
回复
Ramdrive.sys
Uses part of the computer's random-access memory (RAM) to simulate a hard disk drive.

Syntax
Device=[Path]RamDrive.sys [DiskSize [SectorSize [NumEntries]]] [/E | /A]

[Path] The full path. Default is the root directory of the start-up drive (usually C:/)
DiskSize Specifies the size of the RAM drive in Kb. Valid values for DiskSize are from 4 to 32767 or amount of memory available, whichever is less. (Default is 64).
SectorSize Specifies the disk sector size in bytes. SectorSize can be 128, 256, or 512 bytes (Default: 512). If a value is specified for SectorSize, DiskSize must also be specified.
NumEntries Specifies the maximum number of files and directories you can create in the RAM drive's root directory. NumEntries can be from 2 to 1024 entries (Default is 64). Each directory entry requires 32 bytes of disk space (64 directory entries x 32 bytes = 2048 bytes = 4 sectors @ 512 bytes). If NumEntries is specified, the number is rounded up to fill the sector. i.e. If NumEntries is specified to be 100, with SectorSize at 512, the actual number of directory entries available will be automatically rounded up to 112.
If NumEntries is specified, DiskSize and SectorSize must also be specified.
If there is not enough memory available to create the RAM drive as specified, RAMDrive will try to create it with a limit of 16 directory entries (1 sector). If there is still insufficient memory, the RAMDisk will not be installed.
By default, RamDrive.sys will create the RAM Disk in conventional memory. The preferred option is to create the disk(s) in extended memory.
/E Creates the RAM drive in extended memory. For RAMDrive to use extended memory, the system must be configured so that it provides extended memory via a device driver such as Himem.sys, for example.
/A Creates the RAM drive in expanded memory. For RAMDrive to use expanded memory, the system must be configured so that it provides expanded memory via an expanded-memory manager such as EMM386.


Notes
This device driver must be loaded by a DEVICE or DEVICEHIGH command in your CONFIG.SYS file.

Ramdrive.sys can create RAM drives with capacities up to 32Mb. Multiple RAM drives can be set up. Each drive must be specified separately.

A status message along the following lines is displayed for each drive as it is loaded:

Microsoft RAMDrive version 3.06 virtual disk F:
Disk size: 2,044k
Sector size: 512 bytes
Allocation unit: 1 sectors
Directory entries: 64





The first line gives the letter allocated by DOS to the drive. This is the first available drive letter and cannot be specified by the user.
Sector size can be specified by the user but all the suggestions I have seen have been to leave this alone. I understand that sectors of 512 bytes are the universally accepted standard for drives of all types (floppy, hard, and RAM).
Allocation Units (AUs) are equivalent to the clusters of physical disks. The amount of memory assigned to a file is 1 or more AUs.
RAMDisk Size [Kb] Sectors/AU AU size[Kb] AUs /Disk
4 - 2044 1 0.5 8 - 4000
2045 - 4083 2 1 2000 - 4000
4084 - 8061 4 2
8 062 - 16 317 8 4
16 318 - 32 629 16 8
32 630 - 32 767 32 16 2000

The above table indicates that a single RAMDisk cannot hold more than 4000 files however small the files or large the disk. Furthermore, a file of 1500 bytes will require 4 AUs (2048 bytes) on a 1Mb RAMDisk and 1 AU (17,384 bytes) on a disk of 32,767 Kb.

"Directory entries" is the maximum number of files/directories that can be accomodated in the root directory of the RAMDisk - any number of files/subdirectories can be held in subdirectories below the root. This number (NumEntries) can be specified when setting up the RAMDisk but the default (64) is a pretty reasonable figure for most uses.

RAM drives are much faster than hard disk drives because your computer can read information faster from memory than from a hard disk. As far as the computer is concerned, a RAM drive appears to be a normal hard disk drive which can be used as any other hard drive.
The most important difference between a real disk drive and a RAM drive is that all information on a RAM drive is lost when the computer is turned off/restarted. It is thus most important to save any data written to a RAM disk on more permanent media before shutting down.


In a Dos environment, RAM drives can be particularly useful when working with programs that do frequent disk read/write operations - often with temporary files.

In a Win95/8 environment, RAM drives are seldom useful because Windows uses all available memory. Although it may seem a neat idea to use a RAM drive for the Windows swap file, this is very seldom practical. Windows only uses a swap file when it has run out of RAM. Reducing the amount of available RAM by making a RAM drive will mean that a swap file will be required sooner (and it won't be large enough, anyway). In short, creating a RAM drive to use for a swap file is equivalent to specifing a swap file size of 0 without a RAM drive - in both cases most systems will typically give an "out of memory" message sooner or later.

There are alternative RAM drives available that do not need to be loaded in Config.sys and/or do not have the 32Mb limit. I have not used any myself but see: The Simtel.Net MS-DOS Collection - Memory resident disks. [Further to this, a ramdisk called XMSDSK by Franck Uberto seemed to be well thought of in a news:comp.os.msdos.misc discussion. Apparently it is available from ftp.simtel.net in /msdos/ramdisk and has the filename fu_rd19i.zip].

Example
To create a RAM Drive of 32 Mb (the maximum possible with RamDrive.sys), include the following lines in Config.sys:

Device=c:\Windows\Himem.sys Enables access to extended memory
Device=c:\Windows\Emm386.exe NoEms Provides access to upper memory blocks (UMBs)
Dos=High,UMB Lets Dos load into high memory and manage the UMBs
DeviceHigh=c:\Windows\RamDrive.sys 32767 /E Creates a 32 Mb RAM Drive in extended memory.


File Details
File Name Default Location Dos Ver. Win Ver. Size Date Source
Ramdrive.sys c:\windows 7.0 Win95 12 6631 11/07/95 win95_09.cab
7.1 Win95 (OSR2.x) 12 6631 24/08/96 win95_14.cab
Win98 12 6631 11/05/98 base5.cab
Win98 SE 12 6631 23/04/99 base5.cab

Superscripts denote which same size files, if any, are identical (using FC).


--------------------------------------------------------------------------------
Thanks to L.H. Loo for filling in the details of the Win98SE version.
Thanks to Jos?Miyara for putting me onto the significance of Allocation Unit size.
If you should have any comments or suggestions,
please contact: Bob Watson. This page last revised:
October 7, 2001

hello008 2002-03-29
  • 打赏
  • 举报
回复
是不是把别人的程序反汇编了给你?你惨了,你们领导是故意整你啊。

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧