Fixed get os version in SHELL

Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
This commit is contained in:
2024-03-31 03:08:13 +03:00
parent fa4755138f
commit ec3af7f664
5 changed files with 64 additions and 54 deletions

View File

@@ -759,6 +759,34 @@ KOSAPI void _ksys_shutdown(uint32_t shd_param)
asm_inline("int $0x40" ::"a"(18), "b"(9), "c"(shd_param));
}
/*========= Function 18, subfunction 13 - get OS version. ========*/
#define KSYS_VER_HASH_LEN 9
typedef struct {
union {
struct {
uint8_t major;
uint8_t minor;
uint8_t patch;
uint8_t __reserved;
};
uint32_t value;
} tag;
uint16_t offset;
char hash[KSYS_VER_HASH_LEN + 1];
} ksys_os_ver_t;
KOSAPI int _ksys_get_os_ver(ksys_os_ver_t *ver)
{
int status;
asm_inline(
"int $0x40"
: "=a"(status)
: "a"(18), "b"(13), "c"(ver));
return status;
}
/*========= Function 18, subfunction 16 - get size of free RAM. ========*/
KOSAPI size_t _ksys_get_ram_size(void)