Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Vista non-WIN32 apps memory restriction

Vista non-WIN32 apps memory restriction

Scheduled Pinned Locked Moved Windows API
helpdatabasejsonperformanceannouncement
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hb_harshad
    wrote on last edited by
    #1

    Hi, I have an executable image created for DOS environment using WATCOM compiler. It requires more than 32MB memory and it works fine on Windows XP. But as Windows Vista restricts non-Win32 executables to 32MB of memory it wont get executed on Vista Platform. My query is their any way for DOS executables to identify whether they are running on Windows XP environment or Windows vista environment. Means any API to get DOS version so that i can restrict my memory usage to 32MB on vista. Please help me out to overcome this problem. Regards, Harshad Bhujbal.

    M 1 Reply Last reply
    0
    • H hb_harshad

      Hi, I have an executable image created for DOS environment using WATCOM compiler. It requires more than 32MB memory and it works fine on Windows XP. But as Windows Vista restricts non-Win32 executables to 32MB of memory it wont get executed on Vista Platform. My query is their any way for DOS executables to identify whether they are running on Windows XP environment or Windows vista environment. Means any API to get DOS version so that i can restrict my memory usage to 32MB on vista. Please help me out to overcome this problem. Regards, Harshad Bhujbal.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      I'm not aware of any hard limit. Check the Memory tab in the properties for the application to see how much of which sort of memory Windows will give it. Does it require EMS, XMS, DOS Protected Mode? It may be that the Auto setting now gives less memory than it used to. Frankly you should port this application to Win32. 64-bit Windows does not provide a DOS environment because it can't - the processor feature, Virtual 8086 mode, was removed from 64-bit Long Mode by AMD.

      DoEvents: Generating unexpected recursion since 1991

      T 1 Reply Last reply
      0
      • M Mike Dimmick

        I'm not aware of any hard limit. Check the Memory tab in the properties for the application to see how much of which sort of memory Windows will give it. Does it require EMS, XMS, DOS Protected Mode? It may be that the Auto setting now gives less memory than it used to. Frankly you should port this application to Win32. 64-bit Windows does not provide a DOS environment because it can't - the processor feature, Virtual 8086 mode, was removed from 64-bit Long Mode by AMD.

        DoEvents: Generating unexpected recursion since 1991

        T Offline
        T Offline
        The Cake of Deceit
        wrote on last edited by
        #3

        Actually, AMD64 processors do support 8086 mode in long mode )see http://toastytech.com/guis/winvista2.html[^]), just that MS removed the old Win16 emulator because of it's ancient design.

        "There's a good and a bad side of a battery. We were very good at the negative." - James Hetfield

        M 1 Reply Last reply
        0
        • T The Cake of Deceit

          Actually, AMD64 processors do support 8086 mode in long mode )see http://toastytech.com/guis/winvista2.html[^]), just that MS removed the old Win16 emulator because of it's ancient design.

          "There's a good and a bad side of a battery. We were very good at the negative." - James Hetfield

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          The author of that article is wrong: "Unsupported Modes. Long mode does not support the following two operating modes: "Virtual-8086 Mode—The virtual-8086 mode bit (EFLAGS.VM) is ignored when the processor is running in long mode. When long mode is enabled, any attempt to enable virtual-8086 mode is silently ignored. System software must leave long mode in order to use virtual-8086 mode." - from AMD Architecture Programmer's Manual, Volume 2, System Programming, Chapter 2, section 1.1. Revision 3.10 of February 2005. Microsoft could potentially have added an emulator, but opted not to do so. The existing code could not have worked, however, so this would have been a very extensive - and expensive - undertaking. The processor can execute 16-bit code - that is, set the default operand size and default address size to 16 bits - in long mode, but that is not enough to make legacy Win16 and DOS code work. That code expects to be able to manipulate hardware directly; virtual-8086 mode provides hooks for the OS to gain control when a disallowed instruction is executed, so the OS can emulate that one operation then return control to the application. In more recent processors, new virtualization modes have been added to fully virtualize the processor so that released operating systems can be run on it with the guest OS is fully unaware that it's being hosted. On these processors, the 64-bit OS (running in long mode) can host a 32-bit guest which can run a 16-bit app. However, these were not available when the 64-bit operating systems were first introduced.

          DoEvents: Generating unexpected recursion since 1991

          T 1 Reply Last reply
          0
          • M Mike Dimmick

            The author of that article is wrong: "Unsupported Modes. Long mode does not support the following two operating modes: "Virtual-8086 Mode—The virtual-8086 mode bit (EFLAGS.VM) is ignored when the processor is running in long mode. When long mode is enabled, any attempt to enable virtual-8086 mode is silently ignored. System software must leave long mode in order to use virtual-8086 mode." - from AMD Architecture Programmer's Manual, Volume 2, System Programming, Chapter 2, section 1.1. Revision 3.10 of February 2005. Microsoft could potentially have added an emulator, but opted not to do so. The existing code could not have worked, however, so this would have been a very extensive - and expensive - undertaking. The processor can execute 16-bit code - that is, set the default operand size and default address size to 16 bits - in long mode, but that is not enough to make legacy Win16 and DOS code work. That code expects to be able to manipulate hardware directly; virtual-8086 mode provides hooks for the OS to gain control when a disallowed instruction is executed, so the OS can emulate that one operation then return control to the application. In more recent processors, new virtualization modes have been added to fully virtualize the processor so that released operating systems can be run on it with the guest OS is fully unaware that it's being hosted. On these processors, the 64-bit OS (running in long mode) can host a 32-bit guest which can run a 16-bit app. However, these were not available when the 64-bit operating systems were first introduced.

            DoEvents: Generating unexpected recursion since 1991

            T Offline
            T Offline
            The Cake of Deceit
            wrote on last edited by
            #5

            Well, the guy does run Windows 95 as his primary OS...

            "What's everyone so worked up about? So there's a comet -- big deal. It'll burn up in our atmosphere and what's ever left will be no bigger than a chihuahua's head." - Homer Simpson

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups