feat: add time syscall & command in shell
This commit is contained in:
@@ -39,6 +39,16 @@ namespace Zenith {
|
||||
static constexpr uint64_t SYS_GETARGS = 25;
|
||||
static constexpr uint64_t SYS_RESET = 26;
|
||||
static constexpr uint64_t SYS_SHUTDOWN = 27;
|
||||
static constexpr uint64_t SYS_GETTIME = 28;
|
||||
|
||||
struct DateTime {
|
||||
uint16_t Year;
|
||||
uint8_t Month;
|
||||
uint8_t Day;
|
||||
uint8_t Hour;
|
||||
uint8_t Minute;
|
||||
uint8_t Second;
|
||||
};
|
||||
|
||||
struct FbInfo {
|
||||
uint64_t width;
|
||||
|
||||
@@ -176,6 +176,9 @@ namespace zenith {
|
||||
if (rows) *rows = (int)(r >> 32);
|
||||
}
|
||||
|
||||
// Timekeeping (wall-clock)
|
||||
inline void gettime(Zenith::DateTime* out) { syscall1(Zenith::SYS_GETTIME, (uint64_t)out); }
|
||||
|
||||
// Power management
|
||||
[[noreturn]] inline void reset() {
|
||||
syscall0(Zenith::SYS_RESET);
|
||||
|
||||
Reference in New Issue
Block a user