コード例 #1
0
t_stat rp_mbrd (int32 *data, int32 ofs, int32 drv)
{
uint32 val, dtype, i;
UNIT *uptr;

rp_update_ds (0, drv);                                  /* update ds */
uptr = rp_dev.units + drv;                              /* get unit */
if (uptr->flags & UNIT_DIS) {                           /* nx disk */
    *data = 0;
    return MBE_NXD;
    }
dtype = GET_DTYPE (uptr->flags);                        /* get drive type */
ofs = ofs & MBA_RMASK;                                  /* mask offset */
if (drv_tab[dtype].ctrl == RM_CTRL)                     /* RM? convert */
    ofs = ofs + RM_OF;

switch (ofs) {                                          /* decode offset */

    case RP_CS1_OF: case RM_CS1_OF:                     /* RPCS1 */
        val = (rpcs1[drv] & CS1_RW) | CS1_DVA;          /* DVA always set */
        break;

    case RP_DA_OF: case RM_DA_OF:                       /* RPDA */
        val = rpda[drv] = rpda[drv] & ~DA_MBZ;
        break;

    case RP_DS_OF: case RM_DS_OF:                       /* RPDS */
        val = rpds[drv];
        break;

    case RP_ER1_OF: case RM_ER1_OF:                     /* RPER1 */
        val = rper1[drv];
        break;

    case RP_AS_OF: case RM_AS_OF:                       /* RPAS */
        val = 0;
        for (i = 0; i < RP_NUMDR; i++) {
            if (rpds[i] & DS_ATA)
                val |= (AS_U0 << i);
            }
        break;

    case RP_LA_OF: case RM_LA_OF:                       /* RPLA */
        val = GET_SECTOR (rp_rwait, dtype) << LA_V_SC;
        break;

    case RP_MR_OF: case RM_MR_OF:                       /* RPMR */
        val = rpmr[drv];
        break;

    case RP_DT_OF: case RM_DT_OF:                       /* RPDT */
        val = drv_tab[dtype].devtype;
        break;

    case RP_SN_OF: case RM_SN_OF:                       /* RPSN */
        val = 020 | (drv + 1);
        break;

    case RP_OF_OF: case RM_OF_OF:                       /* RPOF */
        val = rpof[drv] = rpof[drv] & ~OF_MBZ;
        break;

    case RP_DC_OF: case RM_DC_OF:                       /* RPDC */
        val = rpdc[drv] = rpdc[drv] & ~DC_MBZ;
        break;

    case RP_CC_OF:                                      /* RPCC */
        val = rp_unit[drv].CYL;
        break;

    case RP_ER2_OF: case RM_ER2_OF:                     /* RPER2 */
        val = rper2[drv];
        break;

    case RP_ER3_OF:                                     /* RPER3 */
        val = rper3[drv];
        break;

    case RP_EC1_OF: case RM_EC1_OF:                     /* RPEC1 */
        val = rpec1[drv];
        break;

    case RP_EC2_OF: case RM_EC2_OF:                     /* RPEC2 */
        val = rpec2[drv];
        break;

    case RM_HR_OF:                                      /* RMHR */
        val = rmhr[drv] ^ DMASK;
        break;

    case RM_MR2_OF:                                     /* RHMR2 */
        val = rmmr2[drv];
        break;

   default:                                             /* all others */
        *data = 0;
        return MBE_NXR;
        }

*data = val;
return SCPE_OK;
}
コード例 #2
0
ファイル: entry.c プロジェクト: chunhualiu/OpenNT
VOID
NtProcessStartup(
    IN PBOOT_CONTEXT BootContextRecord
    )
/*++

Routine Description:

    Main entry point for setup loader. Control is transferred here by the
    start-up (SU) module.

Arguments:

    BootContextRecord - Supplies the boot context, particularly the
        ExternalServicesTable.

Returns:

    Does not return. Control eventually passed to the kernel.


--*/
{
    ARC_STATUS Status;

    //
    // Initialize the boot loader's video
    //

    DoGlobalInitialization(BootContextRecord);

    BlFillInSystemParameters(BootContextRecord);

    if (BootContextRecord->FSContextPointer->BootDrive == 0) {

        //
        // Boot was from A:
        //

        strcpy(BootPartitionName,"multi(0)disk(0)fdisk(0)");

        //
        // To get around an apparent bug on the BIOS of some MCA machines
        // (specifically the NCR 386sx/MC20 w/ BIOS version 1.04.00 (3421),
        // Phoenix BIOS 1.02.07), whereby the first int13 to floppy results
        // in a garbage buffer, reset drive 0 here.
        //

        GET_SECTOR(0,0,0,0,0,0,NULL);

#if defined(ELTORITO)
    } else if (BlIsElToritoCDBoot(BootContextRecord->FSContextPointer->BootDrive)) {

        //
        // Boot was from El Torito CD
        //

        sprintf(BootPartitionName, "multi(0)disk(0)cdrom(%u)", BootContextRecord->FSContextPointer->BootDrive);
        ElToritoCDBoot = TRUE;
#endif

    } else {

        //
        // Find the partition we have been booted from.  Note that this
        // is *NOT* necessarily the active partition.  If the system has
        // Boot Mangler installed, it will be the active partition, and
        // we have to go figure out what partition we are actually on.
        //
        BlGetActivePartition(BootPartitionName);

    }

    //
    // Initialize the memory descriptor list, the OS loader heap, and the
    // OS loader parameter block.
    //

    Status = BlMemoryInitialize();
    if (Status != ESUCCESS) {
        BlPrint("Couldn't initialize memory\n");
        while (1) {
        }
    }

    //
    // Initialize the OS loader I/O system.
    //

    Status = BlIoInitialize();
    if (Status != ESUCCESS) {
        BlPrint("Couldn't initialize I/O\n");
    }

    //
    // Call off to regular startup code
    //
    BlStartup(BootPartitionName);

    //
    // we should never get here!
    //
    do {
        GET_KEY();
    } while ( 1 );

}