33 lines
506 B
C
33 lines
506 B
C
str term_namespace = "/dev/term/0";
|
|
str hello = "nuqneH 'u'?";
|
|
str nl = "\n";
|
|
|
|
plex Terminal {
|
|
nat handle;
|
|
}
|
|
|
|
/**
|
|
* Main function
|
|
*/
|
|
function main() {
|
|
str msg = hello;
|
|
pln(msg);
|
|
}
|
|
|
|
/**
|
|
* Print with a newline
|
|
*/
|
|
function pln(str message) {
|
|
str term_ns = term_namespace;
|
|
int mode = 0;
|
|
|
|
Terminal term = open(term_ns, mode);
|
|
|
|
int msg_len = message.length;
|
|
write(term, message, msg_len);
|
|
|
|
str nl_local = nl;
|
|
int nl_len = nl.length;
|
|
write(term, nl_local, nl_len);
|
|
}
|