Re: Using sysarch specific syscalls in assembly?

From: ari edelkind (edelkind-freebsd-hackers_at_episec.com)
Date: 08/09/05

  • Next message: David Gilbert: "Bluetooth GPS for timekeeping?"
    To: freebsd-hackers@freebsd.org
    Date: Tue, 09 Aug 2005 15:45:41 +0000
    
    

    On 8/9/2005, "alexander" <arundel@h3c.de> wrote:

    [...]
    >Unfortunately I'm experiencing some problems right now. From time to time
    >I'm getting a
    >
    >'Bus error: 10 (core dumped)'
    >
    >This however appears randomly. One time I run the app everything works fine,the
    >next time it core dumps. Are there any errors in my code?
    >
    >%define SYSARCH 165 ; syscall sysarch(2)
    >%define I386_SET_IOPERM 4 ; i386_set_ioperm(2) number
    >
    >ioperm_args dd 378h
    > dd 3
    > dd 1
    >
    >OpenIO:
    > push byte ioperm_args
    > push dword I386_SET_IOPERM
    > mov eax,SYSARCH
    > Call _syscall
    [...]

    You need to push a _pointer_ to a structure as your second argument to
    sysarch(2). This means something more along the lines of:

    ioperm_args dd 378h
                  dd 3
                  dd 1

    argp dd ioperm_args

    [...]
          push dword argp
          push dword I386_SET_IOPERM
    [...]

    Get this wrong, and you'll have unpredictable results.

    ari
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: David Gilbert: "Bluetooth GPS for timekeeping?"

    Relevant Pages

    • Re: Xwindows and Emacs
      ... See if you have an app called xfontsel. ... non-proportional spacing font, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: Browser identification to websites
      ... Unfortunately my ISP ... App Name: Netscape ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: typewriter function for an impact printer?
      ... Does anyone know of an app that will give me an interactive session with ... use the enter key in the traditional typewriter ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • RE: app to look/view/inspect http traffic...
      ... i even thought at one time, that the app might be using cookies..although i ... somehow being keeping track of what the user was selecting during the ... To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ...
      (RedHat)
    • Re: SoundBlaster 16 PnP ISA Card on 5.1
      ... >> Off topic, but in hopes of clearing up the terminology at least, this is ... >> I doubt you're experiencing this... ... > of audio compression. ... To unsubscribe, ...
      (freebsd-questions)