283
|
1 module lib;
|
315
|
2 import ipc;
|
283
|
3
|
|
4 /*
|
|
5 Runtime library.
|
|
6 */
|
|
7
|
393
|
8 // Hack until something better exists:
|
|
9 function void putc(int c)
|
|
10 {
|
|
11 var int *UART0DR;
|
|
12 UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB
|
|
13 *UART0DR = c;
|
|
14 }
|
|
15
|
|
16 function void print(string txt)
|
283
|
17 {
|
|
18 // TODO
|
315
|
19 var ipc.Msg msg;
|
|
20 ipc.SendMessage(&msg);
|
393
|
21
|
|
22 // TBD: send text to putc or via send message??
|
|
23 var int i;
|
|
24 i = 0;
|
|
25
|
|
26 while (i < txt->len)
|
|
27 {
|
|
28 putc(cast<int>(txt->txt[i]));
|
|
29 i = i + 1;
|
|
30 }
|
283
|
31 }
|
|
32
|
|
33
|