sys_call_new.S
FAKE_MCOUNT
caller
pushl caller ; call __mcount ; popl %ecx
globl _sysCall_new text code32 globl _sysCall_new text code32 _sysCall_new _sysCall_new idt_init
globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl es movl fs call syscall popl fs popl es popl ds popal globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl es movl fs call syscall popl fs popl es popl ds popal addl addl
globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl es movl globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl es movl eax eax
globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl eax eax
globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl eax eax
globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl es movl fs call syscall popl fs popl es popl ds popal esp iret globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl eax movl ds movl es movl fs call syscall popl fs popl es popl ds popal esp iret invalidSysCall invalidSysCall
globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl globl _sysCall_new text code32 esp pushal pushl ds pushl es pushl fs movl x10 x10

    /*****************************************************************************************
    Copyright(c)2002-2004TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,are
    permittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistof
    conditions,thefollowingdisclaimerandthelistofauthors.Redistributionsinbinary
    formmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowing
    disclaimerandthelistofauthorsinthedocumentationand/orothermaterialsprovided
    withthedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftware
    withoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANY
    EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOF
    MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALL
    THECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,
    SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENT
    OFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,OR
    TORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHIS
    SOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: sys__call__new_8S.xml 88 2016-01-12 00:11:29Z reddawg $

    *****************************************************************************************/

    #defineFAKE_MCOUNT(caller)pushlcaller;call__mcount;popl%ecx

    .globl_sysCall_new
    .text
    .code32
    _sysCall_new:
    pushl$2/*sizeof"int0x80"*/
    subl$4,%esp/*skipovertf_trapno*/
    pushal
    pushl%ds
    pushl%es
    pushl%fs
    /*switchtokernelsegments*/
    movl$0x10,%eax
    movl%eax,%ds
    movl%eax,%es
    movl%eax,%fs
    //FAKE_MCOUNT(TF_EIP(%esp))
    callsyscall
    //MEXITCOUNT
    //jmpdoreti
    popl%fs
    popl%es
    popl%ds
    popal
    addl$8,%esp
    iret

    invalidSysCall:
    push%eax
    callinvalidCall
    pop%eax
    movl$-1,%eax
    iret

    /***
    END
    ***/