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

System information


Compounds

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 (const wchar_t *text, size_t length)
 Writes a string to the debug log.

int Hello (int a, int b)
 Dummy system call for testing.

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

bool SysGetInfo (struct sysinfo_t *info)
 Obtains various system information.

bool SysGetTimes (struct systimes_t *times)
 Obtains system timing information.

bool SysShutdown (unsigned action)
 Shuts down the system.

void KeLeakBegin (void)
 Initiates kernel memory leak tracking.

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

void SysYield (void)
 Allows another thread to run.

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


Function Documentation

int DbgWrite const wchar_t *  text,
size_t  length
 

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

int Hello int  a,
int  b
 

Dummy system call for testing.

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

void KeSetSingleStep bool  enable  ) 
 

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

bool SysGetInfo struct sysinfo_t info  ) 
 

Obtains various system information.

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

bool SysGetTimes struct systimes_t times  ) 
 

Obtains system timing information.

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

bool SysShutdown unsigned  action  ) 
 

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.

unsigned SysUpTime void   ) 
 

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 SysYield void   ) 
 

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: