real mode dos & win dos

This is a discussion on real mode dos & win dos within the A Brief History of Cprogramming.com forums, part of the Community Boards category; The Windows DOS shell is just an emulated DOS, but it is so close to the original that I've never, ...

  1. #16
    Unregistered
    Guest
    The Windows DOS shell is just an emulated DOS, but it is so close to the original that I've never, repeat never, had any problem using assembly language or anything else. The only problems I've had are directyl related to hardware - in fact memory access is faster in a DOS box than in pure DOS.

    If you don't believe me, fire up your favorite text editor and scroll down in both pure DOS and DOS shell. The DOS shell will run faster. So, in reality, your apps (if you still code apps for DOS) will run much faster in a DOS shell.

    Also the DMA problem is directly related to how Windows is managing me messing around directly with the hardware. The DMA chip does not properly reset under a Windows shell so you must reset it 4 times. In pure DOS this is not a problem and its not related to my programming. Some DOS games wont even run in a DOS shell (Crusader and Crusader:No Regret for examples). This is because most DOS32 games load a sound driver into memory prior to running. Often times these drivers don't quite act the same in DOS shell as they do in pure DOS. So really your best bet is to code for Windows and not DOS. Personally, I despise Windows programming and about all I can take is enough to do DirectX and Direct3D.

    Programming games and apps in DOS was usually very low-level and hardware specific so attempting to do this today on hardware designed to run under Windows is quite a daunting task. Best bet is to move to the Windows platform and come join the dark side

    To quote Andre Lamothe - "...the dark side always seems to have the best technology."

    Believe it or not you can setup a small Win32 shell in DirectX and basically write your graphics program or game just like you were inside of a DOS32 shell - with a couple of minor differences - but you can gain access to the video memory, or a pointer to it, if need be.

    You can do this in DirectX:

    videobuffer[y*320+x]=color;

    But in DirectX it looks more like this:

    videobuffer[y+x*mempitch]=color;

    Same principle. Not to mention that in DirectX page flipping is trivial (not so in DOS) and you can use the hardware blitter easily (DOS takes some special low level interaction witht the hardware for this and is not guranteed to work with every card). Take my advice Sunny and move to Windows and DirectX - you'll never look back - I've made the move to the dark side if you will and trust me, it's really not that bad. I still code in DOS just to tinker around but for serious stuff I use Win32 or DirectX.

    So go purchase a book like Tricks of the Windows Game Programming Gurus or something similar and make the move to DirectX - or buy a book on Win32 programming and dive in. Windows is very complex but thankfully it does not require that you know the entire API before you can use it.

    If you want some more information, contact me via PM on this board. Just imagines being able to develop programs that had sound, GUI, great graphics, speed, stability, worked on nearly ever Intel/AMD config, and hid most of the low-level stuff from you so that you could concentrate on the task at hand instead of all the nitty gritty stuff.

  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Once again Bubba forgets to log in.


  3. #18
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    there's still programs that require pure DOS environments. I know QBasic is one of them. At least the old versions. I'm not sure exactly why but my theory is on page 1

  4. #19
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Incorrect.

    QBasic will work inside of a DOS shell as well as VB DOS, C++, NASM/MASM/TASM, and DJGPP must be ran in a DOS shell. Even the old BASICA will work in a DOS shell.

    Games, however, normally require pure DOS usually because of the sound driver they load into memory.

  5. #20
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Incorrect.

    At least I've got a version that came free with Windows 3.11 - that explicitly specifies not to run it in a shell. I agree that for the most part they're the same, but there are minor differences (like available RAM usage) that anyone doing some serious DOS programming might need to be aware of.

  6. #21
    Registered User
    Join Date
    Jun 2002
    Posts
    44

    Talking

    YES!:
    Finally someone is talking about true/win DOS.I need a compiler that will compile true-DOS REAL BAD.It's EXTREMELY FRUSTRATING( ) to have to search so hard just to write simple old true-DOS programs,after all,Windows was origionaly supose to be but an utility anyway.can anyone tell me of a compiler that will compile true-dos(hopefully free and very hopefully...on this site ).Please say you do,it would solve a lingreing,simple and frustrating problem i've had for a long time

  7. #22
    Unregistered
    Guest

    Console C++ program problem in dos shell

    Hi, something very weird just happened to me today. I successfully compiled a simple program using MingW today but when I try to run it in dos shell (under win2k sp1), it crashes with message:

    Instruction at "0Xxxxxxxxx" referenced memory at "0X00000000". The memory could not be "read".

    I copied the program to an NT workstation and ran it in shell and it crashed with:

    Exception: access violation (0xc0000005), Address: 0Xxxxxxxxx

    Anyone knows if this is a DOS shell problem or a win2k/winNT problem in general?

  8. #23
    Registered User
    Join Date
    Jun 2002
    Posts
    44
    the 'Dark side' is right.Windows messes everything up.Viruses would be imposible to create if it wasnt for the Windows registry.So many mangled drivers and uncustomization that very soon you realize that you computer has been stolen by microsoft."Do not attempt to adjust the software on your computer.We are under complete control.We can make your screen jump,or fade or go black and still get praise,due to our expert brainwashing."
    ego sum via et veritas et vitae -Jesus Christ

  9. #24
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by Powerfull Army
    the 'Dark side' is right.Windows messes everything up.Viruses would be imposible to create if it wasnt for the Windows registry.
    Ugh.....not really.....The concept of a virus predates windows by quite a while......if all viruses were linked to the registry then virus killing would be a doddle...

    Originally posted by Powerfull Army
    So many mangled drivers and uncustomization that very soon you realize that you computer has been stolen by microsoft."Do not attempt to adjust the software on your computer.We are under complete control.We can make your screen jump,or fade or go black and still get praise,due to our expert brainwashing."

    Hmm...dont tell me....linux fiend right?

  10. #25
    Registered User
    Join Date
    Jul 2002
    Posts
    161
    Getting back to the original topic, real mode dos and a dos box in win 95 and later are two very different things. Real mode dos is basically a 16 bit 8086 compatability os and a dos box is a 32 bit protected mode emulation of a 16 os. The trouble is that Bill Gates dosn't believe in protected mode superuser status for users and that means that a dos box cannot properly access hardware directly. Old dos 6.22 era games in particular tended to directly manipulate hardware in order to boost performance. Sound cards have real problems in a dos box.

  11. #26
    Registered User
    Join Date
    Feb 2002
    Posts
    98
    i dont think you can run dos under any nt based os. something to do with memory managment

  12. #27
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946

    Re: Console C++ program problem in dos shell

    Originally posted by Unregistered
    Hi, something very weird just happened to me today. I successfully compiled a simple program using MingW today but when I try to run it in dos shell (under win2k sp1), it crashes with message:

    Instruction at "0Xxxxxxxxx" referenced memory at "0X00000000". The memory could not be "read".

    I copied the program to an NT workstation and ran it in shell and it crashed with:

    Exception: access violation (0xc0000005), Address: 0Xxxxxxxxx

    Anyone knows if this is a DOS shell problem or a win2k/winNT problem in general?
    your program sucks; it is trying to read memory that is not its.
    hello, internet!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with this
    By tyrantil in forum C Programming
    Replies: 18
    Last Post: 01-30-2005, 03:53 PM
  2. Implementing "ls -al"
    By pdstatha in forum Linux Programming
    Replies: 11
    Last Post: 03-20-2002, 03:39 AM
  3. Implementing "ls -al"
    By pdstatha in forum C Programming
    Replies: 7
    Last Post: 03-06-2002, 04:36 PM
  4. Beeping speaker in Win console mode
    By Tesseract in forum C Programming
    Replies: 3
    Last Post: 12-08-2001, 08:49 PM
  5. Text in Dos Graphics Mode
    By Frozen_Solid in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-25-2001, 04:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21