On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTTarget-32 Programming Manual
RTTarget-32 Reference Manual
Introduction
RTTarget-32 Configuration
Screen I/O
Interrupt Handling
Port I/O
System Functions
Program Loading
Function RTLoadRTBFile
Function RTRunProgram
Function RTBootRM and RTBootPM
Function RTDLLThreadEvent
Function RTMakeBootDisk
Function RTRestoreBootSector
Function RTSetBootParams
Function RTGetBIOSDataPtr
Function RTSetBIOSData
Function RTTUefiBootSuccess
Memory Mapping and Management
Real-Time Clock and CMOS RAM
Keyboard
Mouse and Touch Screen Driver
Parallel Port Printer
Serial Port I/O
PCI BIOS
Plug-and-Play BIOS
PC Cards (PCMCIA)
MetaWINDOW Initialization
Run-Time System Support
System Management BIOS (SMBIOS)
Advanced Programmable Interrupt Controller (APIC)
Multiprocessor Management
Spinlocks
Advanced Configuration and Power Interface (ACPI) Tables
Extended RAM Management
RTVmf-32
RTRth-32
RTKernel-32
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Function RTMakeBootDisk
RTMakeBootDisk can create a bootable diskette or hard disk just like program BootDisk:
int RTMakeBootDisk(char LogicalDrive,
int BIOSDevice,
const char * RTBFileName,
char * Buffer,
int BufferSize,
DWORD Flags);
RTMakeBootDisk requires On Time's embedded file system RTFiles-32 and is not included in RTTarget-32's preconfigured system DLL Rtt32dll.dll.
ParametersLogicalDriveSpecifies the logical disk drive from which to boot. The new boot image file (.RTA file) will be created in the root directory of that drive.
BIOSDeviceSpecifies the physical device identification used by the BIOS for the device at boot time. If this parameter is set to -1, the disk loader will choose an appropriate default based on information passed by the BIOS.
RTBFileNamePoints to the file name of the .RTB file to install on the bootable drive.
BufferMust point to a temporary buffer to be used as a disk buffer by RTMakeBootDisk. It should have a size of at least Header Size + (Number of Sections * 4) + 1024. Values Header Size and Number of Sections are given in the [Application Image File Report] in the .LOC file of the .RTB file to install as a boot image. Larger sizes may improve performance for large .RTB files. For most .RTB files, 16k will be sufficient and 64k will yield good performance.
BufferSizeSpecifies the size in bytes of the buffer referenced by parameter Buffer.
FlagsZero or a combination of the following flags:
Value |
Meaning |
RT_BDISK_DEL_RTA |
RTMakeBootDisk should delete all .RTA files it finds on the target drive before the new .RTA file is created. If not specified, existing .RTA files are erased at the end of the operation. |
RT_BDISK_NO_EXT_BIOS |
Force the boot loader to use CHS instead of extended BIOS int 13h functions which use LBA sector addressing. This option cannot be used on disks larger than 8G bytes and is ignored for floppies (which always use CHS). |
RT_BDISK_LBA |
Force the boot loader to use LBA instead of CHS BIOS int 13h functions. This option may be required for USB or CD-ROM boot disks which are emulated as floopy disks by the BIOS. By default, floppies are accessed using CHS BIOS functions. |
return valueCan be one of the following:
Value |
Meaning |
RT_BDISK_SUCCESS |
The new boot image was installed successfully. |
RT_BDISK_OUT_OF_MEM |
The supplied buffer is too small. |
RT_BDISK_INVALID_RTB |
The .RTB file is invalid or was produced with an older version of RTTarget-32. |
RT_BDISK_ERROR_OPEN_DEVICE |
RTFiles-32 reported an error on the attempt to open a drive file for the target drive. |
RT_BDISK_NO_BOOT_CODE |
The .RTB file contains no valid boot code or disk buffer section. |
RT_BDISK_ERROR_CREATING_RTA |
RTMakeBootDisk was unable to create the boot image file on the target drive. |
RT_BDISK_NOT_CONTIGUOUS |
The boot image file is not contiguous. This error code exists for historical reasons and will never be returned. |
RT_BDISK_INVALID_SECTOR_SIZE |
The target drive has a sector size other than 512. |
RT_BDISK_ERROR_WRITE_BOOT_SECTOR |
RTMakeBootDisk was unable to write the new boot sector to disk. |
RT_BDISK_OLD_RTB |
The .RTB file is invalid or was produced with an older version of RTTarget-32. |
RT_BDISK_INVALID_BOOT_CODE |
The boot code found in the .RTB file is corrupted. |
RT_BDISK_RTB_NOT_FOUND |
RTMakeBootDisk was unable to open the given .RTB file. |
RT_BDISK_BIOS_CLASH |
The .RTB file requires data to be loaded over the BIOS data area below address 600h, which is not supported. The disk loader uses the BIOS, so its data area must not be clobbered during the load process. |
RT_BDISK_DISK_BUFFER_TOO_SMALL |
The disk buffer located in the loaded .RTB file is too small. |
RT_BDISK_DISK_FULL |
RTMakeBootDisk was unable to find a contiguous area on the target drive large enough to hold the .RTA file. Flag RT_BDISK_DEL_RTA may be able to fix this problem. If it does not, the application must delete files on the target drive until enough free space becomes available. |
When flag RT_BDISK_DEL_RTA is not specified, RTMakeBootDisk guarantees that the new program is properly installed or, in case of an error, any previously existing boot image is still bootable. With flag RT_BDISK_DEL_RTA set, the disk may be left in an unbootable state if the function fails. In particular, the following steps are performed:
- If no backup boot sector is present, the current boot sector is saved as file BOOTSECT.RTT on the target drive.
- If flag RT_BDISK_DEL_RTA is set, all .RTA files in the target drive's root directory are deleted.
- A contiguous temporary file to receive the boot image is created in the root directory of the target drive and is written.
- The new boot sector is written to the disk. If this step succeeds, the new boot image is now bootable.
- If not done already, all .RTA files in the target drive's root directory are deleted.
- The temporary file with the boot image is renamed to the .RTB file's base name with extension .RTA.
Unlike program Bootdisk, function RTMakeBootDisk does not set the partition hosting the target LogicalDrive active.
Function RTDLLThreadEvent
Function RTRestoreBootSector
|