Previous

Next

Bottom

Contents

Glossary

Index

 

CF1 User's Manual

Master Boot Record Functions

May 1999

Revision 1.00

 Persistor Instruments Inc.
© 1998 All rights reserved.

 NOT FINALIZED!

The functions in this section exist to support new features of PicoDOS 2.0 and should be considered experimental. Even with the woefully inadequate documentation that currently exists, these may be useful to more complex applications. Be warned that unlike the finalized BIOS and PicoDOS functions, these functions are subject to much change, and you should not use them if you are not prepared to recode your projects as the functions mature.

Quick Reference Table

MBRReadPartitionTable

MBRWritePartitionTable

MBRGetUsableSectors

MBRGetPartitionSectors

MBRCalcHSC

MBRMakePartitions

MBRDisplayBootRecord

#define MBR_MAX_PARTS   4               // max partitions on a storage device

enum
    {
      mbrErrorStart = MBR_ERRORS
    , mbrInvalidPartitionIndex  // invalid partition index (>= MBR_MAX_PARTS)
    , mbrInvalidDOSPrtnSector   // MBR is not valid DOS partition sector
    , mbrNotDOSPartitionType    // partition is not valid DOS type
    };

MBRReadPartitionSector -- Read the partition sector containing the MBR

Description



Prototype:

short MBRReadPartitionSector(ushort ssdid, ulong sector, uchar *psectbuf);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX
sector XXXXX
psectbuf XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRWritePartitionSector -- Write the partition sector containing the MBR

Description



Prototype:

short MBRWritePartitionSector(ushort ssdid, ulong sector, uchar *psectbuf);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX
sector XXXXX
psectbuf XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRReadPartitionTable -- Get the partition information

Description



Prototype:

short MBRReadPartitionTable(ushort ssdid, ulong sector, void *ptab);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX
sector XXXXX
ptab XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRWritePartitionTable -- Write the partition information

Description



Prototype:

short MBRWritePartitionTable(ushort ssdid, ulong sector, void *ptab);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX
sector XXXXX
ptab XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRGetUsableSectors -- Return the number of sectors available for data

Description



Prototype:

long MBRGetUsableSectors(ushort ssdid);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRGetPartitionSectors -- Return partition type with start and end (LBA) sectors

Description



Prototype:

short MBRGetPartitionSectors(ushort ssdid, ulong sector, ushort prtn, bool onlyDOS, ulong *firstSect, ulong *lastSect);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX
sector XXXXX
prtn XXXXX
onlyDOS XXXXX
firstSect XXXXX
lastSect XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRCalcHSC -- Calculate Head, Sector, and Cylinder from logical sector

Description



Prototype:

void MBRCalcHSC(ulong sector, ushort spt, ushort heads, uchar *head, ushort *sectcyl);

Definition:

#include <cf1pico.h>

Inputs:

sector XXXXX
spt XXXXX
heads XXXXX
head XXXXX
sectcyl XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRMakePartitions -- Partition the drive from working table

Description



Prototype:

short MBRMakePartitions(ushort ssdid, ulong sector, void *ptab);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX
sector XXXXX
ptab XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

MBRDisplayBootRecord -- Display the Master Boot Record information

Description



Prototype:

void MBRDisplayBootRecord(ushort ssdid);

Definition:

#include <cf1pico.h>

Inputs:

ssdid XXXXX

Returns:

XXXXX

Notes:

XXXXX

Timing:

TBD

 

Previous

Next

Top

Contents

Glossary

Index

Tel: 508-759-6434

Fax: 508-759-6436

Copyright (C) 1998 Persistor Instruments Inc. - All Rights Reserved