The HAL
All hardware access is via the HAL (Hardware Abstraction Layer). Any hardware platform that has a HAL written for it can run UOS.
The HAL standardizes the way that various CPU hardware features are accessed. These features include:
I/O Ports
Memory
Interrupts
Ring (protection) levels
Hardware devices
Numeric coprocessing
The HAL maps the UOS requests into the platform-appropriate code.
The implementation of the HAL is beyond the scope of this manual. The standard interface is as follows:
type THAL = class
public
function Allocate_RAM( Size : int64 ) : pointer ;
function Boot_Device : TDevice_Info ;
function Console : TTerminal ;
procedure Deallocate_RAM( Value : pointer ; Size : int64 ) ;
function Device( Index : integer ) : TDevice_Info ;
function Disable( Device_Type, Controller, Device_Unit : word ) : word ;
function Enable( Device_Type, Controller, Device_Unit : word ) : word ;
procedure Device_Reset ;
procedure Halt ;
function Heap : PHAL_Heap ;
function Memory( Index : integer ) : TMemory_Info ;
function Radix : longint ;
function Store( Index : integer ) : TCOM_Store64 ;
procedure Set_Timestamp( Value : int64 ) ;
function Timestamp : int64 ;
function Use_Line_Clock : boolean ;
function Get_Line_Clock : int64 ;
procedure Set_Line_Clock( Value : int64 ) ;
function Valid_Time : boolean ;
function Set_Configuration( Address : pointer ; Size : cardinal ) : cardinal ;
end ;
Method |
Description |
Allocate_RAM |
Allocates Size bytes of memory and returns a pointer to the first byte. Returns null if the memory couldn't be allocated. |
Boot_Device |
Returns information on the boot device. See TDevice_Info structure. |
Console |
Returns an instance of a TTerminal object used to access the system console. Returns null if there is no system console device. |
Deallocate_RAM |
Deallocates Size bytes of memory starting at Value. |
Device |
Returns information on the device at the passed Index. |
Device_Reset |
Resets all devices to initial state. |
Disable |
Disables the specified device. |
Enable |
Enables the specified device |
Get_Line_Clock |
Returns current line clock value. |
Halt |
Halts the system. |
Heap |
Returns a pointer to a HAL Heap instance. |
Memory |
Returns memory information for memory segment Index. |
Radix |
The base used for this hardware. For instance, Intel hardware would return 16 (hexadecimal). |
Set_Configuration |
Sets the startup configuration to the passed data. |
Set_Line_Clock |
Sets the line clock to Value. |
Set_Timestamp |
Sets the current clock to Value. |
Store |
Returns an instance of a TStore that corresponds to the device at index Index. Returns null if the index is invalid or the device is not a store. |
Timestamp |
Returns the current clock value. |
Use_Line_Clock |
Returns true if the system has a line clock. |
Valid_Time |
Returns true if the clock has a valid value. |
Note that this is an abstract interface and all of the methods use stdcall calling standard.
Date/Time
Date and time stamps in UOS use the Sirius Timestamp standard which is the number of 100ns intervals since 12:00:00 am, Jan 1, year 0 (projecting the current calendar back).