Exemplo n.º 1
0
int hop(u32 newsegment)
{
    // Variables
    int j, i;
    u16 segment;
        
    // set it up to load umode properly!
    segment = (newsegment + 1) * MTXSEG; // calculate the newsegment
    kcopy(running->uss, segment, 32 * 1024);
    //load("/bin/u1", segment);
    for (i = 1; i <= 8; i++)
        put_word(j, segment, -2 * i);
    
    put_word(0x0200, segment, segment - 2);
    put_word(segment, segment, segment - 4);
    put_word(segment, segment, segment - 14);
    put_word(segment, segment, segment - 16);

    running->uss = segment;
    running->usp = segment - 16; //was 24

    printf("Proc[%d] hopped to segment 0x%x!\n", running->pid, segment);
    // return the proc!!!
    return (running->pid);
}
RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb)
{
    int rc = kcopy(pvSrc, pvDst, cb);
    if (RT_LIKELY(rc == 0))
        return VINF_SUCCESS;
    return VERR_ACCESS_DENIED;
}