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. Hardware & Devices
  4. simple question

simple question

Scheduled Pinned Locked Moved Hardware & Devices
questionhelp
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.
  • W Offline
    W Offline
    whatever89
    wrote on last edited by
    #1

    hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks

    L B 3 Replies Last reply
    0
    • W whatever89

      hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Thread priority and time slicing take care of it. When an app calls CreateFile(), the IO manager calls into the driver that owns this symbolic link, hitting its dispatch handler with an IRP_MJ_CREATE. Same for WriteFIle() IRP_MJ_WRITE etc. And, if the app has opened the file for sync IO, that calling thread in the app will be blocked untill the driver completes that IRP (IO Request Packet). For data coming in, the driver will get an interupt, and this will absoloutely throw anything at a lower priority off the CPU and the system will call the drivers Interrupt handling routine. You should look at stuff online about the NT scheduler, kernel, interupts, and so on (XP is still windows NT by the way)

      Truth is the subjection of reality to an individuals perception

      1 Reply Last reply
      0
      • W whatever89

        hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Ah, and security. Memory in the virtual address space an app sits in is secured. So the app can only get to the bottom 2 gig on a 32 bit PC. The kernel has the top 2 gig.

        Truth is the subjection of reality to an individuals perception

        B 1 Reply Last reply
        0
        • L Lost User

          Ah, and security. Memory in the virtual address space an app sits in is secured. So the app can only get to the bottom 2 gig on a 32 bit PC. The kernel has the top 2 gig.

          Truth is the subjection of reality to an individuals perception

          B Offline
          B Offline
          Bram van Kampen
          wrote on last edited by
          #4

          I can only assume that you want to try and switch to Kernal Mode in the midst of your User Program. This is something that generally should not be needed in any user program. Windows puts up several layers of defence to stop you from doing so!, and for good reasons! (Remember Dos??)Read your Windows Documentation, find a way around whatever you want to achieve! In the long run, it is the better way, it is likely to continue on running with the next version of windows. If your program relies on anything in the kernal, it probably won't survive the next windows upgrade! (Don't be Stupid, I've Been there);)

          LateNightsInNewry

          1 Reply Last reply
          0
          • W whatever89

            hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks

            B Offline
            B Offline
            Bram van Kampen
            wrote on last edited by
            #5

            The Switching between User and Kernal mode, happens in the background, and is an issue that User Mode programmers(as opposed to System Mose Programmers, which are mostly those working for Microsoft, writing the Next version of Windows), should have NO Concern about! There are ways of putting the system in Kernal Mode, but, I'm Not going to tell you, because you sound like someone who has not a notion about how windows works. believe me, I am saving yourself, and the friends to whom you propose to pass your software on, from a lot of hassle which would ensue if you went that way! Go the Windows Way, and use the WIN32 Api. Excepting special programs (e.g. Specialist Debuggers) Kernal Mode switching IS Not Needed!!!

            LateNightsInNewry

            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