The Möbius Operating System: System information
HOME DOWNLOAD DOCUMENTATION SCREENSHOTS  

System information


Data Structures

struct  sysinfo_t
 Information structure for SysGetInfo(). More...

struct  systimes_t
 Information structure for SysGetTimes(). More...


Defines

#define SHUTDOWN_HALT   0
#define SHUTDOWN_REBOOT   1
#define SHUTDOWN_POWEROFF   2
#define SHUTDOWN_FLUSH   3

Typedefs

typedef sysinfo_t sysinfo_t
typedef systimes_t systimes_t

Functions

int DbgWrite ()
 Writes a string to the debug log.

const wchar_t size_t length
int 
Hello ()
 Dummy system call for testing.

int int b unsigned SysUpTime ()
 Returns the number of milliseconds elapsed since the OS was booted.

void bool SysGetInfo ()
 Obtains various system information.

sysinfo_t *info bool SysGetTimes ()
 Obtains system timing information.

systimes_t *times bool SysShutdown ()
 Shuts down the system.

unsigned action void KeLeakBegin ()
 Initiates kernel memory leak tracking.

void void KeLeakEnd ()
 Ends kernel memory leak tracking and prints the results.

void void SysYield ()
 Allows another thread to run.

void void KeSetSingleStep ()
 Enables or disables single-step mode for the current thread.


Variables

const wchar_t * text
int a

Function Documentation

int DbgWrite  ) 
 

Writes a string to the debug log.

Parameters:
text String to write. Does not need to be nul-terminated.
length Length of the text parameter, in characters
Returns:
The number of characters written

const wchar_t size_t length int Hello  ) 
 

Dummy system call for testing.

Parameters:
a A number
b Another number
Returns:
The number 42

void void KeSetSingleStep  ) 
 

Enables or disables single-step mode for the current thread.

Parameters:
enable Set to true to enable single-step mode, or false to disable it

void bool SysGetInfo  ) 
 

Obtains various system information.

Parameters:
info Pointer to a sysinfo_t structure
Returns:
true if successful, false otherwise

struct sysinfo_t* info bool SysGetTimes  ) 
 

Obtains system timing information.

Parameters:
times Pointer to a systimes_t structure
Returns:
true if successful, false otherwise

struct systimes_t* times bool SysShutdown  ) 
 

Shuts down the system.

Exits all processes (except in the case of SHUTDOWN_FLUSH) and flushes unsaved data to disk, then carries out the action specified by the action parameter.

Parameters:
action Action to take after shutting down. One of:
  • SHUTDOWN_HALT: does not take any action after shutting down, but halts the system for a manual reboot
  • SHUTDOWN_REBOOT: reboots the system
  • SHUTDOWN_POWEROFF: turns the system power off
  • SHUTDOWN_FLUSH: returns to the application after flushing data to disk
Returns:
true if, for SHUTDOWN_FLUSH, the flush succeeded. Otherwise, false if the shutdown failed.

int int b unsigned SysUpTime  ) 
 

Returns the number of milliseconds elapsed since the OS was booted.

The resolution of the uptime counter is the same as the scheduler quantum. You can obtain the scheduler quantum using SysGetTimes().

Returns:
The system uptime, in milliseconds

void void SysYield  ) 
 

Allows another thread to run.

If there are any other lower-or-equal priority threads ready to run, they will be run, and the calling thread will be rescheduled afterwards. If there are no other threads ready to run, this function will return immediately.

Note:
Ready-to-run threads of higher priority will preempt the calling thread anyway, regardless of whether SysYield() is called.

Post a comment

From: