DOS newbie help required 
Author Message
 DOS newbie help required



Quote:
> Greetings,
> we're using is a DELL PC with a Pentium chip (luckily we're doing no FP !)
> and will be fitted with 32 MB of RAM or so. We're using DOS 6.2 (I believe)
> and the latest WatCom V10 C/C++ compiler.
> We're only going to save 16 MB of data at a time, so there shouldn't be any
> memory shortages.
> I was hoping that like UNIX, I'd just be able to malloc() a 16 MB buffer and
> bung the data straight in. However, a colleague (of self-confessed old and
> dubious DOS knowledge) tells me that in order to access such an amount of
> memory, I need to run in protected mode and use extended (EMS or XMS) memory.
> If this true ? and if so, how do I switch to protected mode, and how so I
> access and manipulate such memory....

You already have solved the problem. Just use Watcom's 32-bit compiler
(WCL386), and let it create a DOS-Extended application (using DOS/4GW
DOS-Extender). The version of DOS4GW shipped with the compiler is limited
just to 32MB of RAM. If you upgrade your computer with more RAM, you will
have to buy a 'professional' version of DOS4GW (called 4GWPRO). The
exteder (in general) needs no EMS or XMS manager, but if you have
installed any (HIMEM, EMM386, QEMM, 386^MAX,...), the extender can
cooperate with your memory manager.

Under 32-bit flat model, you can access up to 4 gigabytes of memory. So
if you have 32MB, you can easily use malloc(16*1024*1024L) to allocate
16MB buffer (if the memory isn't fragmented).

Quote:
> Regards.
>     Nick Pitfield.

All the best

--Vladimir

+-----------------------------------+------------------------------------+

| Technical University of Brno      |       The louder the music,        |
| Czech Republic                    |       the better the code ...      |



Tue, 08 Jul 1997 20:18:35 GMT  
 DOS newbie help required

Quote:

> Greetings,
> *** apologies if I'm posting to the wrong groups here - I'm a UNIX man ***
> *** who's suddenly had to walk the unknown paths of the DOS world !!!! ***
> I'm an experienced UNIX/C programmer who last used DOS about 5-6 years ago
> when C compilers had to be told to use tiny/small/large etc memory models
> when compiling code. I've now got to knock together a quick C test program
> on a DOS machine for a project I'm (very) loosely involved in, and would
> like to check the state of play regarding DOS C programs these days....
> The program needs to reads in some data from an I/O card (I have the code
> for this bit), store it in memory (there could be problems here), then save
> to disk (easy) and allow off-line analysis of the data (easy). The machine
> we're using is a DELL PC with a Pentium chip (luckily we're doing no FP !)
> and will be fitted with 32 MB of RAM or so. We're using DOS 6.2 (I believe)
> and the latest WatCom V10 C/C++ compiler.
> We're only going to save 16 MB of data at a time, so there shouldn't be any
> memory shortages.
> I was hoping that like UNIX, I'd just be able to malloc() a 16 MB buffer and
> bung the data straight in. However, a colleague (of self-confessed old and
> dubious DOS knowledge) tells me that in order to access such an amount of
> memory, I need to run in protected mode and use extended (EMS or XMS) memory.
> If this true ? and if so, how do I switch to protected mode, and how so I
> access and manipulate such memory....

Your colleague is correct.  However, with the Watcom compiler it's very easy as
long as your I/O card is not interrupt driven.  Look in the Programmer's
Guide under "Creating 32-Bit DOS/4GW Applications.  If your card needs
to be interrupt driven it gets trickier.  Look at the section on installing
a bi-modal interrupt handler.  With this solution you can just malloc()
the memory and use "normal" code to store the data.

As your colleague said, you can also use EMS or XMS memory.  This isn't
really terribly difficult, but I don't think Watcom provides any built-in
support.  You should be able to find code for accessing EMS or XMS via ftp
from any system that caters to the DOS crowd.

A third possibility would be to create a ram-disk and just write the data
to it.  This is very easy, of course.  It's a bit slower than just storing
it but much faster than normal disk I/O and may be suitable.

--
Mike Rubenstein



Wed, 09 Jul 1997 19:25:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DOS newbie help required

2. Help required for newbie

3. Newbie - help required with web integration

4. Newbie requires mouse help

5. DLL Queries -- Newbie Help Required

6. **Borland C DOS compiler command syntax help for newbie

7. newbie needs Borland DOS file help...

8. **Borland C DOS compiler command syntax help for newbie

9. DOS/Windows file header information required

10. Newbie very puzzled - no cast required??

11. Newbie requires source etc

12. Newbie: Headers Required For Creating TCPIP Server Port

 

 
Powered by phpBB® Forum Software