bioscall.c
sys/tss.h
ubixos/sched.h
vmm/vmm.h
lib/kmalloc.h
lib/bioscall.h
lib/string.h
sys/video.h
assert.h
sys/thread.h
ubixos/sched.h
lib/bioscall.h
ubixos/types.h
sys/_types.h
sys/video.h
lib/string.h
vmm/paging.h
vfs/file.h
sys/tss.h
lib/kmalloc.h
vmm/vmm.h
vfs/mount.h
src/sys/kernel/bioscall.c
assert.h
ubixfs/dirCache.h
sys/sysproto.h
sys/signal.h
ubixos/tty.h
asm
(".globl bios16Code\n"".code16 \n""bios16Code: \n""int $0x10 \n""int $0x69 \n"".code32 \n")
asm
".globl bios16Code\n"".code16 \n""bios16Code: \n""int $0x10 \n""int $0x69 \n"".code32 \n"
void void biosCall (int biosInt, int eax, int ebx, int ecx, int edx, int esi, int edi, int es, int ds) biosCall int biosInt int eax int ebx int ecx int edx int esi int edi int es int ds _current assert tssStruct::back_link bios16Code tssStruct::cr3 tssStruct::cs tssStruct::ds tssStruct::eax tssStruct::ebp tssStruct::ebx tssStruct::ecx tssStruct::edi tssStruct::edx EFLAG_IF EFLAG_VM tssStruct::eflags tssStruct::eip tssStruct::es tssStruct::esi tssStruct::esp tssStruct::esp0 tssStruct::esp1 tssStruct::esp2 tssStruct::fs tssStruct::gs tssStruct::io_map kmalloc tssStruct::ldt taskStruct::oInfo READY schedNewTask tssStruct::ss tssStruct::ss0 tssStruct::ss1 tssStruct::ss2 taskStruct::state tssStruct::trace_bitmap taskStruct::tss osInfo::v86Task x1000 x2000 systemTask

    /*****************************************************************************************
    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: bioscall_8c.xml 88 2016-01-12 00:11:29Z reddawg $

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

    #include<sys/tss.h>
    #include<ubixos/sched.h>
    #include<vmm/vmm.h>
    #include<lib/kmalloc.h>
    #include<lib/bioscall.h>
    #include<lib/string.h>
    #include<sys/video.h>
    #include<assert.h>

    asm(
    ".globlbios16Code\n"
    ".code16\n"
    "bios16Code:\n"
    "int$0x10\n"
    "int$0x69\n"
    ".code32\n"
    );

    voidbiosCall(intbiosInt,inteax,intebx,intecx,intedx,intesi,intedi,intes,intds){
    shortsegment=0x0,offset=0x0;
    uInt32tmpAddr=(uInt32)&bios16Code;
    kTask_t*newProcess=0x0;

    offset=tmpAddr&0xF;//lower4bits
    segment=tmpAddr>>4;

    newProcess=schedNewTask();
    assert(newProcess);

    newProcess->tss.back_link=0x0;
    newProcess->tss.esp0=(uInt32)kmalloc(0x2000)+0x2000;
    newProcess->tss.ss0=0x10;
    newProcess->tss.esp1=0x0;
    newProcess->tss.ss1=0x0;
    newProcess->tss.esp2=0x0;
    newProcess->tss.ss2=0x0;
    newProcess->tss.cr3=(uInt32)_current->tss.cr3;//(uInt32)vmmCreateVirtualSpace(newProcess->id);
    newProcess->tss.eip=offset&0xFFFF;
    newProcess->tss.eflags=2|EFLAG_IF|EFLAG_VM;
    newProcess->tss.eax=eax&0xFFFF;
    newProcess->tss.ebx=ebx&0xFFFF;
    newProcess->tss.ecx=ecx&0xFFFF;
    newProcess->tss.edx=edx&0xFFFF;
    newProcess->tss.esp=0x1000&0xFFFF;
    newProcess->tss.ebp=0x1000&0xFFFF;
    newProcess->tss.esi=esi&0xFFFF;
    newProcess->tss.edi=edi&0xFFFF;
    newProcess->tss.es=es&0xFFFF;
    newProcess->tss.cs=segment&0xFFFF;
    newProcess->tss.ss=0x1000&0xFFFF;
    newProcess->tss.ds=ds&0xFFFF;
    newProcess->tss.fs=0x0&0xFFFF;
    newProcess->tss.gs=0x0&0xFFFF;
    newProcess->tss.ldt=0x0&0xFFFF;
    newProcess->tss.trace_bitmap=0x0&0xFFFF;
    newProcess->tss.io_map=0x0&0xFFFF;
    newProcess->tss.io_map=sizeof(structtssStruct)-8192;
    newProcess->oInfo.v86Task=0x1;

    newProcess->state=READY;

    while(newProcess->state>0);

    return;
    }

    /***
    END
    ***/