Author Topic: sysenter vs int 80h  (Read 10031 times)

Offline MarisO

  • Jr. Member
  • *
  • Posts: 4
sysenter vs int 80h
« on: February 09, 2010, 03:10:13 PM »
hi

I'd like to use sysenter instead of int 80h but I couldn't find any information on how to do it.  Can you help me ?

Offline Bryant Keller

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 360
  • Country: us
    • About Bryant Keller
Re: sysenter vs int 80h
« Reply #1 on: February 09, 2010, 04:34:43 PM »
Here is a decent document I found through Galileo:

http://www.cs.auckland.ac.nz/compsci215s2c/lectures/robert/lecture15.pdf

About Bryant Keller
bkeller@about.me

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: sysenter vs int 80h
« Reply #2 on: February 09, 2010, 07:44:28 PM »
Is this with/for a 32-bit or 64-bit system?

Offline MarisO

  • Jr. Member
  • *
  • Posts: 4
Re: sysenter vs int 80h
« Reply #3 on: February 10, 2010, 02:44:48 PM »
32 bit

Offline MarisO

  • Jr. Member
  • *
  • Posts: 4
Re: sysenter vs int 80h
« Reply #4 on: February 10, 2010, 05:12:34 PM »
Here is a decent document I found through Galileo:

thanks  that's what I need :-)

Offline MarisO

  • Jr. Member
  • *
  • Posts: 4
Re: sysenter vs int 80h
« Reply #5 on: February 16, 2010, 12:13:59 PM »
Still I don't get how to use SYSENTER. Can I use it in my code (in 32 bit Linux)?
I tried to use SYSENTER and the programm segfaults.   I guess it is because CPU doesn't know where to return.  Linux needs to set EDX and ECX before returning (via SYSEXIT), but what does it put in these registers ?

I can't set EDX and ECX myself because it would conflict with , for example, write file syscall.
Code: [Select]
mov eax,4           
mov ebx,1           
mov ecx,msgAddress
mov edx,msgLen
int 80h   ;  SYSENTER here segfaults

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: sysenter vs int 80h
« Reply #6 on: February 16, 2010, 08:53:05 PM »