A trivial SYSENTER/SYSCALL question

If a Windows executable makes use of SYSENTER and is executed on a processor implementing AMD64 ISA, what happens? I am both new and newbie to this topic (OSes, hardware/software interaction) but from what I've read I have understood that SYSCALL is the AMD64 equivalent to Intel's SYSENTER. Hopefully this question makes sense.

-------------Problems Reply------------

If you try to use SYSENTER where it is not supported, you'll probably get an "invalid opcode" exception. Note that this situation is unusual - generally, Windows executables do not directly contain instructions to enter kernel mode.

As far as i know AM64 processors using different type of modes to handle such issues.

SYSENTER works fine but is not that fast.

A very useful site to get started about the different modes: Wikipedia

They got rid of a bunch of unused functionality when they developed AMD64 extensions. One of the main ones is the elimination of the cs, ds, es, and ss segment registers. Normally loading segment registers is an extremely expensive operation (the CPU has to do permission checks, which could involve multiple memory accesses). Entering kernel mode requires loading new segment register values.

The SYSENTER instruction accelerates this by having a set of "shadow registers" which is can copy directly to the (internal, hidden) segment descriptors without doing any permission checks. The vast majority of the benefit is lost with only a couple of segment registers, so most likely the reasoning for removing the support for the instructions is that using regular instructions for the mode switch is faster.

Category:operating system Views:0 Time:2009-10-29

Related post

  • trivial firefox 6 question: seeing firebug, and how to see bookmarks as a panel along left hand side of window, like IE "Favorites" 2011-09-16

    In Firefox 6, the little firebug icon at the bottom right corner is moved ... is it gone? Also, can you tell me how do I display my bookmarks along the edge of the window, so I can rapidly go through my bookmarks and click on them? I just can't find

  • How to invoke a system call via sysenter in inline assembly (x86/amd64 linux)? 2012-02-29

    How can we implement the system call using sysenter/syscall directly in x86 Linux? Can anybody provide help? It would be even better if you can also show the code for amd64 platform. I know in x86, we can use __asm__( " movl $1, %eax \n" " movl $0, %

  • Creating Windows service without Visual Studio 2008-09-03

    So creating a Windows service using Visual Studio is fairly trivial. My question goes a bit deeper as to what actually makes an executable installable as a service & how to write a service as a straight C application. I couldn't find a lot of ref

  • NSDictionary. How do I create directly from aformated file? 2009-09-07

    This is a fairly trivial data parsing question. I'm just unclear on the methods I should be using to pull it off. I've got a plain text file of a few hundred lines. Each line is of exactly the same format. The lines are in contiguous chunks where the

  • WPF Startup Screen like Blend 2010-01-20

    Our main WPF window ('Main Window') takes considerable time to create (it is using a ribbon and docking panel similar to Visual Studio). Just like in Blend the first action will always be to either choose an existing project to work on or to create a

  • Are there any code libraries or languages with built-in support for Metric Time? 2010-06-15

    Metric time is documented here. I'm looking for any implementations of Metric time to Anglo-Babylonian Time (see article link) either as a library or built-into a programming language. With all the "joke" programming languages out there, it's possibl

  • Conversion of JPEG to SVG in Javascript 2010-10-26

    Can anyone help... how to convert Image to Vectors (SVG) through Javascript.......! Any help will be awesome....! --------------Solutions------------- What you're asking isn't really possible. I mean, you could try to do it, but I doubt the results w

  • Qt using boost::shared_ptr in a signal/slot 2011-01-26

    Is it possible, and if so, how can I create a signal/slot in Qt that is a const reference to a shared_ptr? I want a signal that looks like this: void signal( shared_ptr<SomeClass> const & ) I know how to do this without a constant reference

  • Git repository unique id 2011-02-14

    I need to find out if a commit belongs to a particular git repository. The idea is to generate some unique id for every repository I need to test. Then I can compare this unique id to the id, calculated from tested commit. For example take an SHA of

  • .NET XmlSerializer bug when two classes have properties with the same name 2011-04-14

    Have your flaming torches ready people! Someone on the Internet is suggesting there is a bug in the .NET framework! :-) Consider this contrived model: public class Barn { public Horse Horse { get; set; } public Motorcycle Motorcycle { get; set; } } p

  • How should I serialize data in conjunction with RestSharp? 2011-07-19

    I've recently started using RestSharp to consume a REST service which uses XML. It makes deserializing objects from XML to a collection of custom object trivial, but my question is what is the best way to re-serialize when posting back to the service

  • Migrating from TFS to Redmine 2011-10-19

    My team currently is using TFS 2010 for source control, builds and project management. We are moving to Git for source control, Cruise for builds, and Redmine for project management. We are using Git-Tfs right now to integrate our source control with

  • Visual Studio, library source when debugging 2011-11-07

    Just maybe trivial, maybe stupid question. I have two solutions: 1) The main app 2) The sets of libraries The first solution is accessible via the SourceSafe with the dll files(from the 2 solution) placed in its lib directory. In order to debug the m

  • Assembly language standard 2011-11-09

    Is there a standard that defines the syntax and semantics of assembly language? Similarly as language C has ISO standard and language C# has ECMA standard? Is there only one standard, or are there more of them? I'm asking because I noticed that assem

  • Big Differences Between Linux System Calls and INT 80 Software Interrupts 2011-12-13

    From a not so far removed picture of what is going on, could someone expound more on what is the difference between Linux's system calls like read() and write() etc. and writing them in assembly using the x86 INT opcode along with setting up the spec

  • How to control font appearance in Manipulator input field? 2011-12-21

    Apologies for making something that is probably trivial my first question here but I just realized I do not know how to style the font within the input field in a Manipulator control. None of the options for this function are for styling within the i

  • Android Bitmap Memory Use 2012-01-21

    I am running a stack of image filters and seem to be hitting some memory issues. At the beginning of the image processing I am using this much memory: GC_FOR_MALLOC freed 3K, 45% free 3237K/5831K, external 47586K/49634K, paused 17ms At the end I am u

  • Does ECL support callbacks? 2012-03-04

    Trivial as the question sounds, but after some time looking through the ECL documentation, CFFI documentation and resorting to google, I still could not arrive to a definitive answer. ECL docs mention nothing of a callback syntax, CFFI docs do not me

  • Initializing std::auto_ptr: "error: no match for call to '(std::auto_ptr) (int*)'" 2012-04-05

    I'm having trouble using std::auto_ptr. I try to compile the following on Ubuntu 11.10 using GCC 4.6.1, and I get the error message error: no match for call to ‘(std::auto_ptr<int>) (int*)’. #include <memory> #include <iostream> cla

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.125 (s). 11 q(s)