2020-12-13 10:09:28 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
2020-11-02 13:07:36 +01:00
|
|
|
typedef unsigned int uint32_t;
|
|
|
|
|
|
|
|
static inline
|
|
|
|
int start_app(char *app_name, char *args){
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
struct file_op_t
|
|
|
|
{
|
|
|
|
uint32_t fn;
|
|
|
|
uint32_t flags;
|
|
|
|
char* args;
|
|
|
|
uint32_t res1, res2;
|
|
|
|
char zero;
|
|
|
|
char* app_name __attribute__((packed));
|
|
|
|
} file_op;
|
|
|
|
#pragma pack(pop)
|
|
|
|
memset(&file_op, 0, sizeof(file_op));
|
|
|
|
file_op.fn = 7;
|
|
|
|
file_op.args = args;
|
|
|
|
file_op.app_name = app_name;
|
|
|
|
|
|
|
|
register int val;
|
2020-12-13 12:41:03 +01:00
|
|
|
asm volatile ("int $0x40":"=a"(val):"a"(70), "b"(&file_op): "memory");
|
2020-11-02 13:07:36 +01:00
|
|
|
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
|
|
|
void notify(char *text) {
|
|
|
|
start_app("/sys/@notify", text);
|
|
|
|
}
|